aboutsummaryrefslogtreecommitdiffstats
path: root/community/wireguard-tools
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2019-05-21 09:51:50 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2019-05-21 11:01:05 +0000
commita6c09238f337b2061b221ae15c8235075922e3da (patch)
tree6ced1a5bccb1d97d72a83274d75493e1ff7db4ef /community/wireguard-tools
parentc58b76f2f17d1136847918f7dae77f6a14879e1f (diff)
downloadaports-a6c09238f337b2061b221ae15c8235075922e3da.tar.bz2
aports-a6c09238f337b2061b221ae15c8235075922e3da.tar.xz
wireguard-tools: move to community
Closes: GH-7980
Diffstat (limited to 'community/wireguard-tools')
-rw-r--r--community/wireguard-tools/APKBUILD66
-rw-r--r--community/wireguard-tools/alpine-compat.patch12
2 files changed, 78 insertions, 0 deletions
diff --git a/community/wireguard-tools/APKBUILD b/community/wireguard-tools/APKBUILD
new file mode 100644
index 0000000000..e08a2b0ac5
--- /dev/null
+++ b/community/wireguard-tools/APKBUILD
@@ -0,0 +1,66 @@
+# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
+# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
+
+# NOTE: pkgrel must match _toolsrel in wireguard-vanilla
+pkgname=wireguard-tools
+pkgver=0.0.20190406
+pkgrel=0
+pkgdesc="Next generation secure network tunnel: userspace tools"
+arch='all'
+url='https://www.wireguard.com'
+license="GPL-2.0"
+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() {
+ cd "$builddir"
+ make -C src/tools
+}
+
+package() {
+ cd "$builddir"
+ 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="e3035030299f5a6ae3ac0c2e35dc2d54745cda8f31185b21c6590f1ddcc9c7a83bf7b71cc71f6d48ed6dc8f2b31f3c704f8fa85685d4113f4c560f7eba7b7d5e WireGuard-0.0.20190406.tar.xz
+4577574333f023217ae6e0945807e1ccd2dec7caa87e329b1d5b44569f6b5969663ad74f8154b85d3dc7063dd762649e3fa87c7667e238ffb77c0e5df9245a5e alpine-compat.patch"
diff --git a/community/wireguard-tools/alpine-compat.patch b/community/wireguard-tools/alpine-compat.patch
new file mode 100644
index 0000000000..1268ffb6b9
--- /dev/null
+++ b/community/wireguard-tools/alpine-compat.patch
@@ -0,0 +1,12 @@
+diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
+--- a/src/tools/wg-quick/linux.bash
++++ b/src/tools/wg-quick/linux.bash
+@@ -201,7 +201,7 @@
+ cmd ip $proto rule add table main suppress_prefixlength 0
+ while read -r key _ value; do
+ [[ $value -eq 1 ]] && sysctl -q "$key=2"
+- done < <(sysctl -a -r '^net\.ipv4.conf\.[^ .=]+\.rp_filter$')
++ done < <(sysctl -a 2>/dev/null | sed -n -r 's#^(net\.ipv4.conf\.[^ .=]+\.rp_filter).*$#\1#p')
+ return 0
+ }
+