1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools flag-o-matic linux-info pam
8 DESCRIPTION="Tools and libraries to configure and manage kernel control groups"
9 HOMEPAGE="http://libcg.sourceforge.net/"
10 SRC_URI="mirror://sourceforge/project/libcg/${PN}/v${PV}/${P}.tar.bz2"
14 KEYWORDS="amd64 arm ~ppc ~ppc64 x86"
15 IUSE="+daemon elibc_musl pam static-libs test +tools"
17 RDEPEND="pam? ( virtual/pam )"
23 elibc_musl? ( sys-libs/fts-standalone )
25 REQUIRED_USE="daemon? ( tools )"
27 DOCS=(README_daemon README README_systemd INSTALL)
29 local CONFIG_CHECK="~CGROUPS"
31 CONFIG_CHECK="${CONFIG_CHECK} ~CONNECTOR ~PROC_EVENTS"
37 "${FILESDIR}"/${P}-replace_DECLS.patch
38 "${FILESDIR}"/${P}-replace_INLCUDES.patch
39 "${FILESDIR}"/${P}-reorder-headers.patch
40 "${FILESDIR}"/${P}-remove-umask.patch
45 # Change rules file location
46 sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \
47 -i src/libcgroup-internal.h || die "sed failed"
48 sed -e 's:/etc/cgconfig.conf:/etc/cgroup/cgconfig.conf:' \
49 -i src/libcgroup-internal.h || die "sed failed"
50 sed -e 's:\(pam_cgroup_la_LDFLAGS.*\):\1\ -avoid-version:' \
51 -i src/pam/Makefile.am || die "sed failed"
52 sed -e 's#/var/run#/run#g' -i configure.in || die "sed failed"
54 # If we're not running tests, don't bother building them.
56 sed -i '/^SUBDIRS/s:tests::' Makefile.am || die
66 my_conf=" --enable-pam-module-dir=$(getpam_mod_dir) "
69 use elibc_musl && append-ldflags "-lfts"
71 $(use_enable static-libs static) \
72 $(use_enable daemon) \
79 # Use mount cgroup to build directory
80 # sandbox restricted to trivial build,
81 # possible kill Diego tanderbox ;)
87 prune_libtool_files --all
90 doins samples/*.conf || die
93 newconfd "${FILESDIR}"/cgconfig.confd-r1 cgconfig || die
94 newinitd "${FILESDIR}"/cgconfig.initd-r1 cgconfig || die
98 newconfd "${FILESDIR}"/cgred.confd-r2 cgred || die
99 newinitd "${FILESDIR}"/cgred.initd-r1 cgred || die