aboutsummaryrefslogtreecommitdiffstats
path: root/testing/sch-cake-hardened/APKBUILD
blob: 9b56e176080c70b1dba016b2dc6a42b19d3824d8 (plain) (blame)
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
# Contributor: Ben Allen <bensallen@me.com>
# Maintainer: Ben Allen <bensallen@me.com>
_flavor=${FLAVOR:-hardened}
_kpkg=linux-$_flavor
_realname=sch-cake
_name=$_realname-$_flavor

_kver=4.9.72
_kpkgrel=0

_gitver=9789742cfc596d48583ba4cdbc8f38d026121fa6
_mypkgrel=0

# source the kernel version
if [ -f ../linux-$_flavor/APKBUILD ]; then
	. ../linux-$_flavor/APKBUILD
	[ "$_kver" != "$pkgver" ] && die "$_name: Please update _kver to $pkgver"
	[ "$_kpkgrel" != "$pkgrel" ] && die "$_name: Please update _kpkgrel to $pkgrel"
fi

_kernelver=$_kver-r$_kpkgrel
_abi_release=${_kver}-${_kpkgrel}-${_flavor}

pkgname=$_name
pkgver=$_kver
pkgrel=$(($_kpkgrel + $_mypkgrel))

pkgrel=0
pkgdesc="Out of tree build for the new cake qdisc"
url="https://github.com/dtaht/sch_cake"
arch="x86 x86_64 armhf"
license="BSD or GPL"
depends="linux-${_flavor}=${_kernelver}"
makedepends="linux-${_flavor}-dev=${_kernelver} linux-headers"
install=
install_if="linux-$_flavor=$_kernelver $_realname"
subpackages=
provides="${_realname}-grsec=${pkgver}-r${pkgrel}"
source="$_realname-$_gitver.tar.gz::https://github.com/dtaht/sch_cake/archive/$_gitver.tar.gz 10-Makefile.patch"
_builddir="$srcdir"/sch_cake-$_gitver

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	cd "$_builddir"
	make KERNEL_VERSION=$_abi_release CFLAGS_MODULE="$CFLAGS_MODULE" || return 1
}

package() {
	cd "$_builddir"
	install -v -m 0755 -d $pkgdir/lib/modules/$_abi_release/kernel/net/sched
        install -v -m 0644 $_builddir/sch_cake.ko $pkgdir/lib/modules/$_abi_release/kernel/net/sched/
}

sha512sums="1a4ae8632a3aa7349290434edfc2ca75315ea3b1698e97fbee7c102bf4e4897a09582de295c9d6cc3ec7fe6a8681df24e831c88a78df9ce766a5eec6b909cfca  sch-cake-9789742cfc596d48583ba4cdbc8f38d026121fa6.tar.gz
9555709d6db1cb6a2599fe059a33962fa74826b6717f0dbb27217b3f678e22498156be548f6883abb6c493aa345de15fe2ceaa76a52bb4eed60ef6ee64c50bd8  10-Makefile.patch"