summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2d2b1f7e0d5afe9c919b51977a35770baeef496b (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
# Maintainer: Akari-chan <`echo bWkudnUuc2VkYWlAZ21haWwuY29tCg== | base64 -d`>
# Upstream author: Chris Bouchard <https://github.com/chrisbouchard>

pkgname=namespaced-wireguard-vpn-git
_pkgname=namespaced-wireguard-vpn
pkgver=r30.0ac54bb
pkgrel=1

pkgdesc='Systemd configuration for a network namespace containing a WireGuard VPN connection'
url='https://github.com/chrisbouchard/namespaced-wireguard-vpn'
arch=('any')
license=('MIT')

depends=('findutils' 'wireguard-tools' 'bash')
makedepends=('git')

source=("$pkgname::git+https://github.com/chrisbouchard/namespaced-wireguard-vpn")
sha256sums=(SKIP)

provides=("$_pkgname")
conflicts=("$_pkgname")

backup=(etc/$_pkgname/namespaced-wireguard-vpn.conf)

pkgver() {
    cd "$srcdir/$pkgname"
    printf 'r%s.%s\n' "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

package() {
    cd "$srcdir/$pkgname"

    install -m 644 -D LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
    install -m 644 -D README.md "$pkgdir/usr/share/doc/$_pkgname/README.md"


    # why not sbin: https://stackoverflow.com/a/51032471
    install -m 755 -D -t "$pkgdir/usr/bin" bin/*

    install -m 600 -D -t "$pkgdir/etc/$_pkgname" conf/*

    install -m 644 -D -t "$pkgdir/usr/lib/systemd/system" systemd/*
}