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