aboutsummaryrefslogtreecommitdiffstats
path: root/testing/libcgroup/APKBUILD
blob: 7f5c6dd0cba61e94efa527236a3894cbd1ded930 (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
93
94
95
96
97
98
99
100
101
102
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=libcgroup
pkgver=0.38
pkgrel=1
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 fts-dev"
install=""
options="suid"
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
	musl-decls-compat.patch
	"

_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 LIBS=-lfts || return 1
}

package() {
	local _sysconfdir="$pkgdir"/etc
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || 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
f9994beb5511e1381c2878fd9b7d1163  musl-decls-compat.patch"
sha256sums="5d36d1a48b95f62fe9fcdf74a5a4089512e5e43e6011aa1504fd6f2a0909867f  libcgroup-0.38.tar.bz2
fcc1259a4be7e1d64112bef3aa06d59e3f3d2d375f32d2b199cb864f67ee7860  cgconfig.initd
ac52788366561ca6b79bca0e9fc9630568401b4301e386e6851fd8eb75a539ab  cgconfig.confd
008aed91b2de6b65d7a6c08acaa24890c111e7dbe415ea83902e1df39c8e6d3b  cgred.initd
72c00285c1f89f3a0564418c33bd02dfbcee2ae90f540a885ef57d1ef940a04c  cgred.confd
02d6fb7911c433e1e373e8b548bbcc5c317f058e1aa5db226ce92a29a42696c0  musl-decls-compat.patch"
sha512sums="763e52bee699b0461508eabb6fdf3a79f15d1d8cdbc6631fcae93127eb7648e6bab660cf3a31019b966095113f9a086d55b5351c7999f3654f8e6c95507725d5  libcgroup-0.38.tar.bz2
a840137d97585920022d6ab09912634bdcf7c8200dda478400d0c765d17efb7ebe827fc7371c9ebddb4e5f3d5a5fefe61be101977c933fbbd18897ecea6c5654  cgconfig.initd
9bb289c20c3230414888e82be2b7a1389ac652143bcbbc746d0731c46a2f1404b4bc8154c90b59ebc53520107fe2f04c9eb5df742451887947b8a3b7a4c31f00  cgconfig.confd
163c702e714769bb7b1df3788ab679397b58ecfdff9032d40f568b8980744725d0df891ef8c46290d7f818d32c4d6be1d62d2e06dd298b74ce15a11fac42a9a6  cgred.initd
871b7e7df26bf6b4164d5ec04e9998b0bd3f354e75ba2306b330e382eadd38ad044f85cfaa122a5a2e600fb4f39e1a7fe7778551a05dfc3e0ae095621c965996  cgred.confd
8b4444b0583817bb6844d01a8d0d956a884a58ab8fb3ddd402a4ba9c5f505a7f8495abf06776685d9b10246b96ced64d74cab73484a84f3ecb53e8273ab76456  musl-decls-compat.patch"