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/, app-emulation/libvirt/files/
Date: Mon, 03 Feb 2020 03:07:32
Message-Id: 1580699236.a20edcb72406f0e07390c52ca17ac94665cafda0.tamiko@gentoo
1 commit: a20edcb72406f0e07390c52ca17ac94665cafda0
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 3 02:45:02 2020 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 3 03:07:16 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a20edcb7
7
8 app-emulation/libvirt: version bump to 6.0.0
9
10 Package-Manager: Portage-2.3.86, Repoman-2.3.20
11 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
12
13 app-emulation/libvirt/Manifest | 1 +
14 .../files/libvirt-6.0.0-do-not-use-sysconf.patch | 150 ++++++++
15 app-emulation/libvirt/libvirt-6.0.0.ebuild | 379 +++++++++++++++++++++
16 3 files changed, 530 insertions(+)
17
18 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
19 index 3a68bbb64c5..cf8fd919a80 100644
20 --- a/app-emulation/libvirt/Manifest
21 +++ b/app-emulation/libvirt/Manifest
22 @@ -3,3 +3,4 @@ DIST libvirt-5.2.0.tar.xz 14992888 BLAKE2B d68aedb634a70063a116e112689f252d3fc2f
23 DIST libvirt-5.5.0.tar.xz 12930224 BLAKE2B 4add0b727e4754bd1b2b4e9020942b17872533737e496ddf7976bf86a0fd3bcfbebd83387a8f3bab8dcc9afb05755b245e55682ed17d6094085d3dc96d94eefe SHA512 47923aaca605fb43a53238ac535abc1f88f73435336b8f3e88cb01df277ed205d99c586991e523aa32b50c832a0a7c949ab5f84dc78eb8d18a4951cfc791448d
24 DIST libvirt-5.6.0.tar.xz 13147976 BLAKE2B dbfc997123f43fcf9d635b59fffa00d96826e673c4037105151bde2c4a0fb3015a0e458e8e67969b5513a4ddbf41d062feb91e6a86054ddcc1d661f0554fd1f7 SHA512 95fe931394fb31288faf73349bb298f08f63cf062f851b9935303145f8166f69128be9360757f0e1845256c14f4d7672843dba0dc6c086b1c3c8bfc035cc8986
25 DIST libvirt-5.8.0.tar.xz 13129328 BLAKE2B ff49b0b6dca86f35c68edfb880677c88e0aed8021ed01ebd145922821914edd70c355ca777fe470e2b0e4baf36f2813c1100be9377344f81c9df374068307da1 SHA512 73d18fdf307b8029921a9f1a0c84ca31c50c662a3c0339e3850d6d2f31574168807a6f34943b286ed86a44031decbbc1339f27366da7269e29d38c7094503113
26 +DIST libvirt-6.0.0.tar.xz 8686092 BLAKE2B 669054aa3bb3e4f2cf0be2e9ea796b820786661f65495597322e178d7c7e42355b0e3752c8a847cb2fc4405928a30a00544829647aa84cc2e71bc0cb8ce9af5f SHA512 64259c0cffa9fc01192c5474f69d88a61ed0bae0a100379fed6112723a37eff1865ccfc85a19d6b8cd39ed504f04998bb3f6390aaafff797bb41ef65b6ec413c
27
28 diff --git a/app-emulation/libvirt/files/libvirt-6.0.0-do-not-use-sysconf.patch b/app-emulation/libvirt/files/libvirt-6.0.0-do-not-use-sysconf.patch
29 new file mode 100644
30 index 00000000000..738799533c6
31 --- /dev/null
32 +++ b/app-emulation/libvirt/files/libvirt-6.0.0-do-not-use-sysconf.patch
33 @@ -0,0 +1,150 @@
34 +diff --git a/src/Makefile.am b/src/Makefile.am
35 +index c9b5eeb..423a201 100644
36 +--- a/src/Makefile.am
37 ++++ b/src/Makefile.am
38 +@@ -533,23 +533,6 @@ EXTRA_DIST += \
39 + $(SYSCONF_FILES) \
40 + $(OPENRC_CONF_FILES)
41 +
42 +-install-sysconfig:
43 +- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
44 +- for f in $(SYSCONF_FILES:%.sysconf=%) ; \
45 +- do \
46 +- tgt=`basename $$f`; \
47 +- $(INSTALL_DATA) $(srcdir)/$$f.sysconf \
48 +- $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
49 +- done
50 +-
51 +-uninstall-sysconfig:
52 +- for f in $(SYSCONF_FILES:%.sysconf=%) ; \
53 +- do \
54 +- tgt=`basename $$f`; \
55 +- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/$$tgt; \
56 +- done
57 +- rmdir $(DESTDIR)$(sysconfdir)/sysconfig || :
58 +-
59 + OPENRC_CONF_DIR = $(sysconfdir)/conf.d
60 +
61 + install-openrc-conf:
62 +@@ -615,14 +598,14 @@ SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
63 + BUILT_SOURCES += $(SYSTEMD_UNIT_FILES)
64 + DISTCLEANFILES += $(SYSTEMD_UNIT_FILES)
65 +
66 +-install-systemd: $(SYSTEMD_UNIT_FILES) install-sysconfig
67 ++install-systemd: $(SYSTEMD_UNIT_FILES)
68 + $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
69 + for f in $(SYSTEMD_UNIT_FILES); \
70 + do \
71 + $(INSTALL_DATA) $$f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/ ; \
72 + done
73 +
74 +-uninstall-systemd: uninstall-sysconfig
75 ++uninstall-systemd:
76 + rm -f $(SYSTEMD_UNIT_FILES:%=$(DESTDIR)$(SYSTEMD_UNIT_DIR)/%)
77 + rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) || :
78 +
79 +diff --git a/src/locking/virtlockd.service.in b/src/locking/virtlockd.service.in
80 +index e7f8057..2449b20 100644
81 +--- a/src/locking/virtlockd.service.in
82 ++++ b/src/locking/virtlockd.service.in
83 +@@ -7,8 +7,7 @@ Documentation=man:virtlockd(8)
84 + Documentation=https://libvirt.org
85 +
86 + [Service]
87 +-EnvironmentFile=-@sysconfdir@/sysconfig/virtlockd
88 +-ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
89 ++ExecStart=@sbindir@/virtlockd
90 + ExecReload=/bin/kill -USR1 $MAINPID
91 + # Loosing the locks is a really bad thing that will
92 + # cause the machine to be fenced (rebooted), so make
93 +diff --git a/src/logging/virtlogd.service.in b/src/logging/virtlogd.service.in
94 +index daff48e..4373619 100644
95 +--- a/src/logging/virtlogd.service.in
96 ++++ b/src/logging/virtlogd.service.in
97 +@@ -7,8 +7,7 @@ Documentation=man:virtlogd(8)
98 + Documentation=https://libvirt.org
99 +
100 + [Service]
101 +-EnvironmentFile=-@sysconfdir@/sysconfig/virtlogd
102 +-ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
103 ++ExecStart=@sbindir@/virtlogd
104 + ExecReload=/bin/kill -USR1 $MAINPID
105 + # Loosing the logs is a really bad thing that will
106 + # cause the machine to be fenced (rebooted), so make
107 +diff --git a/src/remote/libvirtd.service.in b/src/remote/libvirtd.service.in
108 +index 9c8c54a..a042280 100644
109 +--- a/src/remote/libvirtd.service.in
110 ++++ b/src/remote/libvirtd.service.in
111 +@@ -25,8 +25,7 @@ Documentation=https://libvirt.org
112 +
113 + [Service]
114 + Type=notify
115 +-EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
116 +-ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
117 ++ExecStart=@sbindir@/libvirtd
118 + ExecReload=/bin/kill -HUP $MAINPID
119 + KillMode=process
120 + Restart=on-failure
121 +diff --git a/tools/Makefile.am b/tools/Makefile.am
122 +index 426a6ba..a65c91a 100644
123 +--- a/tools/Makefile.am
124 ++++ b/tools/Makefile.am
125 +@@ -297,15 +297,6 @@ install-data-local: install-systemd install-nss \
126 + uninstall-local: uninstall-systemd uninstall-nss \
127 + uninstall-bash-completion
128 +
129 +-install-sysconfig:
130 +- $(MKDIR_P) $(DESTDIR)$(sysconfdir)/sysconfig
131 +- $(INSTALL_DATA) $(srcdir)/libvirt-guests.sysconf \
132 +- $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
133 +-
134 +-uninstall-sysconfig:
135 +- rm -f $(DESTDIR)$(sysconfdir)/sysconfig/libvirt-guests
136 +- rmdir $(DESTDIR)$(sysconfdir)/sysconfig ||:
137 +-
138 + EXTRA_DIST += libvirt-guests.sh.in
139 +
140 + libvirt-guests.sh: libvirt-guests.sh.in $(top_builddir)/config.status
141 +@@ -325,12 +316,12 @@ EXTRA_DIST += libvirt-guests.service.in
142 + SYSTEMD_UNIT_DIR = $(prefix)/lib/systemd/system
143 +
144 + if LIBVIRT_INIT_SCRIPT_SYSTEMD
145 +-install-systemd: libvirt-guests.service install-sysconfig libvirt-guests.sh
146 ++install-systemd: libvirt-guests.service libvirt-guests.sh
147 + $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
148 + $(INSTALL_DATA) libvirt-guests.service \
149 + $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
150 +
151 +-uninstall-systemd: uninstall-sysconfig
152 ++uninstall-systemd:
153 + rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/libvirt-guests.service
154 + rmdir $(DESTDIR)$(SYSTEMD_UNIT_DIR) ||:
155 +
156 +diff --git a/tools/libvirt-guests.service.in b/tools/libvirt-guests.service.in
157 +index 10c6640..f0f417b 100644
158 +--- a/tools/libvirt-guests.service.in
159 ++++ b/tools/libvirt-guests.service.in
160 +@@ -10,7 +10,7 @@ Documentation=man:libvirtd(8)
161 + Documentation=https://libvirt.org
162 +
163 + [Service]
164 +-EnvironmentFile=-@sysconfdir@/sysconfig/libvirt-guests
165 ++EnvironmentFile=-/etc/libvirt/libvirt-guests.conf
166 + # Hack just call traditional service until we factor
167 + # out the code
168 + ExecStart=@libexecdir@/libvirt-guests.sh start
169 +diff --git a/tools/libvirt-guests.sysconf b/tools/libvirt-guests.sysconf
170 +index 669b046..45b0b9e 100644
171 +--- a/tools/libvirt-guests.sysconf
172 ++++ b/tools/libvirt-guests.sysconf
173 +@@ -1,3 +1,10 @@
174 ++#
175 ++# Warning: This configuration file is only sourced by the systemd
176 ++# libvirt-guests.service unit. The coresponding openrc facility is in
177 ++# /etc/init.d/libvirtd and /etc/conf.d/libvirtd
178 ++#
179 ++
180 ++
181 + # URIs to check for running guests
182 + # example: URIS='default xen:///system vbox+tcp://host/system lxc:///system'
183 + #URIS=default
184
185 diff --git a/app-emulation/libvirt/libvirt-6.0.0.ebuild b/app-emulation/libvirt/libvirt-6.0.0.ebuild
186 new file mode 100644
187 index 00000000000..49389592822
188 --- /dev/null
189 +++ b/app-emulation/libvirt/libvirt-6.0.0.ebuild
190 @@ -0,0 +1,379 @@
191 +# Copyright 1999-2020 Gentoo Authors
192 +# Distributed under the terms of the GNU General Public License v2
193 +
194 +EAPI=7
195 +
196 +PYTHON_COMPAT=( python3_{6,7} )
197 +
198 +inherit autotools out-of-source bash-completion-r1 eutils linux-info python-any-r1 readme.gentoo-r1 systemd
199 +
200 +if [[ ${PV} = *9999* ]]; then
201 + inherit git-r3
202 + EGIT_REPO_URI="https://libvirt.org/git/libvirt.git"
203 + SRC_URI=""
204 + KEYWORDS=""
205 + SLOT="0"
206 +else
207 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz"
208 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
209 + SLOT="0/${PV}"
210 +fi
211 +
212 +DESCRIPTION="C toolkit to manipulate virtual machines"
213 +HOMEPAGE="http://www.libvirt.org/"
214 +LICENSE="LGPL-2.1"
215 +IUSE="
216 + apparmor audit +caps +dbus dtrace firewalld fuse glusterfs iscsi
217 + iscsi-direct +libvirtd lvm libssh lxc +macvtap nfs nls numa openvz
218 + parted pcap phyp policykit +qemu rbd sasl selinux +udev +vepa
219 + virtualbox virt-network wireshark-plugins xen zfs
220 +"
221 +
222 +REQUIRED_USE="
223 + firewalld? ( virt-network )
224 + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
225 + lxc? ( caps libvirtd )
226 + openvz? ( libvirtd )
227 + policykit? ( dbus )
228 + qemu? ( libvirtd )
229 + vepa? ( macvtap )
230 + virt-network? ( libvirtd )
231 + virtualbox? ( libvirtd )
232 + xen? ( libvirtd )"
233 +
234 +# gettext.sh command is used by the libvirt command wrappers, and it's
235 +# non-optional, so put it into RDEPEND.
236 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
237 +# package will use 3 by default. Since we don't have slot pinning in an API,
238 +# we must go with the most recent
239 +RDEPEND="
240 + acct-user/qemu
241 + policykit? ( acct-group/libvirt )
242 + app-misc/scrub
243 + >=dev-libs/glib-2.48.0
244 + dev-libs/libgcrypt:0
245 + dev-libs/libnl:3
246 + >=dev-libs/libxml2-2.7.6
247 + >=net-analyzer/openbsd-netcat-1.105-r1
248 + >=net-libs/gnutls-1.0.25:0=
249 + net-libs/libssh2
250 + net-libs/libtirpc
251 + net-libs/rpcsvc-proto
252 + >=net-misc/curl-7.18.0
253 + sys-apps/dmidecode
254 + >=sys-apps/util-linux-2.17
255 + sys-devel/gettext
256 + sys-libs/ncurses:0=
257 + sys-libs/readline:=
258 + apparmor? ( sys-libs/libapparmor )
259 + audit? ( sys-process/audit )
260 + caps? ( sys-libs/libcap-ng )
261 + dbus? ( sys-apps/dbus )
262 + dtrace? ( dev-util/systemtap )
263 + firewalld? ( >=net-firewall/firewalld-0.6.3 )
264 + fuse? ( >=sys-fs/fuse-2.8.6:= )
265 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
266 + iscsi? ( sys-block/open-iscsi )
267 + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
268 + libssh? ( net-libs/libssh )
269 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
270 + lxc? ( !sys-apps/systemd[-cgroup-hybrid(+)] )
271 + nfs? ( net-fs/nfs-utils )
272 + numa? (
273 + >sys-process/numactl-2.0.2
274 + sys-process/numad
275 + )
276 + parted? (
277 + >=sys-block/parted-1.8[device-mapper]
278 + sys-fs/lvm2[-device-mapper-only(-)]
279 + )
280 + pcap? ( >=net-libs/libpcap-1.0.0 )
281 + policykit? ( >=sys-auth/polkit-0.9 )
282 + qemu? (
283 + >=app-emulation/qemu-1.5.0
284 + dev-libs/yajl
285 + )
286 + rbd? ( sys-cluster/ceph )
287 + sasl? ( dev-libs/cyrus-sasl )
288 + selinux? ( >=sys-libs/libselinux-2.0.85 )
289 + virt-network? (
290 + net-dns/dnsmasq[script]
291 + net-firewall/ebtables
292 + >=net-firewall/iptables-1.4.10[ipv6]
293 + net-misc/radvd
294 + sys-apps/iproute2[-minimal]
295 + )
296 + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
297 + wireshark-plugins? ( net-analyzer/wireshark:= )
298 + xen? (
299 + >=app-emulation/xen-4.6.0
300 + app-emulation/xen-tools:=
301 + )
302 + udev? (
303 + virtual/udev
304 + >=x11-libs/libpciaccess-0.10.9
305 + )
306 + zfs? ( sys-fs/zfs )"
307 +
308 +DEPEND="${RDEPEND}
309 + ${PYTHON_DEPS}
310 + app-text/xhtml1
311 + dev-lang/perl
312 + dev-libs/libxslt
313 + dev-perl/XML-XPath
314 + virtual/pkgconfig"
315 +
316 +PATCHES=(
317 + "${FILESDIR}"/${PN}-6.0.0-do-not-use-sysconf.patch
318 + "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch
319 + "${FILESDIR}"/${PN}-5.2.0-fix-paths-for-apparmor.patch
320 +)
321 +
322 +pkg_setup() {
323 + # Check kernel configuration:
324 + CONFIG_CHECK=""
325 + use fuse && CONFIG_CHECK+="
326 + ~FUSE_FS"
327 +
328 + use lvm && CONFIG_CHECK+="
329 + ~BLK_DEV_DM
330 + ~DM_MULTIPATH
331 + ~DM_SNAPSHOT"
332 +
333 + use lxc && CONFIG_CHECK+="
334 + ~BLK_CGROUP
335 + ~CGROUP_CPUACCT
336 + ~CGROUP_DEVICE
337 + ~CGROUP_FREEZER
338 + ~CGROUP_NET_PRIO
339 + ~CGROUP_PERF
340 + ~CGROUPS
341 + ~CGROUP_SCHED
342 + ~CPUSETS
343 + ~IPC_NS
344 + ~MACVLAN
345 + ~NAMESPACES
346 + ~NET_CLS_CGROUP
347 + ~NET_NS
348 + ~PID_NS
349 + ~POSIX_MQUEUE
350 + ~SECURITYFS
351 + ~USER_NS
352 + ~UTS_NS
353 + ~VETH
354 + ~!GRKERNSEC_CHROOT_MOUNT
355 + ~!GRKERNSEC_CHROOT_DOUBLE
356 + ~!GRKERNSEC_CHROOT_PIVOT
357 + ~!GRKERNSEC_CHROOT_CHMOD
358 + ~!GRKERNSEC_CHROOT_CAPS"
359 +
360 + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
361 + ~DEVPTS_MULTIPLE_INSTANCES"
362 +
363 + use macvtap && CONFIG_CHECK+="
364 + ~MACVTAP"
365 +
366 + use virt-network && CONFIG_CHECK+="
367 + ~BRIDGE_EBT_MARK_T
368 + ~BRIDGE_NF_EBTABLES
369 + ~NETFILTER_ADVANCED
370 + ~NETFILTER_XT_CONNMARK
371 + ~NETFILTER_XT_MARK
372 + ~NETFILTER_XT_TARGET_CHECKSUM
373 + ~IP_NF_FILTER
374 + ~IP_NF_MANGLE
375 + ~IP_NF_NAT
376 + ~IP_NF_TARGET_MASQUERADE
377 + ~IP6_NF_FILTER
378 + ~IP6_NF_MANGLE
379 + ~IP6_NF_NAT"
380 + # Bandwidth Limiting Support
381 + use virt-network && CONFIG_CHECK+="
382 + ~BRIDGE_EBT_T_NAT
383 + ~IP_NF_TARGET_REJECT
384 + ~NET_ACT_POLICE
385 + ~NET_CLS_FW
386 + ~NET_CLS_U32
387 + ~NET_SCH_HTB
388 + ~NET_SCH_INGRESS
389 + ~NET_SCH_SFQ"
390 +
391 + # Handle specific kernel versions for different features
392 + kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
393 + if kernel_is ge 3 6; then
394 + CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP "
395 + kernel_is lt 4 5 && CONFIG_CHECK+=" ~MEMCG_KMEM "
396 + fi
397 +
398 + ERROR_USER_NS="Optional depending on LXC configuration."
399 +
400 + if [[ -n ${CONFIG_CHECK} ]]; then
401 + linux-info_pkg_setup
402 + fi
403 +}
404 +
405 +src_prepare() {
406 + touch "${S}/.mailmap"
407 +
408 + default
409 +
410 + if [[ ${PV} = *9999* ]]; then
411 + # Reinitialize submodules as this is required for gnulib's bootstrap
412 + git submodule init
413 + # git checkouts require bootstrapping to create the configure script.
414 + # Additionally the submodules must be cloned to the right locations
415 + # bug #377279
416 + ./bootstrap || die "bootstrap failed"
417 + (
418 + git submodule status .gnulib | awk '{ print $1 }'
419 + git hash-object bootstrap.conf
420 + git ls-tree -d HEAD gnulib/local | awk '{ print $3 }'
421 + ) >.git-module-status
422 + fi
423 +
424 + # Tweak the init script:
425 + cp "${FILESDIR}/libvirtd.init-r18" "${S}/libvirtd.init" || die
426 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
427 + -i "${S}/libvirtd.init" || die "sed failed"
428 +
429 + eautoreconf
430 +}
431 +
432 +my_src_configure() {
433 + local myeconfargs=(
434 + $(use_with apparmor)
435 + $(use_with apparmor apparmor-profiles)
436 + $(use_with audit)
437 + $(use_with caps capng)
438 + $(use_with dbus)
439 + $(use_with dtrace)
440 + $(use_with firewalld)
441 + $(use_with fuse)
442 + $(use_with glusterfs)
443 + $(use_with glusterfs storage-gluster)
444 + $(use_with iscsi storage-iscsi)
445 + $(use_with iscsi-direct storage-iscsi-direct)
446 + $(use_with libvirtd)
447 + $(use_with libssh)
448 + $(use_with lvm storage-lvm)
449 + $(use_with lvm storage-mpath)
450 + $(use_with lxc)
451 + $(use_with macvtap)
452 + $(use_enable nls)
453 + $(use_with numa numactl)
454 + $(use_with numa numad)
455 + $(use_with openvz)
456 + $(use_with parted storage-disk)
457 + $(use_with pcap libpcap)
458 + $(use_with phyp)
459 + $(use_with policykit polkit)
460 + $(use_with qemu)
461 + $(use_with qemu yajl)
462 + $(use_with rbd storage-rbd)
463 + $(use_with sasl)
464 + $(use_with selinux)
465 + $(use_with udev)
466 + $(use_with vepa virtualport)
467 + $(use_with virt-network network)
468 + $(use_with wireshark-plugins wireshark-dissector)
469 + $(use_with xen libxl)
470 + $(use_with zfs storage-zfs)
471 +
472 + --without-hal
473 + --without-netcf
474 + --without-sanlock
475 +
476 + --with-esx
477 + --with-init-script=systemd
478 + --with-qemu-group=$(usex caps qemu root)
479 + --with-qemu-user=$(usex caps qemu root)
480 + --with-remote
481 + --with-storage-fs
482 + --with-vmware
483 +
484 + --disable-static
485 + --disable-werror
486 +
487 + --localstatedir=/var
488 + --enable-dependency-tracking
489 + )
490 +
491 + if use virtualbox && has_version app-emulation/virtualbox-ose; then
492 + myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
493 + else
494 + myeconfargs+=( $(use_with virtualbox vbox) )
495 + fi
496 +
497 + econf "${myeconfargs[@]}"
498 +
499 + if [[ ${PV} = *9999* ]]; then
500 + # Restore gnulib's config.sub and config.guess
501 + # bug #377279
502 + (cd ${S}/.gnulib && git reset --hard > /dev/null)
503 + fi
504 +}
505 +
506 +my_src_test() {
507 + # remove problematic tests, bug #591416, bug #591418
508 + sed -i -e 's#commandtest$(EXEEXT) # #' \
509 + -e 's#virfirewalltest$(EXEEXT) # #' \
510 + -e 's#nwfilterebiptablestest$(EXEEXT) # #' \
511 + -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \
512 + tests/Makefile
513 +
514 + export VIR_TEST_DEBUG=1
515 + HOME="${T}" emake check
516 +}
517 +
518 +my_src_install() {
519 + emake DESTDIR="${D}" \
520 + SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install
521 +
522 + find "${D}" -name '*.la' -delete || die
523 +
524 + # Remove bogus, empty directories. They are either not used, or
525 + # libvirtd is able to create them on demand
526 + rm -rf "${D}"/etc/sysconfig
527 + rm -rf "${D}"/var
528 +
529 + newbashcomp "${S}/tools/bash-completion/vsh" virsh
530 + bashcomp_alias virsh virt-admin
531 +
532 + use libvirtd || return 0
533 + # From here, only libvirtd-related instructions, be warned!
534 +
535 + systemd_install_serviced \
536 + "${FILESDIR}"/libvirtd.service.conf libvirtd.service
537 +
538 + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
539 +
540 + newinitd "${S}/libvirtd.init" libvirtd
541 + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
542 + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd
543 + newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd
544 +
545 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
546 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
547 +
548 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2")
549 + DISABLE_AUTOFORMATTING=true
550 + readme.gentoo_create_doc
551 +}
552 +
553 +pkg_preinst() {
554 + # we only ever want to generate this once
555 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
556 + rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
557 + fi
558 +}
559 +
560 +pkg_postinst() {
561 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
562 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
563 + fi
564 +
565 + use libvirtd || return 0
566 + # From here, only libvirtd-related instructions, be warned!
567 +
568 + readme.gentoo_print_elog
569 +}