aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2019-01-05 23:34:44 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2019-01-05 23:38:02 +0000
commit8bbf99be2e60a2fe53f41735d50161f98770fdef (patch)
treead8ffde0e658c1e1b7efde8efe497e71a88a15d5
parent8bc22b8a46a30aa4e64f128b008dd6e9c01dfea4 (diff)
downloadaports-8bbf99be2e60a2fe53f41735d50161f98770fdef.tar.bz2
aports-8bbf99be2e60a2fe53f41735d50161f98770fdef.tar.xz
testing/wireguard-tools: split wg and wg-quick
We split wg and wg-quick into seperate packages but let the main pacakge pull both of them in. This way they can have their own deps and we can pull them in independently. We also patch wg-quick to ue busybox sysctl.
-rw-r--r--testing/wireguard-tools/APKBUILD24
-rw-r--r--testing/wireguard-tools/alpine-compat.patch29
2 files changed, 28 insertions, 25 deletions
diff --git a/testing/wireguard-tools/APKBUILD b/testing/wireguard-tools/APKBUILD
index 29a32cdc32..6d9f0d24da 100644
--- a/testing/wireguard-tools/APKBUILD
+++ b/testing/wireguard-tools/APKBUILD
@@ -4,14 +4,19 @@
# NOTE: pkgrel must match _toolsrel in wireguard-vanilla
pkgname=wireguard-tools
pkgver=0.0.20181218
-pkgrel=1
+pkgrel=2
pkgdesc="Next generation secure network tunnel: userspace tools"
arch='all'
url='https://www.wireguard.com'
license="GPL-2.0"
makedepends="libmnl-dev"
-depends="iproute2 procps coreutils"
-subpackages="$pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
+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
@@ -38,6 +43,17 @@ package() {
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"
@@ -47,4 +63,4 @@ bashcomp() {
}
sha512sums="73c8e9b37d857349b75df776607c15ea2082814952acdba3ad6379c4ce631601db2767603e46ecadf1bce9348a0c26d07f4f6b5857ddd72bb4f4411d1d13d88c WireGuard-0.0.20181218.tar.xz
-be16a4b547b9ed60d7cd2b7dddb1ec8001f38faf8340bd76013e631c4c376a2fcd45b757296ac7422b53d7f14c759eecc41376bc6e01159c3bc5bdb121413598 alpine-compat.patch"
+4577574333f023217ae6e0945807e1ccd2dec7caa87e329b1d5b44569f6b5969663ad74f8154b85d3dc7063dd762649e3fa87c7667e238ffb77c0e5df9245a5e alpine-compat.patch"
diff --git a/testing/wireguard-tools/alpine-compat.patch b/testing/wireguard-tools/alpine-compat.patch
index ec7deae02b..1268ffb6b9 100644
--- a/testing/wireguard-tools/alpine-compat.patch
+++ b/testing/wireguard-tools/alpine-compat.patch
@@ -1,25 +1,12 @@
diff --git a/src/tools/wg-quick/linux.bash b/src/tools/wg-quick/linux.bash
-index 48ce163..a2a0738 100755
--- a/src/tools/wg-quick/linux.bash
+++ b/src/tools/wg-quick/linux.bash
-@@ -1,9 +1,18 @@
--#!/bin/bash
-+#!/bin/sh
- # SPDX-License-Identifier: GPL-2.0
- #
- # Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
- #
+@@ -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
+ }
-+if [ -z "$BASH_VERSION" ]; then
-+ if ! type bash >/dev/null 2>&1; then
-+ echo "Please run 'apk add bash' and try again." >&2
-+ exit 1
-+ fi
-+ exec bash "$0" "$@"
-+fi
-+set +o posix
-+
- set -e -o pipefail
- shopt -s extglob
- export LC_ALL=C
-