summaryrefslogtreecommitdiffstats
path: root/main/gradm/APKBUILD
blob: c78402297df4a38a05d7045eabd515fde73dd468 (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.2
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.2-201103262019.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 INSTALL=install 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="72c5bce632fb40dff814e0f1f955cab7  gradm-2.2.2-201103262019.tar.gz
38ee3aef884bdcfe6a5b925760f6220b  policy
1d4a2c2e522b7124ad901ae102181e72  base.policyd
2fc5d055dd43a2d9e1bed378dcab8641  grsec-rbac.initd"