# Maintainer: Ben Allen # Contributor: Ben Allen _flavor=${FLAVOR:-grsec} _kpkg=linux-$_flavor _kver=4.4.18 _kpkgrel=0 # when chaning _ver we *must* bump _mypkgrel _ver=5.1.2 _mypkgrel=0 _name=virtualbox-guest-modules # verify the kernel version before entering chroot _kapkbuild=../../linux-${_flavor}/APKBUILD if [ -f $_kapkbuild ]; then . $_kapkbuild pkgname=$_name-$_flavor [ "$_kver" != "$pkgver" ] && die "please update _kver to $pkgver" [ "$_kpkgrel" != "$pkgrel" ] && die "please update _kpkgrel to $pkgrel" fi _kpkgver="$_kver-r$_kpkgrel" _abi_release=${_kver}-${_kpkgrel}-${_flavor} _abi_release_virtgrsec=${_kver}-${_kpkgrel}-virtgrsec pkgname=${_name}-${_flavor} pkgver=$_kver pkgrel=$(($_kpkgrel + $_mypkgrel)) pkgdesc="VirtualBox Additions kernel modules for $_flavor " arch='x86 x86_64' url='http://virtualbox.org' license="GPL custom" makedepends="linux-grsec-dev=$_kpkgver sed coreutils" subpackages="$_name-virtgrsec:_virtgrsec" source="http://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2 " builddir="$srcdir"/VirtualBox-$_ver prepare() { local i cd "$builddir" $builddir/src/VBox/Additions/linux/export_modules "$builddir/vbox-kmod.tar.gz" tar -xf "$builddir/vbox-kmod.tar.gz" for i in $_abi_release $_abi_release_virtgrsec; do mkdir -p "$srcdir/$i" tar -C "$srcdir/$i" -zxf "$builddir"/vbox-kmod.tar.gz done } build() { local i for i in $_abi_release $_abi_release_virtgrsec; do cd "$srcdir/$i" # Build Kernel Modules make KERN_DIR=/lib/modules/${_abi_release}/build \ KCFLAGS="-fno-pie" || return 1 done } package() { local i module= for i in $_abi_release $_abi_release_virtgrsec; do cd "$srcdir/$i" for module in *.ko; do install -v -D -m644 ${module} \ "$pkgdir/lib/modules/$i/misc/${module}" done done } _virtgrsec() { pkgdesc="VirtualBox Additions kernel modules for virtgrsec" mkdir -p "$subpkgdir"/lib/modules/ mv "$pkgdir"/lib/modules/$_abi_release_virtgrsec \ "$subpkgdir"/lib/modules/ } md5sums="aff1647170dd92914cddfbd0254b9773 VirtualBox-5.1.2.tar.bz2" sha256sums="03c92e3000d4b905d5b18a6abed757998125a37e5efa7864e62eae2baeabe010 VirtualBox-5.1.2.tar.bz2" sha512sums="99919f2a8c5625ecd1cda766396cc9302fe81585bb15243d969b6a6bdd8f89cd029c5696e0160ca6c965bf43edb7f9ead6608304f20467fd0a6980a25ae84e68 VirtualBox-5.1.2.tar.bz2"