summaryrefslogtreecommitdiffstats
path: root/testing/spl-grsec/APKBUILD
blob: 1ca59f0e3405662bb85d6e2efa928cf95bff7ddb (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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
_flavor=${FLAVOR:-grsec}
_realname=spl
_name=$_realname-$_flavor

_kpkg=linux-$_flavor
_kver=3.8.12
_kpkgrel=0

_realver=0.6.1
_mypkgrel=0

# source the kernel version
if [ -f ../../main/linux-$_flavor/APKBUILD ]; then
        . ../../main/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))
pkgdesc="Solaris Porting Layer"
url="http://zfsonlinux.org"
arch="x86 x86_64"
license="GPL"
depends=""
depends_dev="linux-grsec-dev=$_kernelver"
makedepends="$depends_dev perl automake autoconf libtool"
install=""
subpackages="$pkgname-dev $pkgname-utils"
source="http://archive.zfsonlinux.org/downloads/zfsonlinux/spl/spl-$_realver.tar.gz
	constify.patch"
_builddir="$srcdir"/spl-$_realver

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"
	export GCC_SPECS=/usr/share/gcc/hardenednopie.specs
	./autogen.sh || return 1
	./configure --prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--with-config=all \
		--with-linux=/usr/src/linux-headers-${_abi_release} \
		|| return 1
	make || return 1
}

package() {
        cd "$_builddir"
        make DESTDIR="$pkgdir" install || return 1
        rm -f "$pkgdir"/usr/lib/*.la
}

dev() {
        mkdir -p "$subpkgdir"/usr
        mv "$pkgdir"/usr/src \
                "$subpkgdir"/usr || return 1
        default_dev
}

utils() {
        pkgdesc="Userspace spl tools"
        mkdir -p "$subpkgdir"
        mv "$pkgdir"/* "$subpkgdir" || return 1
        mkdir -p "$pkgdir"/lib
        mv "$subpkgdir"/lib/modules \
                "$pkgdir"/lib/ || return 1
}

md5sums="0f58806d9fd9cab900181b59b21bae50  spl-0.6.1.tar.gz
19c02cd34e2b36cf3ae9c71ee9c443fe  constify.patch"
sha256sums="6baa3e56a945a508273dd47153e43610659fb6c3dfbe58d96a772e009855d1ae  spl-0.6.1.tar.gz
b0b856a073f7b55b1bb49be927fac7900d28cea8208aca2c02bac529c7316cf7  constify.patch"
sha512sums="a992c5cdccf6883da1dbe5bfde0bdc639cc6e4c1364b7b94d0ac0b9ddcb8db6af9138fe0d67112adc368dd4055dce17e8fa22d7cbc679651ecb18fd9b4439835  spl-0.6.1.tar.gz
6aab408f2e5dcca0bcaa0f4713d93d49068a11fa35d9f2f7a15bb0eef6c1eb8613c89769bb3b054ca70be359e109fef81ae1cd3166920c4df183363ee5309af3  constify.patch"