summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 105012b1c57a72f0cd6dc7bd1f78b1ffa73030d4 (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
# Maintainer: Nicolas Lorin <androw95220@gmail.com>
# Contributor: Christian Hesse <mail@eworm.de>
# Contributor: Jan "heftig" Steffens <jan.steffens@gmail.com>

pkgname=libcgroup
pkgver=3.1.0
pkgrel=0
pkgdesc='Library that abstracts the control group file system in Linux'
arch=('i686' 'x86_64')
url='https://github.com/libcgroup/libcgroup'
license=(LGPL)
backup=('etc/cgconfig.conf'
        'etc/cgrules.conf'
	'etc/cgsnapshot_blacklist.conf')
options=('!emptydirs' '!libtool')
optdepends=('pam: for pam_cgroup')
install=libcgroup.install
source=("https://github.com/${pkgname}/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.gz"{,.asc}
	'cgconfig.service'
	'cgrules.service')
validpgpkeys=('47A68FCE37C7D7024FD65E11356CE62C2B524099') # Tom Hromatka <tom.hromatka@oracle.com>
sha256sums=('976ec4b1e03c0498308cfd28f1b256b40858f636abc8d1f9db24f0a7ea9e1258'
            'SKIP'
            '808fc354abf36d7b6673dad790be275309ac57a2606d1be3732b9b3aeb5885eb'
            '6b1340ff6717f55e5e57dacc72accc0bfaed7e50ef31439271b6ddc893cbf671')

build() {
	cd "${srcdir}/${pkgname}-${pkgver/rc/.rc}"

	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--sbindir=/usr/bin \
		--enable-opaque-hierarchy=name=systemd

	make
}

package() {
	cd "${srcdir}/${pkgname}-${pkgver/rc/.rc}"

	make DESTDIR="${pkgdir}" pkgconfigdir="/usr/lib/pkgconfig" install

	install -D -m0644 samples/config/cgconfig.conf "${pkgdir}/etc/cgconfig.conf"
	install -D -m0644 samples/config/cgrules.conf "${pkgdir}/etc/cgrules.conf"
        install -D -m0644 samples/config/cgsnapshot_allowlist.conf "${pkgdir}/etc/cgsnapshot_allowlist.conf"
	install -D -m0644 samples/config/cgsnapshot_denylist.conf "${pkgdir}/etc/cgsnapshot_denylist.conf"

	install -D -m0644 ${srcdir}/cgconfig.service "${pkgdir}/usr/lib/systemd/system/cgconfig.service"
	install -D -m0644 ${srcdir}/cgrules.service "${pkgdir}/usr/lib/systemd/system/cgrules.service"

	rm -f ${pkgdir}/usr/lib/security/pam_cgroup.{la}

	rm -rf ${pkgdir}/etc/rc.d

	# Make cgexec setgid cgred
	chown root:160 ${pkgdir}/usr/bin/cgexec
	chmod 2755 ${pkgdir}/usr/bin/cgexec
}