summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: bd0b5bf0ef3441f5d2257d3acb59ea98d7e44fa0 (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
# Maintainer: OpenSorcerer <alex at opensourcery dot eu>
pkgname=airvpn-suite
_pkgname=AirVPN-Suite
pkgver=1.0.0
pkgrel=6
_commit="fee05fd016b22d222ec85846786c1d627b03b40e"
pkgdesc="AirVPN client software collection including Bluetit, Goldcrest and Hummingbird – stable"
arch=('x86_64')
url="https://gitlab.com/AirVPN/$_pkgname"
license=('GPL3')
provides=('hummingbird-bin' 'hummingbird' 'airvpn-suite-bin' 'airvpn-suite-beta-bin')
conflicts=('hummingbird-bin' 'hummingbird' 'airvpn-suite-bin' 'airvpn-suite-beta-bin')
depends=('dbus' 'openssl' 'libxml2' 'xz' 'lz4' 'crypto++')
makedepends=('gcc' 'make' 'pkgconf' 'autoconf' 'automake' 'git')
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 documentation
    install -Dm755 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
    
    # place license
    install -Dm755 LICENSE.md "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"

    # place configuration
    install -Dm600 -t "$pkgdir/etc/" "$_pkgname"/etc/airvpn/*

    # place D-Bus config#
    install -Dm644 -t "$pkgdir/etc/dbus-1/system.d/" "$_pkgname"/etc/dbus-1/system.d/*

    # place Systemd service
    install -Dm644 "$_pkgname/etc/systemd/system/bluetit.service" "$pkgdir/etc/systemd/system/bluetit.service"
}