# Contributor: Stuart Cardall # Maintainer: Stuart Cardall pkgname=wireguard-tools pkgver=0.0.20191012 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" makedepends="libmnl-dev" depends="$pkgname-wg $pkgname-wg-quick" subpackages=" $pkgname-doc $pkgname-bash-completion:bashcomp:noarch $pkgname-wg:_split $pkgname-wg-quick:_split:noarch " options="!check" source="https://git.zx2c4.com/WireGuard/snapshot/WireGuard-$pkgver.tar.xz alpine-compat.patch " builddir="$srcdir"/WireGuard-$pkgver build() { make -C src/tools } package() { mkdir -p "$pkgdir/usr/share/doc/$pkgname" make -C src/tools \ DESTDIR="$pkgdir" \ WITH_BASHCOMPLETION=yes \ WITH_WGQUICK=yes \ WITH_SYSTEMDUNITS=no \ install find "$builddir"/contrib/examples -name '.gitignore' -delete cp -rf "$builddir"/contrib/examples "$pkgdir/usr/share/doc/$pkgname/" } _split() { local cmd=${subpkgname/$pkgname-} pkgdesc="$pkgdesc ($cmd)" case $cmd in wg-quick) depends="$pkgname-wg iproute2 bash openresolv" ;; *) depends= ;; esac mkdir -p "$subpkgdir"/usr/bin mv "$pkgdir"/usr/bin/$cmd "$subpkgdir"/usr/bin/ } bashcomp() { depends="bash" pkgdesc="WireGuard bash completions" mkdir -p "$subpkgdir"/usr mv "$pkgdir"/usr/share "$subpkgdir"/usr } sha512sums="b15424036f26298d8511ca0d0d6a485ff0992726d61fabff8bf6dd64d0a65423bf901e5eb14d3080372017390b05d25faff89a72128932c7408f93f59165c321 WireGuard-0.0.20191012.tar.xz 07218933ca0b6891d159498dc4e92e3e178a91018d78775118fcad97425a212b8b36b04cf7f29c48b624fb8bbd4bc0d18cdf98ac3f3caf0034342d2195f9f129 alpine-compat.patch"