commit:     b67a58f568f1f4077c7d9a12cc7b9e70b287e9c0
Author:     Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
AuthorDate: Thu May 19 04:24:59 2016 +0000
Commit:     Erik Mackdanz <stasibear <AT> gentoo <DOT> org>
CommitDate: Thu May 19 04:24:59 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b67a58f5

app-emulation/lxc: version bump to 2.0.1

Gentoo-bug: 558854, 575352, 580864, 582018

Package-Manager: portage-2.2.28

 app-emulation/lxc/Manifest                         |   1 +
 .../lxc/files/lxc-2.0.1-bash-completion.patch      |  31 ++++
 .../lxc/files/lxc-2.0.1-omit-sysconfig.patch       |   5 +
 app-emulation/lxc/files/lxc.initd.4                | 119 ++++++++++++
 app-emulation/lxc/files/lxc_at.service.3           |  15 ++
 app-emulation/lxc/lxc-2.0.1.ebuild                 | 200 +++++++++++++++++++++
 6 files changed, 371 insertions(+)

diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
index 4e61c43..ef86569 100644
--- a/app-emulation/lxc/Manifest
+++ b/app-emulation/lxc/Manifest
@@ -7,3 +7,4 @@ DIST lxc-1.1.2.tar.gz 597158 SHA256 
f22fcf2659ca98dfe864e632374de98c42cdf465d0c6
 DIST lxc-1.1.3.tar.gz 599889 SHA256 
b75fb8e376d3313e152f31fb7372b68f33a953a12191a39de4cded04fff94300 SHA512 
cafa4fbe4fe23b8c0b98007a79f20899c4a3b98c51d797b9c16e38dfec1eee5a513b58621308fe6551707d38028d9e5bd78ade8822691ffe4a7a369b10a48dda
 WHIRLPOOL 
04ad57d8b189ab089b27adad8e511dcc2e5c563505f8134323ac9d738283bd5d0d929ebadeb69cd49ea68ea3e182f22c72590505cbf6f9d8438112e46909e1b5
 DIST lxc-1.1.4.tar.gz 604167 SHA256 
b087baf5ac4b94618388e6e759d9cdafcf5c98ed67bf9012ee9660076f9fb0d1 SHA512 
b239c285b68ddb25c165e998307d69b368bb802e89c1e26de9daab956ffc05cb8e80bf7c796233552b08a57d1cc37c22777bb7a7469db111582184ee13272c93
 WHIRLPOOL 
2d69d0540c15274627cdbd0f1944a119b601e1298b9328ba336beae0aa6bffd62dfdf85af82f54c3926489e19b4cee7eaa6c35bcfb72e4b3904f85102055ae85
 DIST lxc-1.1.5.tar.gz 607219 SHA256 
eefce4cc679656cb8636bf0849f3ba6981c48167884e13dbcb377820a717c09c SHA512 
e48ab549f1317afcb5f7768ab988ba27a3e9f1458504e1d70b2e27c502233e7b3538b8ce0b79940140a59a37681bcd8e459416e814f9e4814a4ed86b89e8df1c
 WHIRLPOOL 
0d65ec400913b3298517ba0cb50e064b894d8b26cbd331662e11caee285a37aa1e0d1e4623b69e75585c4369544ca02ff97db90d5127c697cd53fde87d2bc968
+DIST lxc-2.0.1.tar.gz 772083 SHA256 
543b927e0be6df256562afe05281552645c78c4a9c0881bf313e31ae13679a29 SHA512 
f64cc7167bfed1cc74689bf7d9a5b1ad5b957d5791529c8319c55d2cc671dbd00df9c08fb8f10f73c0d77465a54eb4c98c980e66dd888f52c7670640c6bbf78f
 WHIRLPOOL 
a4d25a6733200fcc488b90c34715af8d5d9cd53632f8c82085e5dfe0216500c4714414b616bddda82f4ee014525fd222604d9d46d385658147e411060632f748

diff --git a/app-emulation/lxc/files/lxc-2.0.1-bash-completion.patch 
b/app-emulation/lxc/files/lxc-2.0.1-bash-completion.patch
new file mode 100644
index 0000000..9ef6013
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-2.0.1-bash-completion.patch
@@ -0,0 +1,31 @@
+--- lxc-lxc-2.0.1/config/bash/Makefile.am.orig 2016-05-18 20:40:42.238487678 
+0000
++++ lxc-lxc-2.0.1/config/bash/Makefile.am      2016-05-18 20:43:02.163497779 
+0000
+@@ -2,12 +2,12 @@
+ 
+ if ENABLE_BASH
+ install-bash:
+-      $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
+-      $(INSTALL_DATA) lxc $(DESTDIR)$(sysconfdir)/bash_completion.d/
++      $(MKDIR_P) $(DESTDIR)$(datarootdir)/bash-completion/completions/
++      $(INSTALL_DATA) lxc 
$(DESTDIR)$(datarootdir)/bash-completion/completions/
+ 
+ uninstall-bash:
+-      rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/lxc
+-      rmdir $(DESTDIR)$(sysconfdir)/bash_completion.d/ || :
++      rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/lxc
++      rmdir $(DESTDIR)$(datarootdir)/bash-completion/completions/ || :
+ 
+ install-data-local: install-bash
+ uninstall-local: uninstall-bash
+--- lxc-lxc-2.0.1/config/bash/lxc.in.orig      2016-05-18 20:40:51.079488316 
+0000
++++ lxc-lxc-2.0.1/config/bash/lxc.in   2016-05-18 20:45:03.506506538 +0000
+@@ -1,4 +1,3 @@
+-_have lxc-start && {
+     _lxc_names() {
+         COMPREPLY=( $( compgen -W "$( lxc-ls )" "$cur" ) )
+     }
+@@ -100,4 +99,3 @@
+ 
+     complete -o default -F _lxc_generic_o lxc-copy
+     complete -o default -F _lxc_generic_o lxc-start-ephemeral
+-}

diff --git a/app-emulation/lxc/files/lxc-2.0.1-omit-sysconfig.patch 
b/app-emulation/lxc/files/lxc-2.0.1-omit-sysconfig.patch
new file mode 100644
index 0000000..9b83a3b
--- /dev/null
+++ b/app-emulation/lxc/files/lxc-2.0.1-omit-sysconfig.patch
@@ -0,0 +1,5 @@
+--- lxc-lxc-2.0.1/config/Makefile.am.orig      2016-05-19 02:56:11.891113982 
+0000
++++ lxc-lxc-2.0.1/config/Makefile.am   2016-05-19 02:56:32.596115476 +0000
+@@ -1 +1 @@
+-SUBDIRS = apparmor bash etc init selinux templates yum sysconfig
++SUBDIRS = apparmor bash etc init selinux templates yum

diff --git a/app-emulation/lxc/files/lxc.initd.4 
b/app-emulation/lxc/files/lxc.initd.4
new file mode 100644
index 0000000..c8325bc
--- /dev/null
+++ b/app-emulation/lxc/files/lxc.initd.4
@@ -0,0 +1,119 @@
+#!/sbin/runscript
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+CONTAINER=${SVCNAME#*.}
+
+LXC_PATH=`lxc-config lxc.lxcpath`
+
+lxc_get_configfile() {
+       if [ -f "${LXC_PATH}/${CONTAINER}.conf" ]; then
+               echo "${LXC_PATH}/${CONTAINER}.conf"
+       elif [ -f "${LXC_PATH}/${CONTAINER}/config" ]; then
+               echo "${LXC_PATH}/${CONTAINER}/config"
+       else
+               eerror "Unable to find a suitable configuration file."
+               eerror "If you set up the container in a non-standard"
+               eerror "location, please set the CONFIGFILE variable."
+               return 1
+       fi
+}
+
+[ $CONTAINER != $SVCNAME ] && CONFIGFILE=${CONFIGFILE:-$(lxc_get_configfile)}
+
+lxc_get_var() {
+       awk 'BEGIN { FS="[ \t]*=[ \t]*" } $1 == "'$1'" { print $2; exit }' 
${CONFIGFILE}
+}
+
+lxc_get_net_link_type() {
+       awk 'BEGIN { FS="[ \t]*=[ \t]*"; _link=""; _type="" }
+               $1 == "lxc.network.type" {_type=$2;}
+               $1 == "lxc.network.link" {_link=$2;}
+               {if(_link != "" && _type != ""){
+                       printf("%s:%s\n", _link, _type );
+                       _link=""; _type="";
+               }; }' <${CONFIGFILE}
+}
+
+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
+
+       # no need to output anything, the function takes care of that.
+       [ -z "${CONFIGFILE}" ] && return 1
+
+       utsname=$(lxc_get_var lxc.utsname)
+       if [ ${CONTAINER} != ${utsname} ]; then
+           eerror "You should use the same name for the service and the"
+           eerror "container. Right now the container is called ${utsname}"
+           return 1
+       fi
+}
+
+depend() {
+       # be quiet, since we have to run depend() also for the
+       # non-muxed init script, unfortunately.
+       checkconfig 2>/dev/null || return 0
+
+       config ${CONFIGFILE}
+       need localmount
+       use lxcfs
+
+       local _x _if
+       for _x in $(lxc_get_net_link_type); do
+               _if=${_x%:*}
+               case "${_x##*:}" in
+                       # when the network type is set to phys, we can make use 
of a
+                       # network service (for instance to set it up before we 
disable
+                       # the net_admin capability), but we might also not set 
it up
+                       # at all on the host and leave the net_admin capable 
service
+                       # to take care of it.
+                       phys)   use net.${_if} ;;
+                       *)      need net.${_if} ;;
+               esac
+       done
+}
+
+start() {
+       checkconfig || return 1
+       rm -f /var/log/lxc/${CONTAINER}.log
+
+       rootpath=$(lxc_get_var lxc.rootfs)
+
+       # Check the format of our init and the chroot's init, to see
+       # if we have to use linux32 or linux64; always use setarch
+       # when required, as that makes it easier to deal with
+       # x32-based containers.
+       case $(scanelf -BF '%a#f' ${rootpath}/sbin/init) in
+               EM_X86_64)      setarch=linux64;;
+               EM_386)         setarch=linux32;;
+       esac
+
+       ebegin "Starting ${CONTAINER}"
+       env -i ${setarch} $(which lxc-start) -l WARN -n ${CONTAINER} -f 
${CONFIGFILE} -d -o /var/log/lxc/${CONTAINER}.log
+       sleep 0.5
+
+       # lxc-start -d will _always_ report a correct startup, even if it
+       # failed, so rather than trust that, check that the cgroup exists.
+       [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]
+       eend $?
+}
+
+stop() {
+       checkconfig || return 1
+
+
+       if ! [ -d /sys/fs/cgroup/cpuset/lxc/${CONTAINER} ]; then
+           ewarn "${CONTAINER} doesn't seem to be started."
+           return 0
+       fi
+
+       # 10s should be enough to shut everything down
+       ebegin "Stopping ${CONTAINER}"
+       lxc-stop -t 10 -n ${CONTAINER}
+       eend $?
+}

diff --git a/app-emulation/lxc/files/lxc_at.service.3 
b/app-emulation/lxc/files/lxc_at.service.3
new file mode 100644
index 0000000..6726414
--- /dev/null
+++ b/app-emulation/lxc/files/lxc_at.service.3
@@ -0,0 +1,15 @@
+[Unit]
+Description=Linux Container %I
+After=network.target
+Wants=lxcfs.service
+
+[Service]
+Restart=always
+ExecStartPre=/usr/libexec/lxc/lxc-devsetup
+ExecStart=/usr/bin/lxc-start -n %i -F
+ExecReload=/usr/bin/lxc-restart -n %i
+ExecStop=/usr/bin/lxc-stop -n %i
+Delegate=yes
+
+[Install]
+WantedBy=multi-user.target

diff --git a/app-emulation/lxc/lxc-2.0.1.ebuild 
b/app-emulation/lxc/lxc-2.0.1.ebuild
new file mode 100644
index 0000000..b95536f
--- /dev/null
+++ b/app-emulation/lxc/lxc-2.0.1.ebuild
@@ -0,0 +1,200 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="5"
+
+MY_P="${P/_/-}"
+PYTHON_COMPAT=( python{3_3,3_4,3_5} )
+DISTUTILS_OPTIONAL=1
+
+inherit autotools bash-completion-r1 distutils-r1 eutils linux-info 
versionator flag-o-matic systemd
+
+DESCRIPTION="LinuX Containers userspace utilities"
+HOMEPAGE="https://linuxcontainers.org/";
+SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz";
+
+KEYWORDS="~amd64 ~arm ~arm64"
+
+LICENSE="LGPL-3"
+SLOT="0"
+IUSE="cgmanager doc examples lua python seccomp"
+
+RDEPEND="net-libs/gnutls
+       sys-libs/libcap
+       cgmanager? ( app-admin/cgmanager )
+       lua? ( >=dev-lang/lua-5.1:= )
+       python? ( ${PYTHON_DEPS} )
+       seccomp? ( sys-libs/libseccomp )"
+
+DEPEND="${RDEPEND}
+       doc? ( app-text/docbook-sgml-utils )
+       >=sys-kernel/linux-headers-3.2"
+
+RDEPEND="${RDEPEND}
+       sys-process/criu
+       sys-apps/util-linux
+       app-misc/pax-utils
+       virtual/awk"
+
+CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
+       ~CPUSETS ~CGROUP_CPUACCT
+       ~CGROUP_SCHED
+
+       ~NAMESPACES
+       ~IPC_NS ~USER_NS ~PID_NS
+
+       ~NETLINK_DIAG ~PACKET_DIAG
+       ~INET_UDP_DIAG ~INET_TCP_DIAG
+       ~UNIX_DIAG ~CHECKPOINT_RESTORE
+
+       ~DEVPTS_MULTIPLE_INSTANCES
+       ~CGROUP_FREEZER
+       ~UTS_NS ~NET_NS
+       ~VETH ~MACVLAN
+
+       ~POSIX_MQUEUE
+       ~!NETPRIO_CGROUP
+
+       ~!GRKERNSEC_CHROOT_MOUNT
+       ~!GRKERNSEC_CHROOT_DOUBLE
+       ~!GRKERNSEC_CHROOT_PIVOT
+       ~!GRKERNSEC_CHROOT_CHMOD
+       ~!GRKERNSEC_CHROOT_CAPS
+       ~!GRKERNSEC_PROC
+       ~!GRKERNSEC_SYSFS_RESTRICT
+"
+
+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 (host-to-container) networking"
+ERROR_MACVLAN="CONFIG_MACVLAN:  needed for internal (inter-container) 
networking"
+
+ERROR_NETLINK_DIAG="CONFIG_NETLINK_DIAG:  needed for lxc-checkpoint"
+ERROR_PACKET_DIAG="CONFIG_PACKET_DIAG:  needed for lxc-checkpoint"
+ERROR_INET_UDP_DIAG="CONFIG_INET_UDP_DIAG:  needed for lxc-checkpoint"
+ERROR_INET_TCP_DIAG="CONFIG_INET_TCP_DIAG:  needed for lxc-checkpoint"
+ERROR_UNIX_DIAG="CONFIG_UNIX_DIAG:  needed for lxc-checkpoint"
+ERROR_CHECKPOINT_RESTORE="CONFIG_CHECKPOINT_RESTORE:  needed for 
lxc-checkpoint"
+
+ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE:  needed for lxc-execute command"
+
+ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP:  as of kernel 3.3 and lxc 
0.8.0_rc1 this causes LXCs to fail booting."
+
+ERROR_GRKERNSEC_CHROOT_MOUNT="CONFIG_GRKERNSEC_CHROOT_MOUNT:  some GRSEC 
features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_DOUBLE="CONFIG_GRKERNSEC_CHROOT_DOUBLE:  some GRSEC 
features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_PIVOT="CONFIG_GRKERNSEC_CHROOT_PIVOT:  some GRSEC 
features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CHMOD="CONFIG_GRKERNSEC_CHROOT_CHMOD:  some GRSEC 
features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_CHROOT_CAPS="CONFIG_GRKERNSEC_CHROOT_CAPS:  some GRSEC 
features make LXC unusable see postinst notes"
+ERROR_GRKERNSEC_PROC="CONFIG_GRKERNSEC_PROC:  this GRSEC feature is 
incompatible with unprivileged containers"
+ERROR_GRKERNSEC_SYSFS_RESTRICT="CONFIG_GRKERNSEC_SYSFS_RESTRICT:  this GRSEC 
feature is incompatible with unprivileged containers"
+
+DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
+
+S="${WORKDIR}/${PN}-${MY_P}"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-bash-completion.patch
+       #558854
+       epatch "${FILESDIR}"/${P}-omit-sysconfig.patch
+       eautoreconf
+}
+
+src_configure() {
+       append-flags -fno-strict-aliasing
+
+       if use python; then
+               #541932
+               python_setup "python3*"
+               export 
PKG_CONFIG_PATH="${T}/${EPYTHON}/pkgconfig:${PKG_CONFIG_PATH}"
+       fi
+
+       # I am not sure about the --with-rootfs-path
+       # /var/lib/lxc is probably more appropriate than
+       # /usr/lib/lxc.
+       econf \
+               --localstatedir=/var \
+               --bindir=/usr/bin \
+               --sbindir=/usr/bin \
+               --docdir=/usr/share/doc/${PF} \
+               --with-config-path=/var/lib/lxc \
+               --with-rootfs-path=/var/lib/lxc/rootfs \
+               --with-distro=gentoo \
+               --with-runtime-path=/run \
+               --disable-apparmor \
+               $(use_enable cgmanager) \
+               $(use_enable doc) \
+               $(use_enable examples) \
+               $(use_enable lua) \
+               $(use_enable python) \
+               $(use_enable seccomp)
+}
+
+python_compile() {
+       distutils-r1_python_compile build_ext -I ../ -L ../${PN}
+}
+
+src_compile() {
+       default
+
+       if use python; then
+               pushd "${S}/src/python-${PN}" > /dev/null
+               distutils-r1_src_compile
+               popd > /dev/null
+       fi
+}
+
+src_install() {
+       default
+
+       mv "${ED}"/usr/share/bash-completion/completions/${PN} 
"${ED}"/$(get_bashcompdir)/${PN}-start || die
+       # start-ephemeral is no longer a command but removing it here
+       # generates QA warnings (still in upstream completion script)
+       bashcomp_alias ${PN}-start \
+               
${PN}-{attach,cgroup,copy,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
+
+       if use python; then
+               pushd "${S}/src/python-lxc" > /dev/null
+               # Unset DOCS. This has been handled by the default target
+               unset DOCS
+               distutils-r1_src_install
+               popd > /dev/null
+       fi
+
+       keepdir /etc/lxc /var/lib/lxc/rootfs /var/log/lxc
+
+       find "${D}" -name '*.la' -delete
+
+       # Gentoo-specific additions!
+       newinitd "${FILESDIR}/${PN}.initd.4" ${PN}
+
+       # lxc-devsetup script
+       exeinto /usr/libexec/${PN}
+       doexe config/init/common/${PN}-devsetup
+       # Remember to compare our systemd unit file with the upstream one
+       # config/init/systemd/lxc.service.in
+       systemd_newunit "${FILESDIR}"/${PN}_at.service.3 "[email protected]"
+}
+
+pkg_postinst() {
+       elog ""
+       elog "Starting from version ${PN}-1.1.0-r3, the default lxc path has 
been"
+       elog "moved from /etc/lxc to /var/lib/lxc. If you still want to use 
/etc/lxc"
+       elog "please add the following to your /etc/lxc/default.conf"
+       elog "lxc.lxcpath = /etc/lxc"
+       elog ""
+       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 ""
+}

Reply via email to