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, 03 Jul 2018 07:44:38
Message-Id: 1530603858.17f8a0970b46f907019f3a200336f8d7f745dfd0.tamiko@gentoo
1 commit: 17f8a0970b46f907019f3a200336f8d7f745dfd0
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jul 3 07:03:29 2018 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Tue Jul 3 07:44:18 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17f8a097
7
8 app-emulation/libvirt: version bump to 4.5.0
9
10 Package-Manager: Portage-2.3.41, Repoman-2.3.9
11
12 app-emulation/libvirt/Manifest | 1 +
13 app-emulation/libvirt/libvirt-4.5.0.ebuild | 379 +++++++++++++++++++++++++++++
14 2 files changed, 380 insertions(+)
15
16 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
17 index 2733e11b04b..62bc9fc3cb1 100644
18 --- a/app-emulation/libvirt/Manifest
19 +++ b/app-emulation/libvirt/Manifest
20 @@ -1,2 +1,3 @@
21 DIST libvirt-4.3.0.tar.xz 14667860 BLAKE2B bd4dfbcfba3b11036be979caf938ec7ca4fc04cc4bd6dfd5eec05c054ba4ebf953c0e86a080e65ab8a880f2bcc2f4d018283e870afcb64bd0b750247f3c96357 SHA512 cc61497121931019a8cc3fa8234d7cf95b0f0e1d77ab6fcd089db92759617b099eb83c57aa91768ae6ccf92c345cf72e1d9b202acb5132a159476fb86f1a6999
22 DIST libvirt-4.4.0.tar.xz 14668912 BLAKE2B 04f7a48618924bb8bbe1621572d260a01626687c66ed45d1a08d745210fc522fba63387a0433c0c55e41a5655267c094c16b7ff97f9e45b17419dfc83f465c79 SHA512 725b9b093a2aaeab6fdcb8df341a400ab363bcd50af8400dfd0593c41d8fbc8352f89147be9fbfde2e8418cc7298e090fe07ec7255b0aff1f0d001b93322f93f
23 +DIST libvirt-4.5.0.tar.xz 14743956 BLAKE2B 930852765104b1b22744df0ec4f1c74d89bc0fda80852978f7c857943858cc45eed9b74a3d42668f872540be2637f26c4d9d7859594847e58e6fb4cd33350130 SHA512 26710c7e5219f007524e9f93a642e55e4e8ea197afa6b2ca6a4b67b7028313f4b0d82924ee9a1e91ff688a4d2b53f89f3655fbeef0fa99a34f8418f37d787984
24
25 diff --git a/app-emulation/libvirt/libvirt-4.5.0.ebuild b/app-emulation/libvirt/libvirt-4.5.0.ebuild
26 new file mode 100644
27 index 00000000000..f1aeb95caa8
28 --- /dev/null
29 +++ b/app-emulation/libvirt/libvirt-4.5.0.ebuild
30 @@ -0,0 +1,379 @@
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 bash-completion-r1
37 +
38 +if [[ ${PV} = *9999* ]]; then
39 + inherit git-r3
40 + EGIT_REPO_URI="https://libvirt.org/git/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:=[api,hvm]
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}-4.5.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 +)
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 xenapi)
306 + $(use_with xen libxl)
307 + $(use_with zeroconf avahi)
308 + $(use_with zfs storage-zfs)
309 +
310 + --without-hal
311 + --without-netcf
312 + --without-sanlock
313 +
314 + --with-esx
315 + --with-init-script=systemd
316 + --with-qemu-group=$(usex caps qemu root)
317 + --with-qemu-user=$(usex caps qemu root)
318 + --with-remote
319 + --with-storage-fs
320 + --with-vmware
321 +
322 + --disable-static
323 + --disable-werror
324 +
325 + --with-html-subdir=${PF}/html
326 + --localstatedir=/var
327 + )
328 +
329 + if use virtualbox && has_version app-emulation/virtualbox-ose; then
330 + myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
331 + else
332 + myeconfargs+=( $(use_with virtualbox vbox) )
333 + fi
334 +
335 + econf "${myeconfargs[@]}"
336 +
337 + if [[ ${PV} = *9999* ]]; then
338 + # Restore gnulib's config.sub and config.guess
339 + # bug #377279
340 + (cd .gnulib && git reset --hard > /dev/null)
341 + fi
342 +}
343 +
344 +src_test() {
345 + cd "${BUILD_DIR}"
346 +
347 + # remove problematic tests, bug #591416, bug #591418
348 + sed -i -e 's#commandtest$(EXEEXT) # #' \
349 + -e 's#virfirewalltest$(EXEEXT) # #' \
350 + -e 's#nwfilterebiptablestest$(EXEEXT) # #' \
351 + -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \
352 + tests/Makefile
353 +
354 + export VIR_TEST_DEBUG=1
355 + HOME="${T}" emake check || die "tests failed"
356 +}
357 +
358 +src_install() {
359 + emake DESTDIR="${D}" \
360 + SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install
361 +
362 + find "${D}" -name '*.la' -delete || die
363 +
364 + # Remove bogus, empty directories. They are either not used, or
365 + # libvirtd is able to create them on demand
366 + rm -rf "${D}"/etc/sysconfig
367 + rm -rf "${D}"/var
368 +
369 + use libvirtd || return 0
370 + # From here, only libvirtd-related instructions, be warned!
371 +
372 + systemd_install_serviced \
373 + "${FILESDIR}"/libvirtd.service.conf libvirtd.service
374 +
375 + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
376 +
377 + newinitd "${S}/libvirtd.init" libvirtd || die
378 + newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die
379 + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
380 + newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
381 +
382 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
383 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
384 +
385 + newbashcomp "${S}/tools/bash-completion/vsh" vsh
386 + bashcomp_alias vsh virsh virt-admin
387 +
388 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2")
389 + DISABLE_AUTOFORMATTING=true
390 + readme.gentoo_create_doc
391 +}
392 +
393 +pkg_preinst() {
394 + # we only ever want to generate this once
395 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
396 + rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
397 + fi
398 +}
399 +
400 +pkg_postinst() {
401 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
402 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
403 + fi
404 +
405 + use libvirtd || return 0
406 + # From here, only libvirtd-related instructions, be warned!
407 +
408 + readme.gentoo_print_elog
409 +}