summaryrefslogtreecommitdiffstats
path: root/testing/scst-grsec/APKBUILD
blob: 4318586ffadd144e96324a7d2ab4298b2161e9a8 (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
# Contributor: Carlo Landmeter
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>

_flavor=${FLAVOR:-grsec}
_realname=scst
# source the kernel version
if [ -f ../../main/linux-$_flavor/APKBUILD ]; then
	. ../../main/linux-$_flavor/APKBUILD
fi
_kver=$pkgver
_kernelver=$pkgver-r$pkgrel
_abi_release=$pkgver-${_flavor}
_kpkgrel=$pkgrel

_realver=1.0.1.1
pkgname=${_realname}-${_flavor}
pkgver=$_kver
_mypkgrel=0
pkgrel=$(($_kpkgrel + $_mypkgrel))
pkgdesc="$_flavor kernel modules for SCST $_realver"
url="http://scst.sourceforge.net/"
license="GPL-2"
depends="linux-${_flavor}=${_kernelver}"
install=
makedepends="linux-${_flavor}-dev=${_kernelver}"
subpackages="$pkgname-dev"
source="http://downloads.sourceforge.net/$_realname/$_realname-$_realver.tar.gz
	scst-kernel-2.6.32.patch
	"
_ksrc=/usr/src/linux-headers-${_abi_release}

_builddir="$srcdir"/$_realname-$_realver
prepare() {
	cd "$_builddir"
	for i in "$srcdir"/*.patch; do
		[ -f "$i" ] || continue
		msg "Applying $i"
		patch -p1 -i $i || return 1
	done
	sed -e 's:linux/autoconf.h:generated/autoconf.h:' \
		-i include/scst_debug.h
}

build() {
	cd "$_builddir"
	unset ARCH
	make KDIR="$_ksrc" || return 1
}

package() {
	cd "$_builddir"
	make KDIR="$_ksrc" \
		INSTALL_MOD_PATH="$pkgdir" \
		INSTALL_DIR_H="$pkgdir"/usr/include/scst \
		install || return 1
}

# we sourced kernel apkbuild above so we need to override the dev() func
dev() {
	default_dev
}

md5sums="38abb5f10325911ff1374535a30a02ad  scst-1.0.1.1.tar.gz
a87b844b57f997c15c8e0099a313a98e  scst-kernel-2.6.32.patch"