From: Jason Zaman Date: Sat, 5 Sep 2015 17:22:19 +0000 (+0800) Subject: app-admin/cgmanager: bump to 0.39 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cdd3476cdf26bcfe7c1dcea6c55eebc651385ccd;p=gentoo.git app-admin/cgmanager: bump to 0.39 There is a new pam module added. Had to patch the automagic deps for it Package-Manager: portage-2.2.20.1 --- diff --git a/app-admin/cgmanager/Manifest b/app-admin/cgmanager/Manifest index 6c026dbd5c83..3224db5dcb12 100644 --- a/app-admin/cgmanager/Manifest +++ b/app-admin/cgmanager/Manifest @@ -1,2 +1,3 @@ DIST cgmanager-0.36.tar.gz 428374 SHA256 f4707f0130efb50ccd8a1900e7ae626c0631947528ce921a63b15ef848fb2a0d SHA512 3325c03e25b7bd7b8dcfb68bb3dedccf9367ce80c23ac8df3f1af6cdb9ee706eafc0f95fcea055cc1fe9b31acb5bb66c61b16b21dfa057e661fdace3ff207f43 WHIRLPOOL dcaad06e6281f89e672b843f9903473cb1ee5d1b938c72d1b806f7bc7a1014144dd9e6e304e9ce6e2b941a1b224177747dacc7affa122f9a17a14598969a4779 DIST cgmanager-0.37.tar.gz 430522 SHA256 8309e7f2ae5f4a6b52cc2fca62c098b18ecfe90bca2c9c034ba80f68aa427b6e SHA512 fbe96af36d556c988351f1136f4382d907b8fb6d4098a90b17f4abfbdf182060d8ba059878455a8842597e7ad33ff12b91bddf68a6c42b02ad9549a2ad900a89 WHIRLPOOL 9a78226ec2a6a84c7fb84f3bb2622df159a4b857d990b2d4f22a1d8c7d02d071c0ed046e5d17ea9d2bd4b970a0a6ad9bf59ba68401248db318b89e16010c720a +DIST cgmanager-0.39.tar.gz 437683 SHA256 9e65487fb4e4aa0a6acd87ba7f8f00b8007d8c52608aa6d411e72e6fe9445b7b SHA512 2adf2c639191fb681ffed083629d6ba93f6d5a3534d4dc00b2cff1917c3273febcb30ec7d524ee95ce4a1b8811d902a2ff1cdffe911a66850fb9f10750ef1801 WHIRLPOOL b57c0feb75543af7e7eadccd5287962034fa2c54883289822b54ed184873fb1b6e1eb6d9dcc952fcda2f3027d84fa517c2bfed22a855ede8e700c2298d5d210a diff --git a/app-admin/cgmanager/cgmanager-0.39.ebuild b/app-admin/cgmanager/cgmanager-0.39.ebuild new file mode 100644 index 000000000000..a31daac011f1 --- /dev/null +++ b/app-admin/cgmanager/cgmanager-0.39.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI="5" + +inherit autotools pam + +DESCRIPTION="Control Group manager daemon" +HOMEPAGE="https://linuxcontainers.org/cgmanager/introduction/" +SRC_URI="https://linuxcontainers.org/downloads/${PN}/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="pam" + +RDEPEND=" + sys-libs/libnih[dbus] + sys-apps/dbus" +DEPEND="${RDEPEND}" + +src_prepare() { + epatch_user + + # systemd expects files in /sbin but we will have them in /usr/sbin + pushd config/init/systemd > /dev/null || die + sed -i -e "s@sbin@usr/&@" {${PN},cgproxy}.service || \ + die "Failed to fix paths in systemd service files" + popd > /dev/null || die + + # there is an automagic dep on pam + epatch "${FILESDIR}/${PN}-0.39-make-pam-conditional.patch" + eautoreconf +} + +src_configure() { + econf \ + --with-distro=gentoo \ + $(use_enable pam pam-module) \ + --with-pamdir="$(getpam_mod_dir)" \ + --with-init-script=systemd +} + +src_install () { + default + + # I see no reason to have the tests in the filesystem. Drop them + rm -r "${D}"/usr/share/${PN}/tests || die "Failed to remove ${PN} tests" + + newinitd "${FILESDIR}"/${PN}.initd-r1 ${PN} + newinitd "${FILESDIR}"/cgproxy.initd-r1 cgproxy +} diff --git a/app-admin/cgmanager/files/cgmanager-0.39-make-pam-conditional.patch b/app-admin/cgmanager/files/cgmanager-0.39-make-pam-conditional.patch new file mode 100644 index 000000000000..eed626f3e68c --- /dev/null +++ b/app-admin/cgmanager/files/cgmanager-0.39-make-pam-conditional.patch @@ -0,0 +1,31 @@ +--- Makefile.am.old 2015-09-06 00:16:38.997836415 +0800 ++++ Makefile.am 2015-09-06 01:05:00.376009752 +0800 +@@ -133,6 +133,7 @@ + $(CCLD) -o tests/cgm-concurrent tests/cgm-concurrent.o \ + $(NIH_LIBS) $(NIH_DBUS_LIBS) $(DBUS_LIBS) -lpthread -lcgmanager + ++if HAVE_PAMMODULE + pam_LTLIBRARIES = pam_cgm.la + pam_cgm_la_SOURCES = pam/pam_cgm.c pam/cgmanager.c pam/cgmanager.h + pam_cgm_la_CFLAGS = $(AM_CFLAGS) +@@ -145,4 +146,6 @@ + rm -f "$(DESTDIR)$(pamdir)/pam_cgm.a" + uninstall-local: + rm -f "$(DESTDIR)$(pamdir)/pam_cgm.so" ++endif ++ + tests: TESTS_CGM_CONCURRENT TESTS_SCM TEST_NSTEST +--- configure.ac.old 2015-09-06 00:55:48.262972928 +0800 ++++ configure.ac 2015-09-06 01:04:19.683301852 +0800 +@@ -127,6 +127,11 @@ + + AS_AC_EXPAND(SBINDIR, "$sbindir") + ++AC_ARG_ENABLE(pam-module, ++ [AS_HELP_STRING([--enable-pam-module],[build PAM module])], ++ , enable_pam_module=no) ++AM_CONDITIONAL([HAVE_PAMMODULE], [test "x$enable_pam_module" != "xno" ]) ++ + AC_ARG_WITH( + [pamdir], + [AS_HELP_STRING([--with-pamdir=PATH],[Specify the directory where PAM modules are stored])], diff --git a/app-admin/cgmanager/files/cgmanager.initd b/app-admin/cgmanager/files/cgmanager.initd index 26c915f4dac8..46b1e01fd170 100644 --- a/app-admin/cgmanager/files/cgmanager.initd +++ b/app-admin/cgmanager/files/cgmanager.initd @@ -1,4 +1,4 @@ -#!/sbin/runscript +#!/sbin/openrc-run # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -9,7 +9,7 @@ NESTED=yes OPTIONS= depend() { - after cgproxy + before cgproxy } start() { diff --git a/app-admin/cgmanager/files/cgmanager.initd-r1 b/app-admin/cgmanager/files/cgmanager.initd-r1 new file mode 100644 index 000000000000..48faf787c938 --- /dev/null +++ b/app-admin/cgmanager/files/cgmanager.initd-r1 @@ -0,0 +1,15 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="Control Group manager daemon" +pidfile="/run/cgmanager.pid" +command="/usr/sbin/cgmanager" +command_args="-m name=systemd" +command_background="yes" +retry="TERM/45" + +depend() { + before cgproxy +} diff --git a/app-admin/cgmanager/files/cgproxy.initd b/app-admin/cgmanager/files/cgproxy.initd index 3624598adb31..458dcb6ec278 100644 --- a/app-admin/cgmanager/files/cgproxy.initd +++ b/app-admin/cgmanager/files/cgproxy.initd @@ -1,4 +1,4 @@ -#!/sbin/runscript +#!/sbin/openrc-run # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Id$ @@ -9,7 +9,7 @@ NESTED=yes OPTIONS= depend() { - before cgmanager + after cgmanager } start() { diff --git a/app-admin/cgmanager/files/cgproxy.initd-r1 b/app-admin/cgmanager/files/cgproxy.initd-r1 new file mode 100644 index 000000000000..ff7b78e8bbbc --- /dev/null +++ b/app-admin/cgmanager/files/cgproxy.initd-r1 @@ -0,0 +1,28 @@ +#!/sbin/openrc-run +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +description="Control Group manager proxy" +pidfile="/run/cgproxy.pid" +command="/usr/sbin/cgproxy" +command_args="--daemon" +command_background="yes" +retry="TERM/45" +NESTED="${NESTED:-no}" + +depend() { + after cgmanager +} + +start_pre() { + if ! /usr/sbin/cgproxy --check-master; then + ewarn "cgmanager is not running" + return 1 + fi + # cgproxy should only run on container unless on older kernel + if [ -e /proc/self/ns/pid ] && [ "$NESTED" != "yes" ]; then + eerror "Too old kernel to support cgroup, please update to >3.8" + return 1 + fi +}