summaryrefslogtreecommitdiff
path: root/user/wireguard-tools/APKBUILD
blob: 493da9d37ef402b41bebeb8ffe41f70ae7df4da0 (plain) (blame)
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
# Contributor: Luis Ressel <aranea@aixah.de>
# Maintainer: Luis Ressel <aranea@aixah.de>
pkgname=wireguard-tools
_pkgreal=WireGuard
pkgver=0.0.20190406
pkgrel=0
pkgdesc="Userland tools for the WireGuard VPN"
url="https://www.wireguard.com/"
arch="all"
options="!check" # no test suite
license="GPL-2.0-only"
depends="bash iproute2"
makedepends="libmnl-dev"
subpackages="$pkgname-bash-completion:bashcomp:noarch $pkgname-doc wireguard-patch:_patch:noarch"
source="https://git.zx2c4.com/WireGuard/snapshot/$_pkgreal-$pkgver.tar.xz"
builddir="$srcdir/$_pkgreal-$pkgver"

build() {
	cd "$builddir"
	make RUNSTATEDIR=/run -C src/tools
}

package() {
	cd "$builddir"
	make WITH_BASHCOMPLETION=yes WITH_WGQUICK=yes DESTDIR="$pkgdir" -C src/tools install
}

bashcomp() {
	depends="$pkgname"
	pkgdesc="$pkgdesc (Bash completion)"

	mkdir -p "$subpkgdir/usr/share"
	mv "$pkgdir/usr/share/bash-completion" "$subpkgdir/usr/share/"
}

_patch() {
	depends=""
	pkgdesc="Kernel patch for the WireGuard VPN"

	cd "$builddir"
	mkdir -p "$subpkgdir/usr/share/wireguard"
	contrib/kernel-tree/create-patch.sh > "$subpkgdir/usr/share/wireguard/wireguard-$pkgver.patch"

}

sha512sums="e3035030299f5a6ae3ac0c2e35dc2d54745cda8f31185b21c6590f1ddcc9c7a83bf7b71cc71f6d48ed6dc8f2b31f3c704f8fa85685d4113f4c560f7eba7b7d5e  WireGuard-0.0.20190406.tar.xz"