summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2902f294622fd8a90f3ebaf35156338560fce6a9 (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
# 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"
}