aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-11-08 15:57:37 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-11-08 16:05:30 +0100
commit32881d8e055e3f150cb7696da6ce2e8d18251a8c (patch)
treeb1b63de4b3ac3369eb5a1cab7dfc36c5cf40ccc1
parenta15e77246064efcd76fe2008240eced480f18762 (diff)
downloadaports-32881d8e055e3f150cb7696da6ce2e8d18251a8c.tar.bz2
aports-32881d8e055e3f150cb7696da6ce2e8d18251a8c.tar.xz
testing/jool-vanilla: build also for linux-virt
Based on aport community/wireguard-vanilla.
-rw-r--r--testing/jool-vanilla/APKBUILD61
1 files changed, 49 insertions, 12 deletions
diff --git a/testing/jool-vanilla/APKBUILD b/testing/jool-vanilla/APKBUILD
index 3e628d5b71..f640b3e7a3 100644
--- a/testing/jool-vanilla/APKBUILD
+++ b/testing/jool-vanilla/APKBUILD
@@ -5,10 +5,19 @@
# when changing _ver we *must* bump _rel!
_name=jool
_ver=4.0.6
-_rel=0
+_rel=1
+
+# for custom kernels set $FLAVOR
+_flavor="$FLAVOR"
+_extra_flavors=""
+if [ -z "$FLAVOR" ]; then
+ _flavor=vanilla
+ case $CARCH in
+ x86 | x86_64) _extra_flavors="virt";;
+ esac
+fi
# kernel verson
-_flavor=${FLAVOR:-vanilla}
_kpkg=linux-$_flavor
_kver=4.19.80
_krel=0
@@ -19,40 +28,68 @@ _kabi="$_kver-$_krel-$_flavor"
pkgname=$_name-$_flavor
pkgver=$_kver
pkgrel=$(( $_krel + $_rel ))
-pkgdesc="SIIT and NAT64 for Linux"
+pkgdesc="SIIT and NAT64 for Linux (kernel modules for $_flavor)"
url="https://jool.mx"
arch="all"
license="GPL-2.0-or-later"
depends="$_kpkg=$_kpkgver"
makedepends="$_kpkg-dev=$_kpkgver linux-headers"
install_if="$_kpkg=$_kpkgver $_name"
+subpackages=""
source="https://github.com/NICMx/Jool/releases/download/v$_ver/$_name-$_ver.tar.gz"
builddir="$srcdir/$_name-$_ver"
options="!check"
+for _f in $_extra_flavors; do
+ makedepends="$makedepends linux-$_f-dev=$_kpkgver"
+ subpackages="$subpackages $_name-$_f:_extra"
+done
+
prepare() {
default_prepare
- local _kapkbuild=../../main/linux-$_flavor/APKBUILD
- if [ -f $_kapkbuild ]; then
- ( . $_kapkbuild
- pkgname=$_name-$_flavor
+ 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() {
- make -C src/mod \
- MODULES_DIR=/lib/modules/$_kabi
+ unset LDFLAGS
+
+ local flavor; for flavor in $_flavor $_extra_flavors; do
+ make -C "$srcdir"/"$flavor"/src/mod \
+ MODULES_DIR="/lib/modules/$_kver-$_krel-$flavor"
+ done
}
package() {
- make -C src/mod modules_install \
- MODULES_DIR=/lib/modules/$_kabi \
- INSTALL_MOD_PATH="$pkgdir"
+ _modules_install "$_flavor" "$pkgdir"
+}
+
+_extra() {
+ local flavor=${subpkgname##*-}
+ depends="linux-$flavor=$_kpkgver"
+ install_if="linux-$flavor=$_kpkgver $_name"
+ pkgdesc="SIIT and NAT64 for Linux (kernel modules for $flavor)"
+
+ _modules_install "$flavor" "$subpkgdir"
+}
+
+_modules_install() {
+ local flavor="$1"
+ local destdir="$2"
+
+ make -C "$srcdir"/$flavor/src/mod modules_install \
+ MODULES_DIR=/lib/modules/$_kver-$_krel-$flavor \
+ INSTALL_MOD_PATH="$destdir"
}
sha512sums="8648cc876d801b34c4bc9616da642727d1e49ed2937daa7fdca58c0fd80dbd1c432018af410c44c1d24224aba5289f726f43adc259cdf8193832d39a86d0f6a6 jool-4.0.6.tar.gz"