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

_flavor=${FLAVOR:-grsec}
_realname=iscsi-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 ISCSI for SCST $_realver"
url="http://scst.sourceforge.net/"
license="GPL-2"
depends="linux-${_flavor}=${_kernelver}"
install=
makedepends="linux-${_flavor}-dev=${_kernelver} scst-grsec-dev"
subpackages=
source="http://downloads.sourceforge.net/scst/$_realname-$_realver.tar.gz
        config.c.patch
	2.6.35.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
	# to build mods we need the headre file. fix dependency in makefile
	sed -i -e 's/^\(mods: .*\)/\1 include\/iscsi_scst_itf_ver.h/' Makefile
}

build() {
        cd "$_builddir"
        unset ARCH
        make mods \
		KDIR="$_ksrc" \
	        SCST_INC_DIR=/usr/include/scst \
	        || return 1
}

package() {
        cd "$_builddir"
	install -D -m 644 kernel/iscsi-scst.ko \
	        "$pkgdir"/lib/modules/$_abi_release/extra/iscsi-scst.ko
}

md5sums="56109c01e3d4421a36d6f47efa1fb0d5  iscsi-scst-1.0.1.1.tar.gz
48e21e3466fd819418f29e3b2487f052  config.c.patch
d2490c86d9138226ec674997817a163b  2.6.35.patch"