diff options
author | xentec <xentec@aix0.eu> | 2018-02-21 00:40:24 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-03-05 11:23:32 +0000 |
commit | 39b040c6827e4273e82bd4dc78529d71e3a73264 (patch) | |
tree | c8e5487a47c4ea877218265f7f92f64293fd1db7 /community/virtualbox-guest-modules-vanilla | |
parent | 810493476f47d2d1f3bfdb1f1d5bdedf8ce9d86a (diff) | |
download | aports-39b040c6827e4273e82bd4dc78529d71e3a73264.tar.bz2 aports-39b040c6827e4273e82bd4dc78529d71e3a73264.tar.xz |
[kmodule]-vanilla: clean up, streamline, modernize
Diffstat (limited to 'community/virtualbox-guest-modules-vanilla')
-rw-r--r-- | community/virtualbox-guest-modules-vanilla/APKBUILD | 59 |
1 files changed, 28 insertions, 31 deletions
diff --git a/community/virtualbox-guest-modules-vanilla/APKBUILD b/community/virtualbox-guest-modules-vanilla/APKBUILD index a4d17fbd91..536d4618f0 100644 --- a/community/virtualbox-guest-modules-vanilla/APKBUILD +++ b/community/virtualbox-guest-modules-vanilla/APKBUILD @@ -1,27 +1,39 @@ # Maintainer: Ben Allen <bensallen@me.com> # Contributor: Ben Allen <bensallen@me.com> +# when chaning _ver we *must* bump _rel +_name=virtualbox-guest-modules +_ver=5.2.2 +_rel=0 + _flavor=${FLAVOR:-vanilla} _kpkg=linux-$_flavor _kver=4.14.20 -_kpkgrel=0 +_krel=0 -# when chaning _ver we *must* bump _mypkgrel -_ver=5.2.2 -_mypkgrel=0 -_name=virtualbox-guest-modules +_kpkgver="$_kver-r$_krel" +_kabi=$_kver-$_krel-$_flavor +_kabi_virt=$_kver-$_krel-virt -_kpkgver="$_kver-r$_kpkgrel" -_abi_release=${_kver}-${_kpkgrel}-${_flavor} -_abi_release_virt=${_kver}-${_kpkgrel}-virt +# verify the kernel version before entering chroot +_kapkbuild=../../main/linux-vanilla/APKBUILD +if [ -f $_kapkbuild ]; then + ( . $_kapkbuild + pkgname=$_name-$_flavor + [ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver" + [ "$_krel" != "$pkgrel" ] && die "please update _krel to $pkgrel" + return 0 + ) +fi -pkgname=${_name}-${_flavor} +pkgname=$_name-$_flavor pkgver=$_kver -pkgrel=$(($_kpkgrel + $_mypkgrel)) +pkgrel=$(($_krel + $_rel)) + pkgdesc="VirtualBox Additions guest kernel modules for $_flavor" arch='x86 x86_64' url='http://virtualbox.org' -license="GPL custom" +license="GPL-2.0 custom" makedepends="linux-vanilla-dev=$_kpkgver linux-virt-dev=$_kpkgver sed coreutils" subpackages="$_name-virt:virt" source="http://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2 @@ -33,27 +45,12 @@ builddir="$srcdir"/VirtualBox-$_ver prepare() { local i - ( - # verify the kernel version before entering chroot - _kapkbuild="$startdir"/../../main/linux-${_flavor}/APKBUILD - if [ -f $_kapkbuild ]; then - . $_kapkbuild - pkgname=$_name-$_flavor - if [ "$_kver" != "$pkgver" ]; then - die "please update _kver to $pkgver" - fi - if [ "$_kpkgrel" != "$pkgrel" ]; then - die "please update _kpkgrel to $pkgrel" - fi - fi - ) - cd "$builddir" default_prepare "$builddir"/src/VBox/Additions/linux/export_modules.sh \ "$srcdir/vbox-kmod-$_ver.tar.gz" - for i in $_abi_release $_abi_release_virt; do + for i in $_kabi $_kabi_virt; do mkdir -p "$srcdir/$i" tar -C "$srcdir/$i" -zxf "$srcdir"/vbox-kmod-$_ver.tar.gz done @@ -61,7 +58,7 @@ prepare() { build() { local i - for i in $_abi_release $_abi_release_virt; do + for i in $_kabi $_kabi_virt; do cd "$srcdir/$i" # Build Kernel Modules make KERN_DIR=/lib/modules/${i}/build @@ -70,7 +67,7 @@ build() { package() { local i module= - for i in $_abi_release $_abi_release_virt; do + for i in $_kabi $_kabi_virt; do cd "$srcdir/$i" for module in *.ko; do install -v -D -m644 ${module} \ @@ -83,8 +80,8 @@ virt() { pkgdesc="VirtualBox Additions kernel modules for virt" mkdir -p "$subpkgdir"/lib/modules/ # vboxvideo.ko won't load with virt kernel as it doesn't have DRM - rm "$pkgdir"/lib/modules/$_abi_release_virt/misc/vboxvideo.ko - mv "$pkgdir"/lib/modules/$_abi_release_virt \ + rm "$pkgdir"/lib/modules/$_kabi_virt/misc/vboxvideo.ko + mv "$pkgdir"/lib/modules/$_kabi_virt \ "$subpkgdir"/lib/modules/ } |