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

_kver=4.4.25
_kpkgrel=0

_gitver=747954dd0bde66bb28d2b6c2c109597c9abbe5c5
_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="all !aarch64"
license="Dual BSD/GPL"
depends="linux-${_flavor}=${_kernelver}"
makedepends="linux-${_flavor}-dev=${_kernelver} linux-headers"
install=
install_if="linux-$_flavor=$_kernelver $_realname"
subpackages=
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 -fno-pie" || 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/
}

md5sums="eede7fbd176f1dafeb4b13cefde2fb79  sch-cake-747954dd0bde66bb28d2b6c2c109597c9abbe5c5.tar.gz
b4b30182fd86d0fdb971732f33fc2c8d  10-Makefile.patch"
sha256sums="691ac473c16f117a5de7c9091937588c24a625bdf21c98a9a9214bb874630bce  sch-cake-747954dd0bde66bb28d2b6c2c109597c9abbe5c5.tar.gz
dadb9615c10a20384ebed9ccaaedc2e0964f04f7d6adaab1dd8211592b6c794e  10-Makefile.patch"
sha512sums="0dc844d555ff03ad7cea7a7359a3af3154fdbb67ab5a7fa63ea2bcb1d20109aa9090ebebf294e8d073cb7e46786a050a1ecde27c1da28b696b0cadb8408f13c9  sch-cake-747954dd0bde66bb28d2b6c2c109597c9abbe5c5.tar.gz
9555709d6db1cb6a2599fe059a33962fa74826b6717f0dbb27217b3f678e22498156be548f6883abb6c493aa345de15fe2ceaa76a52bb4eed60ef6ee64c50bd8  10-Makefile.patch"