2019-06-04 19:16:46 +02:00
|
|
|
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
|
|
|
|
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
|
|
|
|
|
|
|
|
# wireguard version
|
2019-08-21 11:09:06 +02:00
|
|
|
_ver=0.0.20190702
|
2019-06-04 19:16:46 +02:00
|
|
|
_rel=0
|
|
|
|
|
|
|
|
# kernel version
|
2019-08-21 11:09:06 +02:00
|
|
|
_kver=4.19.52
|
2019-06-04 19:16:46 +02:00
|
|
|
_krel=0
|
|
|
|
|
|
|
|
_kpkgver="$_kver-r$_krel"
|
|
|
|
|
|
|
|
# for custom kernels set $FLAVOR
|
|
|
|
_extra_flavors=
|
|
|
|
if [ -z "$FLAVOR" ]; then
|
|
|
|
_flavor=vanilla
|
|
|
|
case $CARCH in
|
|
|
|
x86|x86_64) _extra_flavors="virt";;
|
|
|
|
esac
|
|
|
|
else
|
|
|
|
_flavor=$FLAVOR
|
|
|
|
fi
|
|
|
|
_kpkg=linux-$_flavor
|
|
|
|
|
|
|
|
pkgname=wireguard-$_flavor
|
|
|
|
pkgver=$_kver
|
2019-08-21 11:09:06 +02:00
|
|
|
pkgrel=$(( $_rel + $_krel))
|
2019-06-04 19:16:46 +02:00
|
|
|
|
|
|
|
pkgdesc="Next generation secure network tunnel: kernel modules for $_flavor"
|
|
|
|
arch="all"
|
|
|
|
url="https://www.wireguard.com"
|
|
|
|
license="GPL-2.0"
|
|
|
|
depends="linux-$_flavor=$_kpkgver"
|
|
|
|
makedepends="
|
|
|
|
libmnl-dev
|
|
|
|
linux-$_flavor-dev=$_kpkgver
|
|
|
|
linux-firmware-none
|
|
|
|
"
|
|
|
|
install_if="wireguard-tools-wg=$_ver-r$_rel linux-$_flavor=$_kpkgver"
|
|
|
|
options="!check"
|
|
|
|
source="https://git.zx2c4.com/WireGuard/snapshot/WireGuard-$_ver.tar.xz"
|
|
|
|
builddir="$srcdir"/WireGuard-$_ver
|
|
|
|
|
|
|
|
for f in $_extra_flavors; do
|
|
|
|
makedepends="$makedepends linux-$f-dev=$_kpkgver"
|
|
|
|
subpackages="$subpackages wireguard-$f:_extra"
|
|
|
|
done
|
|
|
|
|
|
|
|
prepare() {
|
|
|
|
default_prepare
|
|
|
|
if [ -z "$FLAVOR" ]; then
|
|
|
|
( . "$startdir"/../../main/linux-$_flavor/APKBUILD
|
|
|
|
[ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver"
|
|
|
|
[ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel"
|
|
|
|
return 0
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
local flavor=
|
|
|
|
for flavor in $_flavor $_extra_flavors; do
|
|
|
|
cp -r "$builddir" "$srcdir"/$flavor
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
build() {
|
|
|
|
unset LDFLAGS
|
|
|
|
local flavor= kabi=
|
|
|
|
for flavor in $_flavor $_extra_flavors; do
|
|
|
|
kabi="$_kver-$_krel-$flavor"
|
|
|
|
make -C "$srcdir/$flavor"/src \
|
|
|
|
KERNELDIR=/lib/modules/$kabi/build module
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
|
|
|
local kabi="$_kver-$_krel-$_flavor"
|
|
|
|
install -Dm644 "$srcdir"/$_flavor/src/wireguard.ko \
|
|
|
|
"$pkgdir/lib/modules/$kabi/extra/wireguard.ko"
|
|
|
|
}
|
|
|
|
|
|
|
|
_extra() {
|
|
|
|
flavor=${subpkgname##*-}
|
|
|
|
depends="linux-$flavor=$_kpkgver"
|
|
|
|
install_if="wireguard-tools-wg=$_ver-r$_rel linux-$flavor=$_kpkgver"
|
|
|
|
pkgdesc="Next generation secure network tunnel: kernel modules for $flavor"
|
|
|
|
local kabi="$_kver-$_krel-$flavor"
|
|
|
|
install -Dm644 "$srcdir"/virt/src/wireguard.ko \
|
|
|
|
"$subpkgdir/lib/modules/$kabi/extra/wireguard.ko"
|
|
|
|
}
|
|
|
|
|
2019-08-21 11:09:06 +02:00
|
|
|
sha512sums="8b92b51506cd3f8e9939378b86f23678e08e8501432decd0abf6a9d4e3dfe4742b6f1cb75e06407f5816778b3dd90849a5da83252ab882392ec1905dfb997501 WireGuard-0.0.20190702.tar.xz"
|