summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2010-08-01 03:17:51 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2010-08-01 03:17:51 +0000
commite7ffbae651d7e091fb2fd545f574fc8b82d9bcb4 (patch)
tree676d22132ab45575eeee267207a946644f1a8fb6 /app-emulation/lxc
parentDrop hppa STAGE1_CFLAGS hack (bug #326539). (diff)
downloadhistorical-e7ffbae651d7e091fb2fd545f574fc8b82d9bcb4.tar.gz
historical-e7ffbae651d7e091fb2fd545f574fc8b82d9bcb4.tar.bz2
historical-e7ffbae651d7e091fb2fd545f574fc8b82d9bcb4.zip
Version bump, add the long-requested init script (protected with a USE=vanilla for those preferring not to have it).
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'app-emulation/lxc')
-rw-r--r--app-emulation/lxc/ChangeLog9
-rw-r--r--app-emulation/lxc/Manifest15
-rw-r--r--app-emulation/lxc/files/lxc.initd67
-rw-r--r--app-emulation/lxc/lxc-0.7.2.ebuild107
-rw-r--r--app-emulation/lxc/metadata.xml10
5 files changed, 201 insertions, 7 deletions
diff --git a/app-emulation/lxc/ChangeLog b/app-emulation/lxc/ChangeLog
index c578f0bb562b..1f7c68870a8d 100644
--- a/app-emulation/lxc/ChangeLog
+++ b/app-emulation/lxc/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-emulation/lxc
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.13 2010/06/28 00:00:08 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/ChangeLog,v 1.14 2010/08/01 03:17:50 flameeyes Exp $
+
+*lxc-0.7.2 (01 Aug 2010)
+
+ 01 Aug 2010; Diego E. Pettenò <flameeyes@gentoo.org> +lxc-0.7.2.ebuild,
+ +files/lxc.initd, metadata.xml:
+ Version bump, add the long-requested init script (protected with a
+ USE=vanilla for those preferring not to have it).
*lxc-0.7.1 (28 Jun 2010)
diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
index 011bf86d493b..0ddefd187f93 100644
--- a/app-emulation/lxc/Manifest
+++ b/app-emulation/lxc/Manifest
@@ -1,14 +1,17 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
+AUX lxc.initd 1674 RMD160 783577ab296b6951527963074099ffdd69154742 SHA1 234cc4ad663f343305ceee15ed83e2aa3c8c80cc SHA256 2dd5b7ed967ebe29240d61e71f47911395207d896d42f9e6fb5e9f6e9d5c0b7e
DIST lxc-0.7.1.tar.gz 264376 RMD160 a57c978b50f2f6df15d526d4d5d25c8cd438e9cf SHA1 06dab217dd67b10acc57e2566f80b0673f0261f2 SHA256 da7a0b4f684a0d1d9d982c8423f1143a59798a0fab6c30e0c1aae752c578a642
+DIST lxc-0.7.2.tar.gz 266877 RMD160 3c4f2a751c1f4965bab75d9825e4d9d0642a4a4b SHA1 75dfc113a576fa15d46a3736ff788a168de0b258 SHA256 0660edbc08d74275968cb18c8e634aafd6f1ad395419e037d7018f2b1d669b1a
EBUILD lxc-0.7.1.ebuild 2155 RMD160 4dd61fc556387bcc1d1017bb8a6a18b4f3199437 SHA1 aea867f6771006d9cbed10e1949046d654a4007c SHA256 a4d7a27f6902f826704738ccb8dac2139b9c64a92735fcdc3868229493764bec
-MISC ChangeLog 3184 RMD160 a58f7175a864db044be80dd231acb7f3da43692a SHA1 80c9d43867814c10dae407e809d823b90fd9da91 SHA256 17b6b1864dd90401386a6d774a671f566e02946f2bab5309fcc190e69c091cdd
-MISC metadata.xml 310 RMD160 a4aeb0a359704671f8128ef15d4e5140d66e198f SHA1 eec47e2b6feb72b1aa448155708756521cf8d082 SHA256 255ba2a5412f475edbc07ba230222a616e045cf3d95d819915c19ce2edb210dd
+EBUILD lxc-0.7.2.ebuild 3048 RMD160 b549c08c106eb9ca7959c350857f2c454eb65a8f SHA1 48240a26cc5dfe1ab2a6f167a055a5471d50e000 SHA256 22268e3172e0580753727b0e9a946d115208c1c5c44ca41a6ee4e1bf11cf0501
+MISC ChangeLog 3441 RMD160 fd66baab077a8b20c435c2bcf316c050fd065c67 SHA1 4a3549e0694757b518f5280a176def9b503cc398 SHA256 12df80240a389fe856a62b3089f336c6ae4e2cfd032d78ed21fd171840c54a64
+MISC metadata.xml 653 RMD160 d6139a7ce3a5dab18f33c7f111f2e7827c290723 SHA1 47ba631625b4f2b20e491a964e65c78dd236f6f2 SHA256 35f64761067f47ff7abd0e3f3cb57f4bab888a2546bf3267d59987505101a190
-----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.15 (GNU/Linux)
+Version: GnuPG v2.0.16 (GNU/Linux)
-iEYEARECAAYFAkwn5hYACgkQAiZjviIA2Xj+7QCgsv0rdyjGizGDmDPP0rF02iZg
-lHwAoJuPAeJfWVTeKHLltTvK8vGWLjK5
-=JGf4
+iEYEARECAAYFAkxU51EACgkQAiZjviIA2XiqDACgqzxSTts+889cEzuQKUQvgu2P
+KscAoPJ05B20jk8DiqnGH5ca7Lt8aIC6
+=XkpP
-----END PGP SIGNATURE-----
diff --git a/app-emulation/lxc/files/lxc.initd b/app-emulation/lxc/files/lxc.initd
new file mode 100644
index 000000000000..99706980cb2d
--- /dev/null
+++ b/app-emulation/lxc/files/lxc.initd
@@ -0,0 +1,67 @@
+#!/sbin/runscript
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/files/lxc.initd,v 1.1 2010/08/01 03:17:51 flameeyes Exp $
+
+CONTAINER=${SVCNAME#*.}
+CONFIGFILE=${CONFIGFILE:-/etc/lxc/${CONTAINER}.conf}
+
+depend() {
+ need net.lo localmount
+}
+
+checkconfig() {
+ if [ ${CONTAINER} = ${SVCNAME} ]; then
+ eerror "You have to create an init script for each container:"
+ eerror " ln -s lxc /etc/init.d/lxc.container"
+ return 1
+ fi
+}
+
+rootpath() {
+ sed -n -e 's:^[ \t]*lxc.rootfs[ \t]*=[ \t]*\(.*\)$:\1:p' ${CONFIGFILE}
+}
+
+start() {
+ checkconfig || return 1
+
+ rm /var/log/lxc/${CONTAINER}.log
+
+ # Check the format of our init and the chroot's init, to see if we
+ # have to use linux32 or linux64…
+ case $(scanelf -BF '%M#f' /sbin/init $(rootpath)/sbin/init | tr '\n' ':') in
+ ELFCLASS64:ELFCLASS64:) setarch=;;
+ ELFCLASS32:ELFCLASS32:) setarch=;;
+ ELFCLASS32:ELFCLASS64:) setarch=linux64;;
+ ELFCLASS64:ELFCLASS32:) setarch=linux32;;
+ esac
+
+ mkdir -p /var/log/lxc
+
+ ebegin "Starting ${CONTAINER}"
+ ${setarch} lxc-start -n ${CONTAINER} -f ${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
+ eend $?
+}
+
+stop() {
+ checkconfig || return 1
+
+ local init_pid=$(head -n1 /cgroup/${CONTAINER}/tasks)
+
+ ebegin "Shutting down system in ${CONTAINER}"
+ kill -INT ${init_pid}
+ eend $?
+
+ sleep 15
+
+ missingprocs=$(pgrep -P ${init_pid})
+
+ if [ -n "${missingprocs}" ]; then
+ ewarn "Something failed to properly shut down in ${CONTAINER}"
+ fi
+
+ ebegin "Stopping ${CONTAINER}"
+ lxc-stop -n ${CONTAINER}
+ eend $?
+}
+
diff --git a/app-emulation/lxc/lxc-0.7.2.ebuild b/app-emulation/lxc/lxc-0.7.2.ebuild
new file mode 100644
index 000000000000..ccf6066c7099
--- /dev/null
+++ b/app-emulation/lxc/lxc-0.7.2.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/lxc/lxc-0.7.2.ebuild,v 1.1 2010/08/01 03:17:50 flameeyes Exp $
+
+EAPI="2"
+
+inherit eutils linux-info versionator base
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="http://lxc.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+KEYWORDS="~amd64 ~x86"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="doc examples vanilla"
+
+RDEPEND="sys-libs/libcap"
+
+DEPEND="${RDEPEND}
+ doc? ( app-text/docbook-sgml-utils )
+ >=sys-kernel/linux-headers-2.6.29"
+
+# For init script, so protect with vanilla, they are not strictly
+# needed.
+RDEPEND="${RDEPEND}
+ vanilla? (
+ sys-apps/util-linux
+ app-misc/pax-utils
+ )"
+
+CONFIG_CHECK="~CGROUPS
+ ~CGROUP_NS ~CPUSETS ~CGROUP_CPUACCT
+ ~RESOURCE_COUNTERS ~CGROUP_MEM_RES_CTLR
+ ~CGROUP_SCHED
+
+ ~NAMESPACES
+ ~IPC_NS ~USER_NS ~PID_NS
+
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~CGROUP_FREEZER
+ ~UTS_NS ~NET_NS
+ ~VETH ~MACVLAN"
+
+ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
+
+ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
+
+ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
+ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
+
+ERROR_VETH="CONFIG_VETH: needed for internal (inter-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
+
+src_configure() {
+ econf \
+ --localstatedir=/var \
+ --bindir=/usr/sbin \
+ --docdir=/usr/share/doc/${PF} \
+ --with-config-path=/etc/lxc \
+ $(use_enable doc) \
+ $(use_enable examples) \
+ || die "configure failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "install failed"
+
+ dodoc AUTHORS CONTRIBUTING MAINTAINERS \
+ NEWS TODO README doc/FAQ.txt || die "dodoc failed"
+
+ # If the documentation is going to be rebuilt, the Makefiles will
+ # install the man pages themselves; if we're not going to, we
+ # still need to install them, as they are provided with the
+ # tarball in recent versions.
+ if ! use doc; then
+ doman doc/*.{1,5,7} || die
+ fi
+
+ rm -r "${D}"/usr/sbin/lxc-{setcap,ls} \
+ "${D}"/usr/share/man/man1/lxc-ls.1 \
+ || die "unable to remove extraenous content"
+
+ keepdir /etc/lxc
+
+ find "${D}" -name '*.la' -delete
+
+ use vanilla && return 0
+
+ # Gentoo-specific additions!
+ newinitd "${FILESDIR}/${PN}.initd" ${PN}
+}
+
+pkg_postinst() {
+ if ! use vanilla; then
+ elog "There is an init script provided with the package now; no documentation"
+ elog "is currently available though, so please check out /etc/init.d/lxc ."
+ elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
+ elog "to start the container defined into /etc/lxc/configname.conf ."
+ elog "For further information about LXC development see"
+ elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
+ elog ""
+ fi
+ ewarn "To use the lxc-debian and lxc-fedora commands, you need respectively"
+ ewarn "dev-util/debootstrap and sys-apps/yum."
+}
diff --git a/app-emulation/lxc/metadata.xml b/app-emulation/lxc/metadata.xml
index 5865a9b99939..694fd72ce5d0 100644
--- a/app-emulation/lxc/metadata.xml
+++ b/app-emulation/lxc/metadata.xml
@@ -8,4 +8,14 @@
<maintainer>
<email>dev-zero@gentoo.org</email>
</maintainer>
+
+ <use>
+ <flag name="vanilla">
+ Avoid adding Gentoo Linux-specific modifications, which include
+ the custom init script. This is present as a flag to avoid
+ forcing dependencies over users that might not want have them
+ around as they use LXC in contexts where the init script is not
+ useful.
+ </flag>
+ </use>
</pkgmetadata>