app-admin/cgmanager: amd64 stable wrt bug #570122
[gentoo.git] / app-admin / cgmanager / cgmanager-0.39.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI="5"
6
7 inherit autotools pam
8
9 DESCRIPTION="Control Group manager daemon"
10 HOMEPAGE="https://linuxcontainers.org/cgmanager/introduction/"
11 SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz"
12
13 LICENSE="LGPL-2.1"
14 SLOT="0"
15 KEYWORDS="~alpha amd64 ~arm ~hppa ~ppc64 ~x86"
16 IUSE="pam selinux"
17
18 RDEPEND="sys-libs/libnih[dbus]
19         sys-apps/dbus
20         selinux? ( sec-policy/selinux-cgmanager )"
21 DEPEND="${RDEPEND}"
22
23 src_prepare() {
24         epatch_user
25
26         # systemd expects files in /sbin but we will have them in /usr/sbin
27         pushd config/init/systemd > /dev/null || die
28         sed -i -e "s@sbin@usr/&@" {${PN},cgproxy}.service || \
29                 die "Failed to fix paths in systemd service files"
30         popd > /dev/null || die
31
32         # there is an automagic dep on pam
33         epatch "${FILESDIR}/${PN}-0.39-make-pam-conditional.patch"
34         eautoreconf
35 }
36
37 src_configure() {
38         econf \
39                 --with-distro=gentoo \
40                 $(use_enable pam pam-module) \
41                 --with-pamdir="$(getpam_mod_dir)" \
42                 --with-init-script=systemd
43 }
44
45 src_install () {
46         default
47
48         # I see no reason to have the tests in the filesystem. Drop them
49         rm -r "${D}"/usr/share/${PN}/tests || die "Failed to remove ${PN} tests"
50
51         newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN}
52         newinitd "${FILESDIR}"/cgproxy.initd-r1 cgproxy
53 }