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/libvirt/, app-emulation/libvirt/files/
Date: Wed, 26 Dec 2018 03:27:31
Message-Id: 1545794825.fa037df7c74c102d2b82689c4cfc0e804ee1ba8c.tamiko@gentoo
1 commit: fa037df7c74c102d2b82689c4cfc0e804ee1ba8c
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 26 03:03:36 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 26 03:27:05 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa037df7
7
8 app-emulation/libvirt: version bump to 4.10.0
9
10 * fix apparmor rules, bug #667434
11 * include netcat alternatives, bug #672992
12
13 Closes: https://bugs.gentoo.org/667434
14 Closes: https://bugs.gentoo.org/672992
15 Package-Manager: Portage-2.3.52, Repoman-2.3.12
16 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
17
18 app-emulation/libvirt/Manifest | 1 +
19 .../files/libvirt-4.10.0-fix_apparmor_rules.patch | 14 +
20 app-emulation/libvirt/libvirt-4.10.0.ebuild | 387 +++++++++++++++++++++
21 3 files changed, 402 insertions(+)
22
23 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
24 index 645f72cfa58..19f7d33e671 100644
25 --- a/app-emulation/libvirt/Manifest
26 +++ b/app-emulation/libvirt/Manifest
27 @@ -1,2 +1,3 @@
28 +DIST libvirt-4.10.0.tar.xz 14841188 BLAKE2B b52f2ed1c4c65930339a6b6fc9e7b034c7661edc0defdd78642f305b97332c33247bfc552efc43aa75a8d360c0d721d1a58a22fa7a016e7cf14ee2219d70a762 SHA512 a4f97aed6299c7954518ab88738ab781cee0755bfd64094a44468f77f99cac5eb2bc74ecd6aec90177317606ebd073292f5b5d0056054d1d94973fa938589fbd
29 DIST libvirt-4.5.0.tar.xz 14743956 BLAKE2B 930852765104b1b22744df0ec4f1c74d89bc0fda80852978f7c857943858cc45eed9b74a3d42668f872540be2637f26c4d9d7859594847e58e6fb4cd33350130 SHA512 26710c7e5219f007524e9f93a642e55e4e8ea197afa6b2ca6a4b67b7028313f4b0d82924ee9a1e91ff688a4d2b53f89f3655fbeef0fa99a34f8418f37d787984
30 DIST libvirt-4.9.0.tar.xz 14744184 BLAKE2B 03ddefc8f505c8688ad506b81ea9b37ee085e4c9c429834c6b6f338981bfc3c6034a5455a79feca604fb36e658de766ee6104aeed690c682ae596d10eb5632a9 SHA512 3cfada940f9de6cc4b0504e089f41aa03d9986f0163344dd3b3ab8e6c4eb556a56996dc8f24bca913b036862c75b256628ea9ab7674ef0a57b87f47c58689e90
31
32 diff --git a/app-emulation/libvirt/files/libvirt-4.10.0-fix_apparmor_rules.patch b/app-emulation/libvirt/files/libvirt-4.10.0-fix_apparmor_rules.patch
33 new file mode 100644
34 index 00000000000..e561bf42451
35 --- /dev/null
36 +++ b/app-emulation/libvirt/files/libvirt-4.10.0-fix_apparmor_rules.patch
37 @@ -0,0 +1,14 @@
38 +diff --git a/examples/apparmor/usr.lib.libvirt.virt-aa-helper b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
39 +index de94368..5fbae27 100644
40 +--- a/examples/apparmor/usr.lib.libvirt.virt-aa-helper
41 ++++ b/examples/apparmor/usr.lib.libvirt.virt-aa-helper
42 +@@ -39,6 +39,9 @@ profile virt-aa-helper /usr/{lib,lib64}/libvirt/virt-aa-helper {
43 + /etc/apparmor.d/libvirt/* r,
44 + /etc/apparmor.d/libvirt/libvirt-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]*-[0-9a-f]* rw,
45 +
46 ++ # Gentoo specific path for uefi firmware
47 ++ /usr/share/edk2-ovmf/* r,
48 ++
49 + # for backingstore -- allow access to non-hidden files in @{HOME} as well
50 + # as storage pools
51 + audit deny @{HOME}/.* mrwkl,
52
53 diff --git a/app-emulation/libvirt/libvirt-4.10.0.ebuild b/app-emulation/libvirt/libvirt-4.10.0.ebuild
54 new file mode 100644
55 index 00000000000..4ee860eb76c
56 --- /dev/null
57 +++ b/app-emulation/libvirt/libvirt-4.10.0.ebuild
58 @@ -0,0 +1,387 @@
59 +# Copyright 1999-2018 Gentoo Authors
60 +# Distributed under the terms of the GNU General Public License v2
61 +
62 +EAPI=7
63 +
64 +PYTHON_COMPAT=( python3_{4,5,6,7} )
65 +
66 +inherit autotools bash-completion-r1 eutils linux-info python-any-r1 readme.gentoo-r1 systemd user
67 +
68 +if [[ ${PV} = *9999* ]]; then
69 + inherit git-r3
70 + EGIT_REPO_URI="https://libvirt.org/git/libvirt.git"
71 + SRC_URI=""
72 + KEYWORDS=""
73 + SLOT="0"
74 +else
75 + # Versions with 4 numbers are stable updates:
76 + if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
77 + SRC_URI="https://libvirt.org/sources/stable_updates/${P}.tar.xz"
78 + else
79 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz"
80 + fi
81 + KEYWORDS="~amd64 ~arm64 ~x86"
82 + SLOT="0/${PV}"
83 +fi
84 +
85 +DESCRIPTION="C toolkit to manipulate virtual machines"
86 +HOMEPAGE="http://www.libvirt.org/"
87 +LICENSE="LGPL-2.1"
88 +IUSE="
89 + apparmor audit +caps +dbus firewalld fuse glusterfs iscsi +libvirtd lvm
90 + libssh lxc +macvtap nfs nls numa openvz parted pcap phyp policykit
91 + +qemu rbd sasl selinux +udev uml +vepa virtualbox virt-network
92 + wireshark-plugins xen zeroconf zfs
93 +"
94 +
95 +REQUIRED_USE="
96 + firewalld? ( virt-network )
97 + libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
98 + lxc? ( caps libvirtd )
99 + openvz? ( libvirtd )
100 + policykit? ( dbus )
101 + qemu? ( libvirtd )
102 + uml? ( libvirtd )
103 + vepa? ( macvtap )
104 + virt-network? ( libvirtd )
105 + virtualbox? ( libvirtd )
106 + xen? ( libvirtd )"
107 +
108 +# gettext.sh command is used by the libvirt command wrappers, and it's
109 +# non-optional, so put it into RDEPEND.
110 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
111 +# package will use 3 by default. Since we don't have slot pinning in an API,
112 +# we must go with the most recent
113 +RDEPEND="
114 + app-misc/scrub
115 + dev-libs/libgcrypt:0
116 + dev-libs/libnl:3
117 + >=dev-libs/libxml2-2.7.6
118 + || (
119 + >=net-analyzer/gnu-netcat-0.7.1-r3
120 + >=net-analyzer/netcat-110-r9
121 + >=net-analyzer/netcat6-1.0-r2
122 + >=net-analyzer/openbsd-netcat-1.105-r1
123 + )
124 + >=net-libs/gnutls-1.0.25:0=
125 + net-libs/libssh2
126 + net-libs/libtirpc
127 + net-libs/rpcsvc-proto
128 + >=net-misc/curl-7.18.0
129 + sys-apps/dmidecode
130 + >=sys-apps/util-linux-2.17
131 + sys-devel/gettext
132 + sys-libs/ncurses:0=
133 + sys-libs/readline:=
134 + apparmor? ( sys-libs/libapparmor )
135 + audit? ( sys-process/audit )
136 + caps? ( sys-libs/libcap-ng )
137 + dbus? ( sys-apps/dbus )
138 + firewalld? ( net-firewall/firewalld )
139 + fuse? ( >=sys-fs/fuse-2.8.6:= )
140 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
141 + iscsi? ( sys-block/open-iscsi )
142 + libssh? ( net-libs/libssh )
143 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
144 + nfs? ( net-fs/nfs-utils )
145 + numa? (
146 + >sys-process/numactl-2.0.2
147 + sys-process/numad
148 + )
149 + parted? (
150 + >=sys-block/parted-1.8[device-mapper]
151 + sys-fs/lvm2[-device-mapper-only(-)]
152 + )
153 + pcap? ( >=net-libs/libpcap-1.0.0 )
154 + policykit? ( >=sys-auth/polkit-0.9 )
155 + qemu? (
156 + >=app-emulation/qemu-1.5.0
157 + dev-libs/yajl
158 + )
159 + rbd? ( sys-cluster/ceph )
160 + sasl? ( dev-libs/cyrus-sasl )
161 + selinux? ( >=sys-libs/libselinux-2.0.85 )
162 + virt-network? (
163 + net-dns/dnsmasq[script]
164 + net-firewall/ebtables
165 + >=net-firewall/iptables-1.4.10[ipv6]
166 + net-misc/radvd
167 + sys-apps/iproute2[-minimal]
168 + )
169 + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
170 + wireshark-plugins? ( net-analyzer/wireshark:= )
171 + xen? (
172 + >=app-emulation/xen-4.6.0
173 + app-emulation/xen-tools:=
174 + )
175 + udev? (
176 + virtual/udev
177 + >=x11-libs/libpciaccess-0.10.9
178 + )
179 + zeroconf? ( >=net-dns/avahi-0.6[dbus] )
180 + zfs? ( sys-fs/zfs )"
181 +
182 +DEPEND="${RDEPEND}
183 + ${PYTHON_DEPS}
184 + app-text/xhtml1
185 + dev-lang/perl
186 + dev-libs/libxslt
187 + dev-perl/XML-XPath
188 + virtual/pkgconfig"
189 +
190 +PATCHES=(
191 + "${FILESDIR}"/${PN}-4.5.0-do_not_use_sysconf.patch
192 + "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch
193 + "${FILESDIR}"/${PN}-4.10.0-fix_apparmor_rules.patch
194 +)
195 +
196 +pkg_setup() {
197 + if use qemu; then
198 + enewgroup qemu 77
199 + enewuser qemu 77 -1 -1 "qemu,kvm"
200 + fi
201 +
202 + use policykit && enewgroup libvirt
203 +
204 + # Check kernel configuration:
205 + CONFIG_CHECK=""
206 + use fuse && CONFIG_CHECK+="
207 + ~FUSE_FS"
208 +
209 + use lvm && CONFIG_CHECK+="
210 + ~BLK_DEV_DM
211 + ~DM_MULTIPATH
212 + ~DM_SNAPSHOT"
213 +
214 + use lxc && CONFIG_CHECK+="
215 + ~BLK_CGROUP
216 + ~CGROUP_CPUACCT
217 + ~CGROUP_DEVICE
218 + ~CGROUP_FREEZER
219 + ~CGROUP_NET_PRIO
220 + ~CGROUP_PERF
221 + ~CGROUPS
222 + ~CGROUP_SCHED
223 + ~CPUSETS
224 + ~IPC_NS
225 + ~MACVLAN
226 + ~NAMESPACES
227 + ~NET_CLS_CGROUP
228 + ~NET_NS
229 + ~PID_NS
230 + ~POSIX_MQUEUE
231 + ~SECURITYFS
232 + ~USER_NS
233 + ~UTS_NS
234 + ~VETH
235 + ~!GRKERNSEC_CHROOT_MOUNT
236 + ~!GRKERNSEC_CHROOT_DOUBLE
237 + ~!GRKERNSEC_CHROOT_PIVOT
238 + ~!GRKERNSEC_CHROOT_CHMOD
239 + ~!GRKERNSEC_CHROOT_CAPS"
240 +
241 + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
242 + ~DEVPTS_MULTIPLE_INSTANCES"
243 +
244 + use macvtap && CONFIG_CHECK+="
245 + ~MACVTAP"
246 +
247 + use virt-network && CONFIG_CHECK+="
248 + ~BRIDGE_EBT_MARK_T
249 + ~BRIDGE_NF_EBTABLES
250 + ~NETFILTER_ADVANCED
251 + ~NETFILTER_XT_CONNMARK
252 + ~NETFILTER_XT_MARK
253 + ~NETFILTER_XT_TARGET_CHECKSUM"
254 + # Bandwidth Limiting Support
255 + use virt-network && CONFIG_CHECK+="
256 + ~BRIDGE_EBT_T_NAT
257 + ~IP_NF_TARGET_REJECT
258 + ~NET_ACT_POLICE
259 + ~NET_CLS_FW
260 + ~NET_CLS_U32
261 + ~NET_SCH_HTB
262 + ~NET_SCH_INGRESS
263 + ~NET_SCH_SFQ"
264 +
265 + # Handle specific kernel versions for different features
266 + kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
267 + if kernel_is ge 3 6; then
268 + CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP "
269 + kernel_is lt 4 5 && CONFIG_CHECK+=" ~MEMCG_KMEM "
270 + fi
271 +
272 + ERROR_USER_NS="Optional depending on LXC configuration."
273 +
274 + if [[ -n ${CONFIG_CHECK} ]]; then
275 + linux-info_pkg_setup
276 + fi
277 +}
278 +
279 +src_prepare() {
280 + touch "${S}/.mailmap"
281 +
282 + default
283 +
284 + if [[ ${PV} = *9999* ]]; then
285 + # git checkouts require bootstrapping to create the configure script.
286 + # Additionally the submodules must be cloned to the right locations
287 + # bug #377279
288 + ./bootstrap || die "bootstrap failed"
289 + (
290 + git submodule status | sed 's/^[ +-]//;s/ .*//'
291 + git hash-object bootstrap.conf
292 + ) >.git-module-status
293 + fi
294 +
295 + # Tweak the init script:
296 + cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die
297 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
298 + -e "s/USE_FLAG_AVAHI/$(usex zeroconf 'use avahi-daemon' '')/" \
299 + -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \
300 + -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \
301 + -i "${S}/libvirtd.init" || die "sed failed"
302 +
303 + eautoreconf
304 +}
305 +
306 +src_configure() {
307 + local myeconfargs=(
308 + $(use_with apparmor)
309 + $(use_with apparmor apparmor-profiles)
310 + $(use_with audit)
311 + $(use_with caps capng)
312 + $(use_with dbus)
313 + $(use_with firewalld)
314 + $(use_with fuse)
315 + $(use_with glusterfs)
316 + $(use_with glusterfs storage-gluster)
317 + $(use_with iscsi storage-iscsi)
318 + $(use_with libvirtd)
319 + $(use_with libssh)
320 + $(use_with lvm storage-lvm)
321 + $(use_with lvm storage-mpath)
322 + $(use_with lxc)
323 + $(use_with macvtap)
324 + $(use_enable nls)
325 + $(use_with numa numactl)
326 + $(use_with numa numad)
327 + $(use_with openvz)
328 + $(use_with parted storage-disk)
329 + $(use_with pcap libpcap)
330 + $(use_with phyp)
331 + $(use_with policykit polkit)
332 + $(use_with qemu)
333 + $(use_with qemu yajl)
334 + $(use_with rbd storage-rbd)
335 + $(use_with sasl)
336 + $(use_with selinux)
337 + $(use_with udev)
338 + $(use_with uml)
339 + $(use_with vepa virtualport)
340 + $(use_with virt-network network)
341 + $(use_with wireshark-plugins wireshark-dissector)
342 + $(use_with xen libxl)
343 + $(use_with zeroconf avahi)
344 + $(use_with zfs storage-zfs)
345 +
346 + --without-hal
347 + --without-netcf
348 + --without-sanlock
349 +
350 + --with-esx
351 + --with-init-script=systemd
352 + --with-qemu-group=$(usex caps qemu root)
353 + --with-qemu-user=$(usex caps qemu root)
354 + --with-remote
355 + --with-storage-fs
356 + --with-vmware
357 +
358 + --disable-static
359 + --disable-werror
360 +
361 + --with-html-subdir=${PF}/html
362 + --localstatedir=/var
363 + )
364 +
365 + if use virtualbox && has_version app-emulation/virtualbox-ose; then
366 + myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
367 + else
368 + myeconfargs+=( $(use_with virtualbox vbox) )
369 + fi
370 +
371 + econf "${myeconfargs[@]}"
372 +
373 + if [[ ${PV} = *9999* ]]; then
374 + # Restore gnulib's config.sub and config.guess
375 + # bug #377279
376 + (cd .gnulib && git reset --hard > /dev/null)
377 + fi
378 +}
379 +
380 +src_test() {
381 + cd "${BUILD_DIR}"
382 +
383 + # remove problematic tests, bug #591416, bug #591418
384 + sed -i -e 's#commandtest$(EXEEXT) # #' \
385 + -e 's#virfirewalltest$(EXEEXT) # #' \
386 + -e 's#nwfilterebiptablestest$(EXEEXT) # #' \
387 + -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \
388 + tests/Makefile
389 +
390 + export VIR_TEST_DEBUG=1
391 + HOME="${T}" emake check || die "tests failed"
392 +}
393 +
394 +src_install() {
395 + emake DESTDIR="${D}" \
396 + SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install
397 +
398 + find "${D}" -name '*.la' -delete || die
399 +
400 + # Remove bogus, empty directories. They are either not used, or
401 + # libvirtd is able to create them on demand
402 + rm -rf "${D}"/etc/sysconfig
403 + rm -rf "${D}"/var
404 +
405 + use libvirtd || return 0
406 + # From here, only libvirtd-related instructions, be warned!
407 +
408 + systemd_install_serviced \
409 + "${FILESDIR}"/libvirtd.service.conf libvirtd.service
410 +
411 + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
412 +
413 + newinitd "${S}/libvirtd.init" libvirtd || die
414 + newinitd "${FILESDIR}/libvirt-guests.init-r3" libvirt-guests || die
415 + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
416 + newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
417 +
418 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
419 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
420 +
421 + newbashcomp "${S}/tools/bash-completion/vsh" vsh
422 + bashcomp_alias vsh virsh virt-admin
423 +
424 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2")
425 + DISABLE_AUTOFORMATTING=true
426 + readme.gentoo_create_doc
427 +}
428 +
429 +pkg_preinst() {
430 + # we only ever want to generate this once
431 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
432 + rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
433 + fi
434 +}
435 +
436 +pkg_postinst() {
437 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
438 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
439 + fi
440 +
441 + use libvirtd || return 0
442 + # From here, only libvirtd-related instructions, be warned!
443 +
444 + readme.gentoo_print_elog
445 +}