1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 inherit autotools eutils flag-o-matic linux-info pam
9 DESCRIPTION="Tools and libraries to configure and manage kernel control groups"
10 HOMEPAGE="http://libcg.sourceforge.net/"
11 SRC_URI="mirror://sourceforge/project/libcg/${PN}/v${PV}/${P}.tar.bz2"
15 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
16 IUSE="+daemon elibc_musl debug pam static-libs +tools"
18 RDEPEND="pam? ( virtual/pam )"
24 elibc_musl? ( sys-libs/fts-standalone )
26 REQUIRED_USE="daemon? ( tools )"
28 DOCS=(README_daemon README README_systemd INSTALL)
30 local CONFIG_CHECK="~CGROUPS"
32 CONFIG_CHECK="${CONFIG_CHECK} ~CONNECTOR ~PROC_EVENTS"
38 epatch "${FILESDIR}"/${P}-replace_DECLS.patch
39 epatch "${FILESDIR}"/${P}-replace_INLCUDES.patch
40 epatch "${FILESDIR}"/${P}-reorder-headers.patch
42 # Change rules file location
43 sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \
44 -i src/libcgroup-internal.h || die "sed failed"
45 sed -e 's:\(pam_cgroup_la_LDFLAGS.*\):\1\ -avoid-version:' \
46 -i src/pam/Makefile.am || die "sed failed"
47 sed -e 's#/var/run#/run#g' -i configure.in || die "sed failed"
56 my_conf=" --enable-pam-module-dir=$(getpam_mod_dir) "
59 use elibc_musl && append-ldflags "-lfts"
61 $(use_enable static-libs static) \
62 $(use_enable daemon) \
70 # Use mount cgroup to build directory
71 # sandbox restricted to trivial build,
72 # possible kill Diego tanderbox ;)
78 prune_libtool_files --all
81 doins samples/*.conf || die
84 newconfd "${FILESDIR}"/cgconfig.confd-r1 cgconfig || die
85 newinitd "${FILESDIR}"/cgconfig.initd-r1 cgconfig || die
89 newconfd "${FILESDIR}"/cgred.confd-r1 cgred || die
90 newinitd "${FILESDIR}"/cgred.initd-r1 cgred || die