Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/lxc/files/, app-emulation/lxc/
Date: Fri, 15 Dec 2017 01:55:39
Message-Id: 1513302889.10f4222c4de2373a926f90a621dff33929b4ddd4.tamiko@gentoo
1 commit: 10f4222c4de2373a926f90a621dff33929b4ddd4
2 Author: Virgil Dupras <hsoft <AT> hardcoded <DOT> net>
3 AuthorDate: Fri Dec 15 00:22:23 2017 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 15 01:54:49 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=10f4222c
7
8 app-emulation/lxc: Bump to 1.0.11
9
10 Closes: https://bugs.gentoo.org/634866
11 Closes: https://github.com/gentoo/gentoo/pull/6551
12 Package-Manager: Portage-2.3.13, Repoman-2.3.3
13 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
14
15 app-emulation/lxc/Manifest | 1 +
16 .../lxc/files/lxc-1.0.11-bash-completion.patch | 27 +++
17 app-emulation/lxc/files/lxc-1.0.11-major.patch | 64 +++++++
18 app-emulation/lxc/lxc-1.0.11.ebuild | 184 +++++++++++++++++++++
19 4 files changed, 276 insertions(+)
20
21 diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
22 index c1ef825e830..b425522f07c 100644
23 --- a/app-emulation/lxc/Manifest
24 +++ b/app-emulation/lxc/Manifest
25 @@ -1,3 +1,4 @@
26 +DIST lxc-1.0.11.tar.gz 850645 BLAKE2B 1a8eff91d970d3160d5ca7338f4e4d68c722a277a804396e7c30b34dbf4aeccc0609982940bb660992880078167cdf3382a55af404b3e52ebe8cd8af104b1efc SHA512 5537e61a286cfce3c763b81eec625538c796ea1e8f5e94c5a28fc8964762c8c0efa7983a188d521bf3420a42569d7124e6587950bc90b79583fa42cc8e2f8f74
27 DIST lxc-1.0.8.tar.gz 575127 BLAKE2B 246ac7a2b4306c52a741b2f763bcc81d9999fb27942ef93d6a786ed2ea010c646f5a2388407d26425387b8a819cacae927c8512995bf19b11d610e1887ea6470 SHA512 f552a4f48bb47d26c6b9ddaf8221a439c0848e3f54ec41b77d54717c21bddd56193941046cc96c699790e8265e762a926469c25ee687adcf7795f2906b1c260a
28 DIST lxc-2.0.3.tar.gz 772448 BLAKE2B 2336edea328a0ac033f2183386a2907ee8a088032b089c073ae8bbce6f54c55788288be85fe35a0b547976d5868abc31b27ffe5a5049e8769350c2b48dd9310c SHA512 df714f189ec7aa681710fbd58405b8958740102032c0130d8a0eaaae0341a9bc91a215136203c404ad79773800f620bf6f71f811b3effe559aed66efa4f34fef
29 DIST lxc-2.0.4.tar.gz 775634 BLAKE2B 9699ae598c3dfddf458f62ca154a4ec75c3510d8dc0be98ebb6b10a30b21ec5e56ff9ec20615c0104a92124c4833e9439f88d04e0312a7c82f79ed7b6f802bbd SHA512 3f985bba5aaa8a70f0329316ea4f42ab135d58c47611154c62e103718212a4b2c5e4f25fd45c372424db1fbf40afdc8269ae98655fb3bc8e31085a5d948f702b
30
31 diff --git a/app-emulation/lxc/files/lxc-1.0.11-bash-completion.patch b/app-emulation/lxc/files/lxc-1.0.11-bash-completion.patch
32 new file mode 100644
33 index 00000000000..d8d0bac55a7
34 --- /dev/null
35 +++ b/app-emulation/lxc/files/lxc-1.0.11-bash-completion.patch
36 @@ -0,0 +1,27 @@
37 +diff --git a/config/bash/lxc.in b/config/bash/lxc.in
38 +index 344d5cb2..f051eaae 100644
39 +--- a/config/bash/lxc.in
40 ++++ b/config/bash/lxc.in
41 +@@ -1,4 +1,3 @@
42 +-_have lxc-start && {
43 + _lxc_names() {
44 + COMPREPLY=( $( compgen -W "$( lxc-ls )" "$cur" ) )
45 + }
46 +@@ -100,4 +99,3 @@ _have lxc-start && {
47 +
48 + complete -o default -F _lxc_generic_o lxc-clone
49 + complete -o default -F _lxc_generic_o lxc-start-ephemeral
50 +-}
51 +diff --git a/configure.ac b/configure.ac
52 +index 2ea88c19..f52d772a 100644
53 +--- a/configure.ac
54 ++++ b/configure.ac
55 +@@ -429,7 +429,7 @@ AM_CONDITIONAL([ENABLE_BASH], [test "x$enable_bash" = "xyes"])
56 + AM_COND_IF([ENABLE_BASH],
57 + [AC_MSG_CHECKING([bash completion directory])
58 + PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], ,
59 +- bashcompdir="${sysconfdir}/bash_completion.d")
60 ++ bashcompdir="$datadir/bash-completion/completions")
61 + AC_MSG_RESULT([$bashcompdir])
62 + AC_SUBST(bashcompdir)
63 + ])
64
65 diff --git a/app-emulation/lxc/files/lxc-1.0.11-major.patch b/app-emulation/lxc/files/lxc-1.0.11-major.patch
66 new file mode 100644
67 index 00000000000..8a3c2b2bd6d
68 --- /dev/null
69 +++ b/app-emulation/lxc/files/lxc-1.0.11-major.patch
70 @@ -0,0 +1,64 @@
71 +diff --git a/src/lxc/bdev.c b/src/lxc/bdev.c
72 +index 59eda7e4..44b71d4c 100644
73 +--- a/src/lxc/bdev.c
74 ++++ b/src/lxc/bdev.c
75 +@@ -41,6 +41,7 @@
76 + #include <libgen.h>
77 + #include <linux/loop.h>
78 + #include <dirent.h>
79 ++#include <sys/sysmacros.h>
80 +
81 + #include "lxc.h"
82 + #include "config.h"
83 +@@ -58,9 +59,6 @@
84 + #ifdef MAJOR_IN_MKDEV
85 + # include <sys/mkdev.h>
86 + #endif
87 +-#ifdef MAJOR_IN_SYSMACROS
88 +-# include <sys/sysmacros.h>
89 +-#endif
90 +
91 + #ifndef BLKGETSIZE64
92 + #define BLKGETSIZE64 _IOR(0x12,114,size_t)
93 +diff --git a/src/lxc/conf.c b/src/lxc/conf.c
94 +index 5d583d5f..d4217c27 100644
95 +--- a/src/lxc/conf.c
96 ++++ b/src/lxc/conf.c
97 +@@ -36,14 +36,12 @@
98 + #include <pwd.h>
99 + #include <grp.h>
100 + #include <time.h>
101 ++#include <sys/sysmacros.h>
102 +
103 + /* makedev() */
104 + #ifdef MAJOR_IN_MKDEV
105 + # include <sys/mkdev.h>
106 + #endif
107 +-#ifdef MAJOR_IN_SYSMACROS
108 +-# include <sys/sysmacros.h>
109 +-#endif
110 +
111 + #ifdef HAVE_STATVFS
112 + #include <sys/statvfs.h>
113 +diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c
114 +index 3963a3ee..30ac6733 100644
115 +--- a/src/lxc/lxccontainer.c
116 ++++ b/src/lxc/lxccontainer.c
117 +@@ -36,6 +36,7 @@
118 + #include <stdint.h>
119 + #include <grp.h>
120 + #include <sys/syscall.h>
121 ++#include <sys/sysmacros.h>
122 +
123 + #include <lxc/lxccontainer.h>
124 + #include <lxc/version.h>
125 +@@ -60,9 +61,6 @@
126 + #ifdef MAJOR_IN_MKDEV
127 + # include <sys/mkdev.h>
128 + #endif
129 +-#ifdef MAJOR_IN_SYSMACROS
130 +-# include <sys/sysmacros.h>
131 +-#endif
132 +
133 + #if HAVE_IFADDRS_H
134 + #include <ifaddrs.h>
135
136 diff --git a/app-emulation/lxc/lxc-1.0.11.ebuild b/app-emulation/lxc/lxc-1.0.11.ebuild
137 new file mode 100644
138 index 00000000000..2658e3a05db
139 --- /dev/null
140 +++ b/app-emulation/lxc/lxc-1.0.11.ebuild
141 @@ -0,0 +1,184 @@
142 +# Copyright 1999-2017 Gentoo Foundation
143 +# Distributed under the terms of the GNU General Public License v2
144 +
145 +EAPI="5"
146 +
147 +PYTHON_COMPAT=( python3_{4,5,6} )
148 +DISTUTILS_OPTIONAL=1
149 +
150 +inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
151 +
152 +DESCRIPTION="LinuX Containers userspace utilities"
153 +HOMEPAGE="https://linuxcontainers.org/"
154 +SRC_URI="https://linuxcontainers.org/downloads/lxc/${P}.tar.gz"
155 +
156 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
157 +
158 +LICENSE="LGPL-3"
159 +SLOT="0"
160 +IUSE="doc examples lua python seccomp"
161 +
162 +RDEPEND="net-libs/gnutls
163 + sys-libs/libcap
164 + lua? ( >=dev-lang/lua-5.1:= )
165 + python? ( ${PYTHON_DEPS} )
166 + seccomp? ( sys-libs/libseccomp )"
167 +
168 +DEPEND="${RDEPEND}
169 + doc? ( app-text/docbook-sgml-utils )
170 + >=sys-kernel/linux-headers-3.2"
171 +
172 +RDEPEND="${RDEPEND}
173 + sys-apps/util-linux
174 + app-misc/pax-utils
175 + virtual/awk"
176 +
177 +CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
178 + ~CPUSETS ~CGROUP_CPUACCT
179 + ~CGROUP_SCHED
180 +
181 + ~NAMESPACES
182 + ~IPC_NS ~USER_NS ~PID_NS
183 +
184 + ~CGROUP_FREEZER
185 + ~UTS_NS ~NET_NS
186 + ~VETH ~MACVLAN
187 +
188 + ~POSIX_MQUEUE
189 + ~!NETPRIO_CGROUP
190 +
191 + ~!GRKERNSEC_CHROOT_MOUNT
192 + ~!GRKERNSEC_CHROOT_DOUBLE
193 + ~!GRKERNSEC_CHROOT_PIVOT
194 + ~!GRKERNSEC_CHROOT_CHMOD
195 + ~!GRKERNSEC_CHROOT_CAPS
196 + ~!GRKERNSEC_PROC
197 +"
198 +
199 +ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
200 +
201 +ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
202 +
203 +ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
204 +ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
205 +
206 +ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
207 +ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
208 +
209 +ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
210 +
211 +ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
212 +
213 +ERROR_GRKERNSEC_CHROOT_MOUNT=":CONFIG_GRKERNSEC_CHROOT_MOUNT some GRSEC features make LXC unusable see postinst notes"
214 +ERROR_GRKERNSEC_CHROOT_DOUBLE=":CONFIG_GRKERNSEC_CHROOT_DOUBLE some GRSEC features make LXC unusable see postinst notes"
215 +ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT some GRSEC features make LXC unusable see postinst notes"
216 +ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD some GRSEC features make LXC unusable see postinst notes"
217 +ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS some GRSEC features make LXC unusable see postinst notes"
218 +ERROR_GRKERNSEC_PROC=":CONFIG_GRKERNSEC_PROC: this GRSEC feature is incompatible with unprivileged containers"
219 +
220 +DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
221 +
222 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
223 +
224 +src_prepare() {
225 + sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac || die
226 + if [[ -n ${BACKPORTS} ]]; then
227 + epatch "${WORKDIR}"/patches/*
228 + fi
229 +
230 + epatch "${FILESDIR}"/${PN}-1.0.11-bash-completion.patch
231 + epatch "${FILESDIR}"/${PN}-1.0.11-major.patch
232 +
233 + eautoreconf
234 +}
235 +
236 +src_configure() {
237 + append-flags -fno-strict-aliasing
238 +
239 + econf \
240 + --localstatedir=/var \
241 + --bindir=/usr/sbin \
242 + --docdir=/usr/share/doc/${PF} \
243 + --with-config-path=/etc/lxc \
244 + --with-rootfs-path=/usr/lib/lxc/rootfs \
245 + --with-distro=gentoo \
246 + $(use_enable doc) \
247 + --disable-apparmor \
248 + $(use_enable examples) \
249 + $(use_enable lua) \
250 + $(use_enable seccomp) \
251 + --disable-python
252 +}
253 +
254 +python_compile() {
255 + distutils-r1_python_compile build_ext -I ../ -L ../${PN}
256 +}
257 +
258 +src_compile() {
259 + default
260 +
261 + if use python; then
262 + pushd "${S}/src/python-${PN}" > /dev/null
263 + distutils-r1_src_compile
264 + popd > /dev/null
265 + fi
266 +}
267 +
268 +src_install() {
269 + default
270 +
271 + mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
272 + bashcomp_alias ${PN}-start \
273 + ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
274 +
275 + if use python; then
276 + pushd "${S}/src/python-lxc" > /dev/null
277 + # Unset DOCS. This has been handled by the default target
278 + unset DOCS
279 + distutils-r1_src_install
280 + popd > /dev/null
281 + fi
282 +
283 + keepdir /etc/lxc /usr/lib/lxc/rootfs /var/log/lxc
284 +
285 + find "${D}" -name '*.la' -delete
286 +
287 + # Gentoo-specific additions!
288 + # Use initd.3 per #517144
289 + newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
290 +
291 + # lxc-devsetup script
292 + exeinto /usr/libexec/${PN}
293 + doexe config/init/systemd/${PN}-devsetup
294 + # Use that script with the systemd service (Similar to upstream
295 + # Makefile.am
296 + cp "${FILESDIR}"/${PN}_at.service ${PN}_at.service || die
297 + sed -i \
298 + "/Restart=always/a ExecStartPre=/usr/libexec/${PN}/${PN}-devsetup" \
299 + ${PN}_at.service \
300 + || die "Failed to add ${PN}-devsetup to the systemd service file"
301 + systemd_newunit ${PN}_at.service "lxc@.service"
302 +}
303 +
304 +pkg_postinst() {
305 + elog "There is an init script provided with the package now; no documentation"
306 + elog "is currently available though, so please check out /etc/init.d/lxc ."
307 + elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
308 + elog "to start the container defined into /etc/lxc/configname.conf ."
309 + elog "For further information about LXC development see"
310 + elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
311 + elog ""
312 + ewarn "With version 0.7.4, the mountpoint syntax came back to the one used by 0.7.2"
313 + ewarn "and previous versions. This means you'll have to use syntax like the following"
314 + ewarn ""
315 + ewarn " lxc.rootfs = /container"
316 + ewarn " lxc.mount.entry = /usr/portage /container/usr/portage none bind 0 0"
317 + ewarn ""
318 + ewarn "To use the Fedora, Debian and (various) Ubuntu auto-configuration scripts, you"
319 + ewarn "will need sys-apps/yum or dev-util/debootstrap."
320 + ewarn ""
321 + ewarn "Some GrSecurity settings in relation to chroot security will cause LXC not to"
322 + ewarn "work, while others will actually make it much more secure. Please refer to"
323 + ewarn "Diego Elio Pettenò's weblog at http://blog.flameeyes.eu/tag/lxc for further"
324 + ewarn "details."
325 +}