aboutsummaryrefslogtreecommitdiffstats
path: root/testing/virtualbox-guest-modules-grsec/APKBUILD
blob: c1de8a1b0047fcb40386389d44234b2fa01bf0c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Maintainer: Ben Allen <bensallen@me.com>
# Contributor: Ben Allen <bensallen@me.com>

_flavor=${FLAVOR:-grsec}
_kpkg=linux-$_flavor
_kver=4.4.16
_kpkgrel=0

# when chaning _ver we *must* bump _mypkgrel
_ver=5.0.20
_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}

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"
source="http://download.virtualbox.org/virtualbox/$_ver/VirtualBox-$_ver.tar.bz2
	10-vboxguest-Makefile.patch"

_builddir="$srcdir"/VirtualBox-$_ver

prepare() {
	cd "$_builddir"
	$_builddir/src/VBox/Additions/linux/export_modules "$_builddir/vbox-kmod.tar.gz"
	tar -xf "$_builddir/vbox-kmod.tar.gz" 
	local i
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	# Build Kernel Modules
	make KERN_DIR=/lib/modules/${_abi_release}/build KCFLAGS="-fno-pie"
}

package() {
	cd "$_builddir"
	local module=
	for module in *.ko; do
		install -v -D -m644 ${module} \
			"$pkgdir/lib/modules/${_abi_release}/misc/${module}"
	done
}

md5sums="2054e12c21cac025916df4162f18efd7  VirtualBox-5.0.20.tar.bz2
34c8e3cb497d86be4281dcd62b3b3b4f  10-vboxguest-Makefile.patch"
sha256sums="af9c0787aae22964a1192cefbf9aa91a40c1d41e5fea485adebf09ab922d4c2b  VirtualBox-5.0.20.tar.bz2
440a4c15e7de4ad9087fedc64c045c6a28f31c59c787ad7a8a34ea65b72f8499  10-vboxguest-Makefile.patch"
sha512sums="a039455eed3715b9aa42e2dc6b65ea68b27899c0bcf0065a93c53d1093cce56ebf8a6982cd804208ef9e51794eab9c5c4f3b20550d41532fd4addbd7afda0f8e  VirtualBox-5.0.20.tar.bz2
38f774b8b2242687dc6327bd4c2fc6951207758fb2e25dd46550861c09a3f2b8efad1a8414529146fbbb8a89cf2eb3ad44b00fbdbbeafd3f8c69ba4cb91decf0  10-vboxguest-Makefile.patch"