aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libcgroup/APKBUILD
blob: 4268781ebdd0e67d07f706995a217696f32f1b9d (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
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libcgroup
pkgver=0.38
pkgrel=0
pkgdesc="Library to control and monitor control groups"
url="http://libcg.sourceforge.net/"
arch="all"
license="LGPLv2+"
depends=""
depends_dev=""
makedepends="$depends_dev bison flex linux-pam-dev"
install=""
subpackages="$pkgname-dev $pkgname-doc $pkgname-tools $pkgname-pam"
source="http://downloads.sourceforge.net/libcg/libcgroup-$pkgver.tar.bz2
	cgconfig.initd
	cgconfig.confd
	cgred.initd
	cgred.confd
	"

_builddir="$srcdir"/libcgroup-$pkgver
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
	sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \
		-i src/libcgroup-internal.h || return 1
}

build() {
	cd "$_builddir"
	./configure --prefix=/usr \
		--enable-shared \
		--enable-daemon \
		--enable-tools \
		|| return 1
	make || return 1
}

package() {
	local _sysconfdir="$pkgdir"/etc
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la \
		"$pkgdir"/usr/lib/security/pam_cgroup.la || return 1
	
	# config files
	install -d "$_sysconfdir"
	install -m 644 samples/cgconfig.conf "$_sysconfdir"/cgconfig.conf \
		|| return 1
	install -m 644 samples/cgrules.conf "$_sysconfdir"/cgrules.conf \
		|| return 1
	install -m 644 samples/cgsnapshot_blacklist.conf \
		"$_sysconfdir"/cgsnapshot_blacklist.conf || return 1

	# init scripts
	for i in $source; do
		case $i in
		*.initd) install -Dm755 "$srcdir"/$i \
			"$pkgdir"/etc/init.d/${i%.*} || return 1;;
		*.confd) install -Dm644 "$srcdir"/$i \
			"$pkgdir"/etc/conf.d/${i%.*} || return 1;;
		esac
	done
}

tools() {
	pkgdesc="Command-line utility programs, services and daemons for libcgroup"
	install -d "$subpkgdir"/usr
	mv "$pkgdir"/usr/bin "$pkgdir"/usr/sbin "$subpkgdir"/usr/
	mv "$pkgdir"/etc "$subpkgdir"/
}

pam() {
	pkgdesc="A Pluggable Authentication Module for libcgroup"
	install -d "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/security "$subpkgdir"/usr/lib/
}

md5sums="f0f7d4060bf36ccc19d75dbf4f1695db  libcgroup-0.38.tar.bz2
3fa43b95417d491450c8fe239fca8557  cgconfig.initd
7743c134ead2422fbd375447c4c9654c  cgconfig.confd
8bb3ca45c5ba91d4078e738978afb54d  cgred.initd
f36926f1a968d3ee5fd7f0d7a6a7167e  cgred.confd"