summaryrefslogtreecommitdiffstats
path: root/main/gradm/APKBUILD
blob: edbffe98b62543503f6407d0fc3efd578450e6db (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
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: William Pitcock <nenolod@dereferenced.org>
pkgname=gradm
pkgver=2.2.1
pkgrel=0
pkgdesc="administrative utility for grsecurity kernels"
url="http://www.grsecurity.org/"
arch="all"
license="GPL"
makedepends="bison flex"
install=""
subpackages="$pkgname-doc"
source="http://grsecurity.net/test/gradm-2.2.1-201012301333.tar.gz
	policy
	base.policyd
	grsec-rbac.initd"

_builddir="$srcdir/gradm2"
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 || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1

	# we don't want the grsecurity-recommended policy as it's old
	# and non-modular.
	rm "$pkgdir"/etc/grsec/policy

	# install the base policy file which pulls in everything else.
	install -m644 "$srcdir"/policy "$pkgdir"/etc/grsec/policy

	# prepare and install base policy to /var/lib/grsec/policy.d
	install -d -D "$pkgdir"/var/lib/grsec/policy.d
	install -m644 "$srcdir"/base.policyd "$pkgdir"/var/lib/grsec/policy.d/00-base

	# install grsec-rbac into initd
	install -d -D "$pkgdir"/etc/init.d
	install -m755 "$srcdir"/grsec-rbac.initd "$pkgdir"/etc/init.d/grsec-rbac
}

md5sums="7ab5e5f57525c7a4a399e3616faf5629  gradm-2.2.1-201012301333.tar.gz
38ee3aef884bdcfe6a5b925760f6220b  policy
1d4a2c2e522b7124ad901ae102181e72  base.policyd
2fc5d055dd43a2d9e1bed378dcab8641  grsec-rbac.initd"