summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 657a85040d9a95b529fe47a834b7d615ab5b8ac3 (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
# Maintainer: Louis Nelson Jr. <https://lousclues.com>
pkgname=vpn-shroud
pkgver=2.4.3
pkgrel=1
pkgdesc="A provider-agnostic VPN connection manager for Linux with kill switch, auto-reconnect, and system tray integration"
arch=('x86_64')
url="https://github.com/lousclues-labs/shroud"
license=('GPL-3.0-or-later')
depends=('networkmanager' 'dbus' 'gcc-libs' 'glibc')
makedepends=('rust')
optdepends=(
    'networkmanager-openvpn: OpenVPN support'
    'networkmanager-wireguard: WireGuard support'
    'iptables: kill switch (iptables backend)'
    'nftables: kill switch (nftables backend, preferred)'
)
provides=('shroud')
conflicts=('shroud')
options=(!lto)
backup=('etc/sudoers.d/shroud')
install=shroud.install
source=("$pkgname-$pkgver.tar.gz::https://github.com/lousclues-labs/shroud/archive/v$pkgver.tar.gz")
sha256sums=('cc13d8c3bf50188bbbab46b6e94d1d64bb606e09bc5008a650797b9d239a53d4')

prepare() {
    cd "shroud-$pkgver"
    export RUSTUP_TOOLCHAIN=stable
    cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

build() {
    cd "shroud-$pkgver"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    cargo build --frozen --release
}

check() {
    cd "shroud-$pkgver"
    export RUSTUP_TOOLCHAIN=stable
    export CARGO_TARGET_DIR=target
    # Only run unit tests — integration/security tests require D-Bus, NM, iptables
    cargo test --frozen --release --lib
}

package() {
    cd "shroud-$pkgver"

    # Binary
    install -Dm755 "target/release/shroud" "$pkgdir/usr/bin/shroud"

    # Systemd service (fix binary path for system package)
    install -Dm644 "assets/shroud.service" "$pkgdir/usr/lib/systemd/system/shroud.service"
    sed -i 's|/usr/local/bin/shroud|/usr/bin/shroud|g' "$pkgdir/usr/lib/systemd/system/shroud.service"

    # Sudoers rule for passwordless kill switch
    install -Dm440 "assets/sudoers.d/shroud" "$pkgdir/etc/sudoers.d/shroud"

    # Desktop entry (app launcher + autostart capable)
    install -Dm644 "autostart/shroud.desktop" "$pkgdir/usr/share/applications/shroud.desktop"

    # Example headless config
    install -Dm644 "assets/shroud-headless.conf.example" \
        "$pkgdir/usr/share/doc/$pkgname/shroud-headless.conf.example"

    # Documentation
    install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
    install -Dm644 LICENSE "$pkgdir/usr/share/doc/$pkgname/LICENSE"
    install -Dm644 CHANGELOG.md "$pkgdir/usr/share/doc/$pkgname/CHANGELOG.md"

    # Docs directory
    for doc in docs/*.md; do
        install -Dm644 "$doc" "$pkgdir/usr/share/doc/$pkgname/docs/$(basename "$doc")"
    done
}