From a6c09238f337b2061b221ae15c8235075922e3da Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Tue, 21 May 2019 09:51:50 +0000 Subject: wireguard-tools: move to community Closes: GH-7980 --- community/wireguard-tools/APKBUILD | 66 +++++++++++++++++++++++++++ community/wireguard-tools/alpine-compat.patch | 12 +++++ testing/wireguard-tools/APKBUILD | 66 --------------------------- testing/wireguard-tools/alpine-compat.patch | 12 ----- 4 files changed, 78 insertions(+), 78 deletions(-) create mode 100644 community/wireguard-tools/APKBUILD create mode 100644 community/wireguard-tools/alpine-compat.patch delete mode 100644 testing/wireguard-tools/APKBUILD delete mode 100644 testing/wireguard-tools/alpine-compat.patch 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 +# Maintainer: Stuart Cardall + +# 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 + } + diff --git a/testing/wireguard-tools/APKBUILD b/testing/wireguard-tools/APKBUILD deleted file mode 100644 index e08a2b0ac5..0000000000 --- a/testing/wireguard-tools/APKBUILD +++ /dev/null @@ -1,66 +0,0 @@ -# Contributor: Stuart Cardall -# Maintainer: Stuart Cardall - -# 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/testing/wireguard-tools/alpine-compat.patch b/testing/wireguard-tools/alpine-compat.patch deleted file mode 100644 index 1268ffb6b9..0000000000 --- a/testing/wireguard-tools/alpine-compat.patch +++ /dev/null @@ -1,12 +0,0 @@ -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 - } - -- cgit v1.2.3