diff options
author | OpenSourcerer | 2021-04-17 17:53:19 +0200 |
---|---|---|
committer | OpenSourcerer | 2021-04-17 17:53:19 +0200 |
commit | 130c9c0fa63abac3b9b7cd455afc9a79f0a94544 (patch) | |
tree | 5fb48e8e617c633dda32379c6573b43b028a2e30 | |
download | aur-130c9c0fa63abac3b9b7cd455afc9a79f0a94544.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 28 | ||||
-rw-r--r-- | PKGBUILD | 63 | ||||
-rw-r--r-- | airvpn-suite.install | 39 |
3 files changed, 130 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..01f61039ba7f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,28 @@ +pkgbase = airvpn-suite + pkgdesc = AirVPN client software collection including Bluetit, Goldcrest and Hummingbird + pkgver = 1.0.0 + pkgrel = 1 + url = https://gitlab.com/AirVPN/AirVPN-Suite + install = airvpn-suite.install + arch = x86_64 + license = GPL3 + makedepends = gcc + makedepends = make + makedepends = cmake + makedepends = pkgconf + makedepends = autoconf + makedepends = automake + makedepends = git + makedepends = crypto++ + depends = dbus + depends = openssl + depends = libxml2 + depends = xz + depends = lz4 + provides = hummingbird-bin + conflicts = hummingbird-bin + source = git+https://gitlab.com/AirVPN/AirVPN-Suite.git#commit=fee05fd016b22d222ec85846786c1d627b03b40e + sha256sums = SKIP + +pkgname = airvpn-suite + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..2902f294622f --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,63 @@ +# Maintainer: OpenSourcerer <alex at opensourcery dot eu> +pkgname=airvpn-suite +_pkgname=AirVPN-Suite +pkgver=1.0.0 +pkgrel=1 +_commit="fee05fd016b22d222ec85846786c1d627b03b40e" +pkgdesc="AirVPN client software collection including Bluetit, Goldcrest and Hummingbird" +arch=('x86_64') +url="https://gitlab.com/AirVPN/$_pkgname" +license=('GPL3') +provides=('hummingbird-bin') +conflicts=('hummingbird-bin') +depends=('dbus' 'openssl' 'libxml2' 'xz' 'lz4') +makedepends=('gcc' 'make' 'cmake' 'pkgconf' 'autoconf' 'automake' 'git' 'crypto++') +source=("git+$url.git#commit=$_commit") +sha256sums=('SKIP') +install="$pkgname.install" + +build() { + # set vars needed by original OpenVPN3 build scripts + export O3="$srcdir/O3" && mkdir "$O3" + export DEP_DIR="$O3/deps" && mkdir "$DEP_DIR" + export DL="$O3/dl" && mkdir "$DL" + cd "$O3" + + # clone and build OpenVPN3 core + git clone https://github.com/AirVPN/openvpn3-airvpn.git core + cd core/scripts/linux + ./build-all + + # move directories around for the suite build scripts + cd "$srcdir" + mv "$O3/core" "$srcdir/openvpn3-airvpn" + mv "$O3/deps/asio" "$srcdir" + + # build the suite + cd AirVPN-Suite + ./build-bluetit.sh + ./build-goldcrest.sh + ./build-hummingbird.sh +} + +package() { + cd $srcdir/$_pkgname + + # place binaries + install -Dm755 bluetit "$pkgdir/usr/bin/bluetit" + install -Dm755 goldcrest "$pkgdir/usr/bin/goldcrest" + install -Dm755 hummingbird "$pkgdir/usr/bin/hummingbird" + + # place configuration + cd $_pkgname/etc + for file in airvpn/*; do + install -Dm644 "$file" "$pkgdir/etc/$file" + done + + # place D-Bus config + install -Dm644 dbus-1/system.d/org.airvpn.client.conf "$pkgdir/etc/dbus-1/system.d/org.airvpn.client.conf" + install -Dm644 dbus-1/system.d/org.airvpn.server.conf "$pkgdir/etc/dbus-1/system.d/org.airvpn.server.conf" + + # place Systemd service + install -Dm644 systemd/system/bluetit.service "$pkgdir/etc/systemd/system/bluetit.service" +} diff --git a/airvpn-suite.install b/airvpn-suite.install new file mode 100644 index 000000000000..cb5b10562ee6 --- /dev/null +++ b/airvpn-suite.install @@ -0,0 +1,39 @@ +post_install() { + getent passwd airvpn >/dev/null + if [ $? -eq '2' ]; then + useradd -Um airvpn + fi + chown -R airvpn:airvpn /etc/airvpn + + echo "#########################################################" + echo "If you want to be able to execute goldcrest as your user," + echo "add yourself to the airvpn group, like this:" + echo "sudo usermod -aG airvpn <username>" + echo "#########################################################" + + # workaround for ExecStart path hardcoded in unit file + # ln -s /usr/bin/bluetit /sbin/bluetit + + systemctl daemon-reload + systemctl enable bluetit.service + systemctl start bluetit.service +} + +pre_upgrade() { + systemctl stop bluetit.service +} + +post_upgrade() { + systemctl start bluetit.service +} + +pre_remove() { + systemctl stop bluetit.service + systemctl disable bluetit.service +} + +post_remove() { + userdel -r airvpn 2>/dev/null + getent group airvpn >/dev/null && gpasswd airvpn -M "" && groupdel airvpn + # rm /sbin/bluetit +} |