blob: efc0ff539764ca21f67ed550bb2f839c17def7c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
PACKAGER="Laurent Brock <incognito0135@protonmail.com>"
pkgname=piavpn-bin
pkgver=3.6.1
build_number=08339
# https://www.privateinternetaccess.com/pages/changelog
epoch=1 # Switch versioning schemes for guaranteed upgrades
pkgrel=3
pkgdesc="Private Internet Access client"
arch=('x86_64' 'aarch64')
url="https://privateinternetaccess.com/"
license=('custom')
depends=(libxkbcommon-x11 libnl zip)
optdepends=('WIREGUARD-MODULE: to use the wireguard kernel module instead')
makedepends=(libcap)
provides=(piavpn)
conflicts=(pia-launch pia-manager pia-tools private-internet-access-vpn)
install=piavpn-bin.install
source_x86_64=("https://installers.privateinternetaccess.com/download/pia-linux-${pkgver}-${build_number}.run")
source_aarch64=("https://installers.privateinternetaccess.com/download/pia-linux-arm64-${pkgver}-${build_number}.run")
options=(!strip)
sha256sums_x86_64=('6f14c63c7b7fbc5e7482ea2fb42381afade6dc8bcf9816632813adfa112ca613')
sha256sums_aarch64=('523bd7e87328ba01934585275f6d95d0bba070f2a7f050fc578c701d6dbca803')
# == You need to enable and start piavpn.service. Run sudo systemctl enable --now piavpn.service ==
prepare() {
_pia_run="pia-linux-${pkgver}-${build_number}.run"
if [ "$CARCH" == "aarch64" ] ;then
_pia_run="pia-linux-arm64-${pkgver}-${build_number}.run"
fi
env -i /bin/sh $_pia_run --noexec --target "${srcdir}/$pkgname-${pkgver}-${build_number}"
}
check() {
grep -a 'targetdir="pia-linux' "${srcdir}/pia-linux-${pkgver}-${build_number}.run" | cut -d'-' -f3
}
package() {
cd "$pkgname-$pkgver-$build_number"
mkdir -p $pkgdir/opt/piavpn/bin
cp -a piafiles/* $pkgdir/opt/piavpn
cp installfiles/*.sh $pkgdir/opt/piavpn/bin
chmod +x $pkgdir/opt/piavpn/bin/*.sh
setcap 'cap_net_bind_service=+ep' $pkgdir/opt/piavpn/bin/pia-unbound
# we don't need these scripts
rm $pkgdir/opt/piavpn/bin/install-wireguard.sh
rm $pkgdir/opt/piavpn/bin/pia-uninstall.sh
mkdir -p $pkgdir/usr/share/pixmaps
cp installfiles/app-icon.png $pkgdir/usr/share/pixmaps/piavpn.png
mkdir -p $pkgdir/usr/share/icons/hicolor/1024x1024/apps/
ln -s /usr/share/pixmaps/pia.png $pkgdir/usr/share/icons/hicolor/1024x1024/apps/pia.png
mkdir -p $pkgdir/usr/share/applications
cp installfiles/piavpn.desktop $pkgdir/usr/share/applications/piavpn.desktop
mkdir -p $pkgdir/etc/NetworkManager/conf.d
echo -e "[keyfile]\nunmanaged-devices=interface-name:wgpia*" > $pkgdir/etc/NetworkManager/conf.d/50-wgpia.conf
mkdir -p $pkgdir/usr/lib/systemd/system
cp installfiles/piavpn.service $pkgdir/usr/lib/systemd/system/piavpn.service
sed -i '/^After/s/syslog.target //' $pkgdir/usr/lib/systemd/system/piavpn.service
mkdir -p $pkgdir/usr/share/licenses/$pkgname/
mv $pkgdir/opt/piavpn/share/LICENSE.txt $pkgdir/usr/share/licenses/$pkgname/
# fix permissions: no need for executable bit
find $pkgdir/usr -type f -exec chmod -x {} \;
mkdir -p $pkgdir/usr/local/bin
ln -s ../../../opt/piavpn/bin/piactl $pkgdir/usr/local/bin/piactl
# Temporary fix for systemd update 256.7 -> 256.8, will remove ASAP
ln -s /usr/lib/libcrypto.so.3 $pkgdir/opt/piavpn/libcrypto.so.3
# limit log to the minimum to avoid excessive flooding
mkdir -p $pkgdir/opt/piavpn/var
cat > $pkgdir/opt/piavpn/var/debug.txt << EOF
[rules]
*.debug=false
*.info=false
*.warning=false
EOF
}
# == You need to enable and start piavpn.service. Run sudo systemctl enable --now piavpn.service ==
|