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