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