aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2019-11-09 00:27:07 +0100
committerJakub Jirutka <jakub@jirutka.cz>2019-11-09 01:09:50 +0100
commit4f7bd6ea4fb87f7cab69141bf29924ded805863c (patch)
treef3fb0be2cbc3ae6acdb765d7da8f83358a56859f
parentf53ed5185cfe7029f0503e7ec8b5f2b71ef70753 (diff)
downloadaports-4f7bd6ea4fb87f7cab69141bf29924ded805863c.tar.bz2
aports-4f7bd6ea4fb87f7cab69141bf29924ded805863c.tar.xz
testing/jool: refactor aport, handle all flavors as subpackages
The original approach copied from the wireguard-vanilla aport doesn't make damn sense...
-rw-r--r--testing/jool/APKBUILD63
1 files changed, 25 insertions, 38 deletions
diff --git a/testing/jool/APKBUILD b/testing/jool/APKBUILD
index f640b3e7a3..816315f779 100644
--- a/testing/jool/APKBUILD
+++ b/testing/jool/APKBUILD
@@ -3,60 +3,54 @@
# jool version
# when changing _ver we *must* bump _rel!
-_name=jool
_ver=4.0.6
-_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
+_rel=2
# kernel verson
-_kpkg=linux-$_flavor
_kver=4.19.80
_krel=0
-
_kpkgver="$_kver-r$_krel"
-_kabi="$_kver-$_krel-$_flavor"
-pkgname=$_name-$_flavor
+pkgname=jool
pkgver=$_kver
pkgrel=$(( $_krel + $_rel ))
-pkgdesc="SIIT and NAT64 for Linux (kernel modules for $_flavor)"
+pkgdesc="SIIT and NAT64 for Linux (virtual package for kernel modules)"
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"
+makedepends="linux-headers"
+install_if="jool-tools $pkgname=$pkgver-r$pkgrel"
subpackages=""
-source="https://github.com/NICMx/Jool/releases/download/v$_ver/$_name-$_ver.tar.gz"
-builddir="$srcdir/$_name-$_ver"
+source="https://github.com/NICMx/Jool/releases/download/v$_ver/$pkgname-$_ver.tar.gz"
+builddir="$srcdir/$pkgname-$_ver"
options="!check"
-for _f in $_extra_flavors; do
+# for custom kernels set $FLAVOR
+_flavors="$FLAVOR"
+if [ -z "$_flavors" ]; then
+ _flavors="vanilla"
+ case $CARCH in
+ x86 | x86_64) _flavors="$_flavors virt";;
+ esac
+fi
+
+for _f in $_flavors; do
makedepends="$makedepends linux-$_f-dev=$_kpkgver"
- subpackages="$subpackages $_name-$_f:_extra"
+ subpackages="$subpackages $pkgname-$_f:_module"
done
prepare() {
default_prepare
if [ -z "$FLAVOR" ]; then
- ( . "$startdir"/../../main/linux-$_flavor/APKBUILD
+ ( . "$startdir"/../../main/linux-${_flavors%% *}/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
+ local flavor; for flavor in $_flavors; do
cp -r "$builddir" "$srcdir"/$flavor
done
}
@@ -64,32 +58,25 @@ prepare() {
build() {
unset LDFLAGS
- local flavor; for flavor in $_flavor $_extra_flavors; do
+ local flavor; for flavor in $_flavors; do
make -C "$srcdir"/"$flavor"/src/mod \
MODULES_DIR="/lib/modules/$_kver-$_krel-$flavor"
done
}
package() {
- _modules_install "$_flavor" "$pkgdir"
+ mkdir -p "$pkgdir"
}
-_extra() {
+_module() {
local flavor=${subpkgname##*-}
depends="linux-$flavor=$_kpkgver"
- install_if="linux-$flavor=$_kpkgver $_name"
+ install_if="$pkgname=$pkgver-$pkgrel linux-$flavor=$_kpkgver"
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"
+ INSTALL_MOD_PATH="$subpkgdir"
}
sha512sums="8648cc876d801b34c4bc9616da642727d1e49ed2937daa7fdca58c0fd80dbd1c432018af410c44c1d24224aba5289f726f43adc259cdf8193832d39a86d0f6a6 jool-4.0.6.tar.gz"