# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit autotools linux-info multilib pam DESCRIPTION="Tools and libraries to control and monitor control groups" HOMEPAGE="http://libcg.sourceforge.net/" SRC_URI="mirror://sourceforge/${PN:0:5}/${PN}/v${PV}/${P}.tar.bz2" #SRC_URI="http://downloads.sourceforge.net/project/libcg/libcgroup/v0.37/libcgroup-0.37.tar.bz2" LICENSE="LGPL-2.1" SLOT="0" KEYWORDS="amd64 ~x86" IUSE="+daemon debug pam static-libs +tools" RDEPEND="pam? ( virtual/pam )" DEPEND="${RDEPEND} sys-devel/bison sys-devel/flex" pkg_setup() { if use daemon && ! use tools; then eerror "The daemon USE flag requires tools USE flag." die "Please enable tools or disable daemon." fi local CONFIG_CHECK="~CGROUPS" if use daemon; then CONFIG_CHECK="${CONFIG_CHECK} ~CONNECTOR ~PROC_EVENTS" fi linux-info_pkg_setup } src_prepare() { # Change rules file location sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \ -i src/libcgroup-internal.h || die "sed failed" eautoreconf } src_configure() { local myconf if use pam ; then myconf="${myconf} --enable-pam-module-dir=$(getpam_mod_dir)" fi econf \ --enable-shared \ --libdir=/usr/$(get_libdir) \ $(use_enable daemon) \ $(use_enable debug) \ $(use_enable pam) \ $(use_enable static-libs static) \ $(use_enable tools) \ ${myconf} } src_install() { emake DESTDIR="${D}" install || die "Install failed" find "${D}" -name '*.la' -exec rm -f {} + || die "la removal failed" insinto /etc/cgroup doins samples/cgrules.conf || die if use tools; then doins samples/cgconfig.conf || die newconfd "${FILESDIR}"/cgconfig.confd cgconfig || die newinitd "${FILESDIR}"/cgconfig.initd cgconfig || die fi if use daemon; then newconfd "${FILESDIR}"/cgred.confd cgred || die newinitd "${FILESDIR}"/cgred.initd cgred || die fi }