aboutsummaryrefslogtreecommitdiffstats
path: root/main/wireguard-tools/APKBUILD
blob: 5f17fad452f42a1bb44f3a4e11c0cc2b9a012ca2 (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
47
48
49
50
51
52
53
54
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=wireguard-tools
pkgver=1.0.20210223
pkgrel=0
pkgdesc="Next generation secure network tunnel: userspace tools"
arch="all"
url="https://www.wireguard.com"
# SPDX identifier headers tells us 'GPL-2.0' but considering it
# is a kernel project i think it is safe to assume it is GPL-2.0-only just
# like the kernel.
license="GPL-2.0-only"
_wg_quick_deps="iproute2 ip6tables bash openresolv"
makedepends="libmnl-dev $_wg_quick_deps"
depends="$pkgname-wg $pkgname-wg-quick"
subpackages="
	$pkgname-doc
	$pkgname-bash-completion
	$pkgname-wg:_split
	$pkgname-wg-quick:_split:noarch
	"
options="!check"
source="https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-$pkgver.tar.xz"

build() {
	make -C src
}

package() {
	mkdir -p "$pkgdir/usr/share/doc/$pkgname"

	make -C src \
		DESTDIR="$pkgdir" \
		WITH_BASHCOMPLETION=yes \
		WITH_WGQUICK=yes \
		WITH_SYSTEMDUNITS=no \
		install

	find "$builddir"/contrib -name '.gitignore' -delete
	cp -rf "$builddir"/contrib "$pkgdir/usr/share/doc/$pkgname/"
}

_split() {
	local cmd=${subpkgname/$pkgname-}
	pkgdesc="$pkgdesc ($cmd)"
	case $cmd in
		wg-quick) depends="$pkgname-wg=$pkgver-r$pkgrel $_wg_quick_deps" ;;
		*) depends= ;;
	esac
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/$cmd "$subpkgdir"/usr/bin/
}

sha512sums="98855853a3ecfce23a0a6bf4a885c85efaf2b08c9a92e0d3800fe40ae9adf05fdf4443150a71319bd9b53e314c8032694ea978db850a238813232a0c04edf692  wireguard-tools-1.0.20210223.tar.xz"