aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2015-09-24 22:57:47 +0200
committerCarlo Landmeter <clandmeter@gmail.com>2015-09-24 22:58:17 +0200
commit620028dbe7d749f1fe2ce24587a742a95c6ce6e2 (patch)
tree9ce30baf6995168c546759a00154adb946bc7475
parent4db404aa8d35aa25692f06fab9cdb6cdfc33a0c9 (diff)
downloadaports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.gz
aports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.bz2
aports-620028dbe7d749f1fe2ce24587a742a95c6ce6e2.tar.xz
testing/cgmanager: new aport
-rw-r--r--testing/cgmanager/APKBUILD63
-rw-r--r--testing/cgmanager/cgmanager.initd28
-rw-r--r--testing/cgmanager/cgproxy.initd37
3 files changed, 128 insertions, 0 deletions
diff --git a/testing/cgmanager/APKBUILD b/testing/cgmanager/APKBUILD
new file mode 100644
index 0000000000..3b99f09448
--- /dev/null
+++ b/testing/cgmanager/APKBUILD
@@ -0,0 +1,63 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=cgmanager
+pkgver=0.39
+pkgrel=0
+pkgdesc="nother daemon for managing control groups"
+url="https://linuxcontainers.org/cgmanager/"
+arch="all"
+license="GPL"
+depends=""
+depends_dev="linux-pam-dev"
+makedepends="$depends_dev linux-headers libnih-dev"
+install=""
+subpackages="$pkgname-dev"
+source="https://linuxcontainers.org/downloads/cgmanager/cgmanager-$pkgver.tar.gz
+ cgmanager.initd
+ cgproxy.initd"
+
+_builddir="$srcdir"/cgmanager-$pkgver
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --mandir=/usr/share/man \
+ --infodir=/usr/share/info \
+ --localstatedir=/var \
+ --with-distro=gentoo \
+ || return 1
+ make || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make DESTDIR="$pkgdir" install || return 1
+ rm -f "$pkgdir"/usr/lib/*.la
+ install -Dm755 "$srcdir"/cgmanager.initd \
+ "$pkgdir"/etc/init.d/cgmanager || return 1
+ install -Dm755 "$srcdir"/cgproxy.initd \
+ "$pkgdir"/etc/init.d/cgproxy || return 1
+}
+
+md5sums="83ef00049944f1e444a3149afc668a1d cgmanager-0.39.tar.gz
+918125d912147f91aab0a373b69bfb41 cgmanager.initd
+5e5b8380537d8ed14030ddb785c5f65c cgproxy.initd"
+sha256sums="9e65487fb4e4aa0a6acd87ba7f8f00b8007d8c52608aa6d411e72e6fe9445b7b cgmanager-0.39.tar.gz
+e10a05091f883711fd41a4917ba165d796c92b20001fd61171605a203a7ef934 cgmanager.initd
+d9d2796c295aeec8d8d4e1b46b94a2476a4b191260ff7a416ab8ead8ccf5ac65 cgproxy.initd"
+sha512sums="2adf2c639191fb681ffed083629d6ba93f6d5a3534d4dc00b2cff1917c3273febcb30ec7d524ee95ce4a1b8811d902a2ff1cdffe911a66850fb9f10750ef1801 cgmanager-0.39.tar.gz
+9e3414e9253b4fb3a5c18ea634b3c817a80ec15b3e7e66c5c2611fc9073ac363ebef7ed9e79dc6eb8ee9401860fc6a3d00b385284402bfee371f5fa842016a5a cgmanager.initd
+52c4252acb06e5df2985a688082bbb4cd8ea67f6c275f0c769c583ca70f4f9b6de496ef9724dba55f7266859a06f5b6c6fd71abe9de57c097539eca5c7049b61 cgproxy.initd"
diff --git a/testing/cgmanager/cgmanager.initd b/testing/cgmanager/cgmanager.initd
new file mode 100644
index 0000000000..5ec4f2ed84
--- /dev/null
+++ b/testing/cgmanager/cgmanager.initd
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/cgmanager/files/cgmanager.initd,v 1.2 2015/02/16 11:02:06 hwoarang Exp $
+
+DAEMON=/usr/sbin/cgmanager
+PIDFILE=/run/cgmanager.pid
+NESTED=yes
+OPTIONS=
+
+depend() {
+ after cgproxy
+}
+
+start() {
+ ebegin "Starting cgmanager server"
+
+ start-stop-daemon --start --pidfile ${PIDFILE} --exec ${DAEMON} \
+ -- --daemon -m name=systemd ${OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping cgproxy server"
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+ eend $?
+}
diff --git a/testing/cgmanager/cgproxy.initd b/testing/cgmanager/cgproxy.initd
new file mode 100644
index 0000000000..980606719c
--- /dev/null
+++ b/testing/cgmanager/cgproxy.initd
@@ -0,0 +1,37 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-admin/cgmanager/files/cgproxy.initd,v 1.2 2015/02/16 11:02:06 hwoarang Exp $
+
+DAEMON=/usr/sbin/cgproxy
+PIDFILE=/run/cgproxy.pid
+NESTED=yes
+OPTIONS=
+
+depend() {
+ before cgmanager
+}
+
+start() {
+ ebegin "Starting cgproxy server"
+ 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
+
+ start-stop-daemon --start --pidfile ${PIDFILE} --exec ${DAEMON} \
+ -- --daemon ${OPTIONS}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping cgproxy server"
+ start-stop-daemon --stop --quiet -R TERM/45 -p ${PIDFILE}
+ eend $?
+}