# Copyright 2010-2017 Wulf C. Krueger # Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 require sourceforge [ project="libcg" ] require autotools [ supported_autoconf=[ 2.5 ] supported_automake=[ 1.13 ] ] export_exlib_phases pkg_postinst src_prepare SUMMARY="libcg is a library that abstracts the control group file system in Linux" DESCRIPTION=" libcgroup aims to provide programmers easily usable APIs to use the control group file system. It should satisfy the following requirements: - Provide a programmable interface for cgroups - Provide persistent configuration across reboots - Provide a programmable interface for manipulating configurations " #BUGS_TO="philantrop@exherbo.org" UPSTREAM_DOCUMENTATION="${HOMEPAGE}/html/index.html [[ lang = en ]]" LICENCES="LGPL-2.1" SLOT="0" MYOPTIONS="" DEPENDENCIES=" build+run: sys-libs/pam " # The tests since 0.38 want to mess directly with /sys *and* expect libcgroup to # be already installed. Last checked: 0.41 RESTRICT="test" DEFAULT_SRC_CONFIGURE_PARAMS=( --enable-cgred-socket=/run/cgred.sock --enable-daemon --enable-pam --enable-shared --enable-static --enable-tools ) DEFAULT_SRC_CONFIGURE_PARAMS=( --enable-opaque-hierarchy=name=systemd ) DEFAULT_SRC_PREPARE_PATCHES=( "${FILES}"/${PNV}-replace_DECLS.patch "${FILES}"/${PNV}-replace_INLCUDES.patch "${FILES}"/${PNV}-reorder-headers.patch "${FILES}"/1bce3ab63968022e97599bbd73ec1a66aacf45bc.diff ) libcgroup_src_prepare() { # Change rules file location edo sed -e 's:/etc/cgrules.conf:/etc/cgroup/cgrules.conf:' \ -i src/libcgroup-internal.h edo sed -e 's:/etc/cgconfig.conf:/etc/cgroup/cgconfig.conf:' \ -i src/libcgroup-internal.h edo sed -e 's:\(pam_cgroup_la_LDFLAGS.*\):\1\ -avoid-version:' \ -i src/pam/Makefile.am edo sed -e 's#/var/run#/run#g' -i configure.in || die "sed failed" autotools_src_prepare } libcgroup_pkg_postinst() { default local cruft=( /etc/rc.d/init.d/cgconfig /etc/rc.d/init.d/cgred ) for file in ${cruft[@]}; do if test -f "${file}" ; then nonfatal edo rm "${file}" || ewarn "removing ${file} failed" fi done }