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: Tue, 30 Jan 2018 17:55:08
Message-Id: 1517334895.a9cfe9a60acc51a566cdf1b3e3fc769f00cdedc3.tamiko@gentoo
1 commit: a9cfe9a60acc51a566cdf1b3e3fc769f00cdedc3
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 30 17:30:08 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 30 17:54:55 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9cfe9a6
7
8 app-emulation/libvirt: version bump to 4.0.0
9
10 Package-Manager: Portage-2.3.20, Repoman-2.3.6
11
12 app-emulation/libvirt/Manifest | 1 +
13 app-emulation/libvirt/libvirt-4.0.0.ebuild | 382 +++++++++++++++++++++++++++++
14 2 files changed, 383 insertions(+)
15
16 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
17 index 8dbd647bdfb..9ab7b8c8c46 100644
18 --- a/app-emulation/libvirt/Manifest
19 +++ b/app-emulation/libvirt/Manifest
20 @@ -1,2 +1,3 @@
21 DIST libvirt-3.10.0.tar.xz 14952220 BLAKE2B 6af2f4c07dc71d8aa283460640d3fdeccd78616d1678da1decf6b1702984ca0c685d8074963e55a2776ac834e18dbb61d86c20c6032320bf9aa6e02b480526dd SHA512 c2dfe0629bd90e8d7ae85f2a31dc027475c9614d497063fec6905aa2da4db68ce96e8f20d3290b0c0542b6ea31c85700b2727008bac65997ff0901b45f1b7260
22 DIST libvirt-3.8.0.tar.xz 14868712 BLAKE2B 4d97a03c3fe4eadb6d6eb3548231527c7d1a95e2134e63af63e72dcff8fd8d1cc8b5332f03d60edc2b200037ec0276b69a38c3379ce830a595bb5e83c3507e6f SHA512 fc48f29b493a5ec2b3586f6c5df0b8cb81f3f26be847bc42acfb6481d45970edc760dda0232ad57b95b8cf13382d0269dd3edf4a744040cda15b835d32d8c672
23 +DIST libvirt-4.0.0.tar.xz 15002248 BLAKE2B 066794909d02be04a7d70ebd5e6d423736fdaf95b7521edd47ef19f9bec4f16d6d3e64117356394ce5916761ad77d5afab84ace2f4828c1f97373d0053b6924b SHA512 c99ea305f427859eb070b5f0c43de48645a5c53a2aa8efc60f54f278ec3fa0b504307861309e1852f8d7bff4436afe00c859aac27691366a0c36c91341cea7a1
24
25 diff --git a/app-emulation/libvirt/libvirt-4.0.0.ebuild b/app-emulation/libvirt/libvirt-4.0.0.ebuild
26 new file mode 100644
27 index 00000000000..487691cdac3
28 --- /dev/null
29 +++ b/app-emulation/libvirt/libvirt-4.0.0.ebuild
30 @@ -0,0 +1,382 @@
31 +# Copyright 1999-2018 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-libs/libtirpc
92 + net-libs/rpcsvc-proto
93 + >=net-misc/curl-7.18.0
94 + sys-apps/dmidecode
95 + >=sys-apps/util-linux-2.17
96 + sys-devel/gettext
97 + sys-libs/ncurses:0=
98 + sys-libs/readline:=
99 + apparmor? ( sys-libs/libapparmor )
100 + audit? ( sys-process/audit )
101 + caps? ( sys-libs/libcap-ng )
102 + dbus? ( sys-apps/dbus )
103 + firewalld? ( net-firewall/firewalld )
104 + fuse? ( >=sys-fs/fuse-2.8.6:= )
105 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
106 + iscsi? ( sys-block/open-iscsi )
107 + libssh? ( net-libs/libssh )
108 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
109 + nfs? ( net-fs/nfs-utils )
110 + numa? (
111 + >sys-process/numactl-2.0.2
112 + sys-process/numad
113 + )
114 + parted? (
115 + >=sys-block/parted-1.8[device-mapper]
116 + sys-fs/lvm2[-device-mapper-only(-)]
117 + )
118 + pcap? ( >=net-libs/libpcap-1.0.0 )
119 + policykit? ( >=sys-auth/polkit-0.9 )
120 + qemu? (
121 + >=app-emulation/qemu-0.13.0
122 + dev-libs/yajl
123 + )
124 + rbd? ( sys-cluster/ceph )
125 + sasl? ( dev-libs/cyrus-sasl )
126 + selinux? ( >=sys-libs/libselinux-2.0.85 )
127 + virt-network? (
128 + net-dns/dnsmasq[script]
129 + net-firewall/ebtables
130 + >=net-firewall/iptables-1.4.10[ipv6]
131 + net-misc/radvd
132 + sys-apps/iproute2[-minimal]
133 + )
134 + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
135 + wireshark-plugins? ( net-analyzer/wireshark:= )
136 + xen? (
137 + app-emulation/xen
138 + app-emulation/xen-tools:=
139 + )
140 + udev? (
141 + virtual/udev
142 + >=x11-libs/libpciaccess-0.10.9
143 + )
144 + zeroconf? ( >=net-dns/avahi-0.6[dbus] )
145 + zfs? ( sys-fs/zfs )"
146 +
147 +DEPEND="${RDEPEND}
148 + app-text/xhtml1
149 + dev-lang/perl
150 + dev-libs/libxslt
151 + dev-perl/XML-XPath
152 + virtual/pkgconfig"
153 +
154 +PATCHES=(
155 + "${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch
156 + "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch
157 + "${FILESDIR}"/${PN}-3.10.0-r2-fix_paths_for_apparmor.patch
158 + "${FILESDIR}"/${PN}-1.3.4-glibc-2.23.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/cache
372 + rm -rf "${D}"/var/run
373 + rm -rf "${D}"/var/log
374 +
375 + use libvirtd || return 0
376 + # From here, only libvirtd-related instructions, be warned!
377 +
378 + systemd_install_serviced \
379 + "${FILESDIR}"/libvirtd.service.conf libvirtd.service
380 +
381 + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
382 +
383 + newinitd "${S}/libvirtd.init" libvirtd || die
384 + newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die
385 + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
386 + newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
387 +
388 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
389 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
390 +
391 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2")
392 + DISABLE_AUTOFORMATTING=true
393 + readme.gentoo_create_doc
394 +}
395 +
396 +pkg_preinst() {
397 + # we only ever want to generate this once
398 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
399 + rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
400 + fi
401 +}
402 +
403 +pkg_postinst() {
404 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
405 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
406 + fi
407 +
408 + use libvirtd || return 0
409 + # From here, only libvirtd-related instructions, be warned!
410 +
411 + readme.gentoo_print_elog
412 +}