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 02:47:44
Message-Id: 1513306023.25812fb8449c5b693f492d2fcfce53262de48ec3.tamiko@gentoo
1 commit: 25812fb8449c5b693f492d2fcfce53262de48ec3
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Fri Dec 15 02:46:59 2017 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Fri Dec 15 02:47:03 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25812fb8
7
8 app-emulation/lxc: put terribly old ebuild back in place
9
10 Package-Manager: Portage-2.3.18, Repoman-2.3.6
11 RepoMan-Options: --force
12
13 app-emulation/lxc/Manifest | 1 +
14 .../lxc/files/lxc-1.0.8-bash-completion.patch | 35 ++++
15 app-emulation/lxc/lxc-1.0.8.ebuild | 188 +++++++++++++++++++++
16 3 files changed, 224 insertions(+)
17
18 diff --git a/app-emulation/lxc/Manifest b/app-emulation/lxc/Manifest
19 index 265bac0824f..34820bb75ee 100644
20 --- a/app-emulation/lxc/Manifest
21 +++ b/app-emulation/lxc/Manifest
22 @@ -1,3 +1,4 @@
23 DIST lxc-1.0.11.tar.gz 850645 BLAKE2B 1a8eff91d970d3160d5ca7338f4e4d68c722a277a804396e7c30b34dbf4aeccc0609982940bb660992880078167cdf3382a55af404b3e52ebe8cd8af104b1efc SHA512 5537e61a286cfce3c763b81eec625538c796ea1e8f5e94c5a28fc8964762c8c0efa7983a188d521bf3420a42569d7124e6587950bc90b79583fa42cc8e2f8f74
24 +DIST lxc-1.0.8.tar.gz 575127 BLAKE2B 246ac7a2b4306c52a741b2f763bcc81d9999fb27942ef93d6a786ed2ea010c646f5a2388407d26425387b8a819cacae927c8512995bf19b11d610e1887ea6470 SHA512 f552a4f48bb47d26c6b9ddaf8221a439c0848e3f54ec41b77d54717c21bddd56193941046cc96c699790e8265e762a926469c25ee687adcf7795f2906b1c260a
25 DIST lxc-2.0.7.tar.gz 792557 BLAKE2B e5f1e6d8961938200e116527fab8ce341cf285826afdccac88f4bae65ffd649a406dac7555024557f38c4b415a59cd3b5fb255f1dbf015ce01d4975bed3b1c80 SHA512 eb48dc800ce43d2f4d46e0cecc4d0a714b3e22c6a4975776b54d17d1d20d5a1411e6b605215282f1f77286ddf22b61c80b86b83752191fc18023894ef7a1c44d
26 DIST lxc-2.0.8.tar.gz 1308705 BLAKE2B 044e82e182f4ca325da237b888ff16b0469eb11ecdab2ed55f5e9372e84d816ec30edee28ef1473aaa7211a9d9aee0d26f45f169320551e45098da9de7a74104 SHA512 ed9fd47e92007f433695cffea659180866a5ac2778712f4eb13b6629bb18292589f5b674b734853ca196ba1f6d38bdbf3cc8a2bb28e25d3540b06b945fcf9096
27
28 diff --git a/app-emulation/lxc/files/lxc-1.0.8-bash-completion.patch b/app-emulation/lxc/files/lxc-1.0.8-bash-completion.patch
29 new file mode 100644
30 index 00000000000..e9e0e6c98df
31 --- /dev/null
32 +++ b/app-emulation/lxc/files/lxc-1.0.8-bash-completion.patch
33 @@ -0,0 +1,35 @@
34 +Index: lxc-lxc-1.0.8/config/bash/Makefile.am
35 +===================================================================
36 +--- lxc-lxc-1.0.8.orig/config/bash/Makefile.am
37 ++++ lxc-lxc-1.0.8/config/bash/Makefile.am
38 +@@ -2,12 +2,12 @@ EXTRA_DIST = lxc
39 +
40 + if ENABLE_BASH
41 + install-bash:
42 +- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/bash_completion.d/
43 +- $(INSTALL_DATA) lxc $(DESTDIR)$(sysconfdir)/bash_completion.d/
44 ++ $(MKDIR_P) $(DESTDIR)$(datarootdir)/bash-completion/completions/
45 ++ $(INSTALL_DATA) lxc $(DESTDIR)$(datarootdir)/bash-completion/completions/
46 +
47 + uninstall-bash:
48 +- rm -f $(DESTDIR)$(sysconfdir)/bash_completion.d/lxc
49 +- rmdir $(DESTDIR)$(sysconfdir)/bash_completion.d/ || :
50 ++ rm -f $(DESTDIR)$(datarootdir)/bash-completion/completions/lxc
51 ++ rmdir $(DESTDIR)$(datarootdir)/bash-completion// || :
52 +
53 + install-data-local: install-bash
54 + uninstall-local: uninstall-bash
55 +Index: lxc-lxc-1.0.8/config/bash/lxc.in
56 +===================================================================
57 +--- lxc-lxc-1.0.8.orig/config/bash/lxc.in
58 ++++ lxc-lxc-1.0.8/config/bash/lxc.in
59 +@@ -1,4 +1,3 @@
60 +-have lxc-start && {
61 + _lxc_names() {
62 + COMPREPLY=( $( compgen -W "$( lxc-ls )" "$cur" ) )
63 + }
64 +@@ -100,4 +99,3 @@ have lxc-start && {
65 +
66 + complete -o default -F _lxc_generic_o lxc-clone
67 + complete -o default -F _lxc_generic_o lxc-start-ephemeral
68 +-}
69
70 diff --git a/app-emulation/lxc/lxc-1.0.8.ebuild b/app-emulation/lxc/lxc-1.0.8.ebuild
71 new file mode 100644
72 index 00000000000..1c55e591610
73 --- /dev/null
74 +++ b/app-emulation/lxc/lxc-1.0.8.ebuild
75 @@ -0,0 +1,188 @@
76 +# Copyright 1999-2017 Gentoo Foundation
77 +# Distributed under the terms of the GNU General Public License v2
78 +
79 +EAPI="5"
80 +
81 +MY_P="${P/_/-}"
82 +PYTHON_COMPAT=( python3_4 )
83 +DISTUTILS_OPTIONAL=1
84 +
85 +inherit autotools bash-completion-r1 distutils-r1 eutils linux-info versionator flag-o-matic systemd
86 +
87 +DESCRIPTION="LinuX Containers userspace utilities"
88 +HOMEPAGE="https://linuxcontainers.org/"
89 +SRC_URI="https://github.com/lxc/lxc/archive/${MY_P}.tar.gz"
90 +
91 +KEYWORDS="amd64 ~arm ~arm64 ppc64 x86"
92 +
93 +LICENSE="LGPL-3"
94 +SLOT="0"
95 +IUSE="doc examples lua python seccomp"
96 +
97 +RDEPEND="net-libs/gnutls
98 + sys-libs/libcap
99 + lua? ( >=dev-lang/lua-5.1:= )
100 + python? ( ${PYTHON_DEPS} )
101 + seccomp? ( sys-libs/libseccomp )"
102 +
103 +DEPEND="${RDEPEND}
104 + doc? ( app-text/docbook-sgml-utils )
105 + >=sys-kernel/linux-headers-3.2"
106 +
107 +RDEPEND="${RDEPEND}
108 + sys-apps/util-linux
109 + app-misc/pax-utils
110 + virtual/awk"
111 +
112 +CONFIG_CHECK="~CGROUPS ~CGROUP_DEVICE
113 + ~CPUSETS ~CGROUP_CPUACCT
114 + ~RESOURCE_COUNTERS
115 + ~CGROUP_SCHED
116 +
117 + ~NAMESPACES
118 + ~IPC_NS ~USER_NS ~PID_NS
119 +
120 + ~DEVPTS_MULTIPLE_INSTANCES
121 + ~CGROUP_FREEZER
122 + ~UTS_NS ~NET_NS
123 + ~VETH ~MACVLAN
124 +
125 + ~POSIX_MQUEUE
126 + ~!NETPRIO_CGROUP
127 +
128 + ~!GRKERNSEC_CHROOT_MOUNT
129 + ~!GRKERNSEC_CHROOT_DOUBLE
130 + ~!GRKERNSEC_CHROOT_PIVOT
131 + ~!GRKERNSEC_CHROOT_CHMOD
132 + ~!GRKERNSEC_CHROOT_CAPS
133 + ~!GRKERNSEC_PROC
134 +"
135 +
136 +ERROR_DEVPTS_MULTIPLE_INSTANCES="CONFIG_DEVPTS_MULTIPLE_INSTANCES: needed for pts inside container"
137 +
138 +ERROR_CGROUP_FREEZER="CONFIG_CGROUP_FREEZER: needed to freeze containers"
139 +
140 +ERROR_UTS_NS="CONFIG_UTS_NS: needed to unshare hostnames and uname info"
141 +ERROR_NET_NS="CONFIG_NET_NS: needed for unshared network"
142 +
143 +ERROR_VETH="CONFIG_VETH: needed for internal (host-to-container) networking"
144 +ERROR_MACVLAN="CONFIG_MACVLAN: needed for internal (inter-container) networking"
145 +
146 +ERROR_POSIX_MQUEUE="CONFIG_POSIX_MQUEUE: needed for lxc-execute command"
147 +
148 +ERROR_NETPRIO_CGROUP="CONFIG_NETPRIO_CGROUP: as of kernel 3.3 and lxc 0.8.0_rc1 this causes LXCs to fail booting."
149 +
150 +ERROR_GRKERNSEC_CHROOT_MOUNT=":CONFIG_GRKERNSEC_CHROOT_MOUNT some GRSEC features make LXC unusable see postinst notes"
151 +ERROR_GRKERNSEC_CHROOT_DOUBLE=":CONFIG_GRKERNSEC_CHROOT_DOUBLE some GRSEC features make LXC unusable see postinst notes"
152 +ERROR_GRKERNSEC_CHROOT_PIVOT=":CONFIG_GRKERNSEC_CHROOT_PIVOT some GRSEC features make LXC unusable see postinst notes"
153 +ERROR_GRKERNSEC_CHROOT_CHMOD=":CONFIG_GRKERNSEC_CHROOT_CHMOD some GRSEC features make LXC unusable see postinst notes"
154 +ERROR_GRKERNSEC_CHROOT_CAPS=":CONFIG_GRKERNSEC_CHROOT_CAPS some GRSEC features make LXC unusable see postinst notes"
155 +ERROR_GRKERNSEC_PROC=":CONFIG_GRKERNSEC_PROC: this GRSEC feature is incompatible with unprivileged containers"
156 +
157 +DOCS=(AUTHORS CONTRIBUTING MAINTAINERS NEWS README doc/FAQ.txt)
158 +
159 +S="${WORKDIR}/${PN}-${MY_P}"
160 +
161 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
162 +
163 +src_prepare() {
164 + sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac || die
165 + if [[ -n ${BACKPORTS} ]]; then
166 + epatch "${WORKDIR}"/patches/*
167 + fi
168 +
169 + epatch "${FILESDIR}"/${PN}-1.0.8-bash-completion.patch
170 +
171 + eautoreconf
172 +}
173 +
174 +src_configure() {
175 + append-flags -fno-strict-aliasing
176 +
177 + econf \
178 + --localstatedir=/var \
179 + --bindir=/usr/sbin \
180 + --docdir=/usr/share/doc/${PF} \
181 + --with-config-path=/etc/lxc \
182 + --with-rootfs-path=/usr/lib/lxc/rootfs \
183 + --with-distro=gentoo \
184 + $(use_enable doc) \
185 + --disable-apparmor \
186 + $(use_enable examples) \
187 + $(use_enable lua) \
188 + $(use_enable seccomp) \
189 + --disable-python
190 +}
191 +
192 +python_compile() {
193 + distutils-r1_python_compile build_ext -I ../ -L ../${PN}
194 +}
195 +
196 +src_compile() {
197 + default
198 +
199 + if use python; then
200 + pushd "${S}/src/python-${PN}" > /dev/null
201 + distutils-r1_src_compile
202 + popd > /dev/null
203 + fi
204 +}
205 +
206 +src_install() {
207 + default
208 +
209 + mv "${ED}"/usr/share/bash-completion/completions/${PN} "${ED}"/$(get_bashcompdir)/${PN}-start || die
210 + bashcomp_alias ${PN}-start \
211 + ${PN}-{attach,cgroup,clone,console,create,destroy,device,execute,freeze,info,monitor,snapshot,start-ephemeral,stop,unfreeze,wait}
212 +
213 + if use python; then
214 + pushd "${S}/src/python-lxc" > /dev/null
215 + # Unset DOCS. This has been handled by the default target
216 + unset DOCS
217 + distutils-r1_src_install
218 + popd > /dev/null
219 + fi
220 +
221 + keepdir /etc/lxc /usr/lib/lxc/rootfs /var/log/lxc
222 +
223 + find "${D}" -name '*.la' -delete
224 +
225 + # Gentoo-specific additions!
226 + # Use initd.3 per #517144
227 + newinitd "${FILESDIR}/${PN}.initd.3" ${PN}
228 +
229 + # lxc-devsetup script
230 + exeinto /usr/libexec/${PN}
231 + doexe config/init/systemd/${PN}-devsetup
232 + # Use that script with the systemd service (Similar to upstream
233 + # Makefile.am
234 + cp "${FILESDIR}"/${PN}_at.service ${PN}_at.service || die
235 + sed -i \
236 + "/Restart=always/a ExecStartPre=/usr/libexec/${PN}/${PN}-devsetup" \
237 + ${PN}_at.service \
238 + || die "Failed to add ${PN}-devsetup to the systemd service file"
239 + systemd_newunit ${PN}_at.service "lxc@.service"
240 +}
241 +
242 +pkg_postinst() {
243 + elog "There is an init script provided with the package now; no documentation"
244 + elog "is currently available though, so please check out /etc/init.d/lxc ."
245 + elog "You _should_ only need to symlink it to /etc/init.d/lxc.configname"
246 + elog "to start the container defined into /etc/lxc/configname.conf ."
247 + elog "For further information about LXC development see"
248 + elog "http://blog.flameeyes.eu/tag/lxc" # remove once proper doc is available
249 + elog ""
250 + ewarn "With version 0.7.4, the mountpoint syntax came back to the one used by 0.7.2"
251 + ewarn "and previous versions. This means you'll have to use syntax like the following"
252 + ewarn ""
253 + ewarn " lxc.rootfs = /container"
254 + ewarn " lxc.mount.entry = /usr/portage /container/usr/portage none bind 0 0"
255 + ewarn ""
256 + ewarn "To use the Fedora, Debian and (various) Ubuntu auto-configuration scripts, you"
257 + ewarn "will need sys-apps/yum or dev-util/debootstrap."
258 + ewarn ""
259 + ewarn "Some GrSecurity settings in relation to chroot security will cause LXC not to"
260 + ewarn "work, while others will actually make it much more secure. Please refer to"
261 + ewarn "Diego Elio Pettenò's weblog at http://blog.flameeyes.eu/tag/lxc for further"
262 + ewarn "details."
263 +}