commit:     21b2340aff308620f996e7de4123908050f92fdd
Author:     Jonathan Davies <jpds <AT> protonmail <DOT> com>
AuthorDate: Sat Sep 26 22:10:34 2020 +0000
Commit:     Matthias Maier <tamiko <AT> gentoo <DOT> org>
CommitDate: Thu Oct  1 23:46:25 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21b2340a

app-emulation/libvirt: Version updated to 6.7.0.

Signed-off-by: Jonathan Davies <jpds <AT> protonmail.com>
Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>

 app-emulation/libvirt/Manifest                     |   1 +
 .../files/libvirt-6.7.0-do-not-use-sysconfig.patch | 169 ++++++++++
 .../libvirt/files/libvirt-6.7.0-doc-path.patch     |   9 +
 .../libvirt-6.7.0-fix-paths-for-apparmor.patch     |  26 ++
 app-emulation/libvirt/libvirt-6.7.0.ebuild         | 343 +++++++++++++++++++++
 5 files changed, 548 insertions(+)

diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
index efead371cab..8abb22472ab 100644
--- a/app-emulation/libvirt/Manifest
+++ b/app-emulation/libvirt/Manifest
@@ -1,2 +1,3 @@
 DIST libvirt-6.2.0.tar.xz 8307248 BLAKE2B 
9d449e041fc548a688f974d0801e625cf023ef0df49c40028e486e88fcf14181869e0dfd87f0eabcdd184df67dda5b5fbdc0c2375832f1534faff531779255dd
 SHA512 
96bef701fd73aef93d1490f0bc331901a0ff6250a4f36a3e4844f76cc262dc0ae4cce8686a603c2a9c575ce489d8d5ed1521ebd22b92aff8301efdb74dee91e4
 DIST libvirt-6.5.0.tar.xz 9407160 BLAKE2B 
592aace555a3b72311cb430784587180fa7dbf74f75509cd8373a046339b9c4c0707bf530dd2d06146d78a85f8af3dba5d0b146ecec180d3cc4d3bf78c19da61
 SHA512 
30a032270304b97945ff2c5087c72c2f5510634186f2eaf7c3d834a72cddcaec97bbe5ccc86802728a59f4c80b5bb54757400683df5f20175757cfe07ce67453
+DIST libvirt-6.7.0.tar.xz 8362140 BLAKE2B 
d0afe33fcdaab3cc0f2ea8c552e7550bcece018b049a3b58e5c05ee85b39e2b3ebf42fa1b70ddb1d2a541d1114b6b49734f23a889b3589397a30a672f27a3a56
 SHA512 
cabfb6aa65a3a1412b0111654ad3a7d0a6dfc63399a892c540ca39ab4e56f87626a067037e4480bb55418a371d2b5e9ac74862c92a3cdea69822ec3d158d769f

diff --git 
a/app-emulation/libvirt/files/libvirt-6.7.0-do-not-use-sysconfig.patch 
b/app-emulation/libvirt/files/libvirt-6.7.0-do-not-use-sysconfig.patch
new file mode 100644
index 00000000000..f3d2e3c3916
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-6.7.0-do-not-use-sysconfig.patch
@@ -0,0 +1,169 @@
+--- a/src/interface/virtinterfaced.service.in
++++ b/src/interface/virtinterfaced.service.in
+@@ -13,7 +13,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtinterfaced
+ ExecStart=@sbindir@/virtinterfaced $VIRTINTERFACED_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/libxl/virtxend.service.in
++++ b/src/libxl/virtxend.service.in
+@@ -17,7 +17,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtxend
+ ExecStart=@sbindir@/virtxend $VIRTXEND_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/locking/virtlockd.service.in
++++ b/src/locking/virtlockd.service.in
+@@ -7,8 +7,7 @@
+ Documentation=https://libvirt.org
+ 
+ [Service]
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtlockd
+-ExecStart=@sbindir@/virtlockd $VIRTLOCKD_ARGS
++ExecStart=@sbindir@/virtlockd
+ ExecReload=/bin/kill -USR1 $MAINPID
+ # Loosing the locks is a really bad thing that will
+ # cause the machine to be fenced (rebooted), so make
+--- a/src/logging/virtlogd.service.in
++++ b/src/logging/virtlogd.service.in
+@@ -7,8 +7,7 @@
+ Documentation=https://libvirt.org
+ 
+ [Service]
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtlogd
+-ExecStart=@sbindir@/virtlogd $VIRTLOGD_ARGS
++ExecStart=@sbindir@/virtlogd
+ ExecReload=/bin/kill -USR1 $MAINPID
+ # Loosing the logs is a really bad thing that will
+ # cause the machine to be fenced (rebooted), so make
+--- a/src/lxc/virtlxcd.service.in
++++ b/src/lxc/virtlxcd.service.in
+@@ -18,7 +18,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtlxcd
+ ExecStart=@sbindir@/virtlxcd $VIRTLXCD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ KillMode=process
+--- a/src/network/virtnetworkd.service.in
++++ b/src/network/virtnetworkd.service.in
+@@ -16,7 +16,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtnetworkd
+ ExecStart=@sbindir@/virtnetworkd $VIRTNETWORKD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/node_device/virtnodedevd.service.in
++++ b/src/node_device/virtnodedevd.service.in
+@@ -13,7 +13,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtnodedevd
+ ExecStart=@sbindir@/virtnodedevd $VIRTNODEDEVD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/nwfilter/virtnwfilterd.service.in
++++ b/src/nwfilter/virtnwfilterd.service.in
+@@ -13,7 +13,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtnwfilterd
+ ExecStart=@sbindir@/virtnwfilterd $VIRTNWFILTERD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/qemu/virtqemud.service.in
++++ b/src/qemu/virtqemud.service.in
+@@ -18,7 +18,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtqemud
+ ExecStart=@sbindir@/virtqemud $VIRTQEMUD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ KillMode=process
+--- a/src/remote/libvirtd.service.in
++++ b/src/remote/libvirtd.service.in
+@@ -28,8 +28,7 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/libvirtd
+-ExecStart=@sbindir@/libvirtd $LIBVIRTD_ARGS
++ExecStart=@sbindir@/libvirtd
+ ExecReload=/bin/kill -HUP $MAINPID
+ KillMode=process
+ Restart=on-failure
+--- a/src/remote/virtproxyd.service.in
++++ b/src/remote/virtproxyd.service.in
+@@ -13,7 +13,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtproxyd
+ ExecStart=@sbindir@/virtproxyd $VIRTPROXYD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/secret/virtsecretd.service.in
++++ b/src/secret/virtsecretd.service.in
+@@ -13,7 +13,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtsecretd
+ ExecStart=@sbindir@/virtsecretd $VIRTSECRETD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/storage/virtstoraged.service.in
++++ b/src/storage/virtstoraged.service.in
+@@ -15,7 +15,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtstoraged
+ ExecStart=@sbindir@/virtstoraged $VIRTSTORAGED_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/src/vbox/virtvboxd.service.in
++++ b/src/vbox/virtvboxd.service.in
+@@ -14,7 +14,6 @@
+ 
+ [Service]
+ Type=notify
+-EnvironmentFile=-@sysconfdir@/sysconfig/virtvboxd
+ ExecStart=@sbindir@/virtvboxd $VIRTVBOXD_ARGS
+ ExecReload=/bin/kill -HUP $MAINPID
+ Restart=on-failure
+--- a/tools/libvirt-guests.service.in
++++ b/tools/libvirt-guests.service.in
+@@ -10,7 +10,7 @@
+ Documentation=https://libvirt.org
+ 
+ [Service]
+-EnvironmentFile=-@sysconfdir@/sysconfig/libvirt-guests
++EnvironmentFile=-/etc/libvirt/libvirt-guests.conf
+ # Hack just call traditional service until we factor
+ # out the code
+ ExecStart=@libexecdir@/libvirt-guests.sh start
+--- a/tools/libvirt-guests.sysconf
++++ b/tools/libvirt-guests.sysconf
+@@ -1,3 +1,9 @@
++#
++# Warning: This configuration file is only sourced by the systemd
++# libvirt-guests.service unit. The coresponding openrc facility is in
++# /etc/init.d/libvirtd and /etc/conf.d/libvirtd
++#
++
+ # Customizations for the libvirt-guests.service systemd unit
+ 
+ # URIs to check for running guests

diff --git a/app-emulation/libvirt/files/libvirt-6.7.0-doc-path.patch 
b/app-emulation/libvirt/files/libvirt-6.7.0-doc-path.patch
new file mode 100644
index 00000000000..65eb35f3e34
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-6.7.0-doc-path.patch
@@ -0,0 +1,9 @@
+--- a/meson.build       2020-09-26 21:25:08.557345415 +0000
++++ b/meson.build       2020-09-26 21:25:59.507348156 +0000
+@@ -84,7 +84,7 @@ sbindir = prefix / get_option('sbindir')
+ sharedstatedir = prefix / get_option('sharedstatedir')
+ 
+ confdir = sysconfdir / meson.project_name()
+-docdir = datadir / 'doc' / meson.project_name()
++docdir = datadir / 'doc' / '@0@-@1@'.format(meson.project_name(), 
meson.project_version())
+ pkgdatadir = datadir / meson.project_name()

diff --git 
a/app-emulation/libvirt/files/libvirt-6.7.0-fix-paths-for-apparmor.patch 
b/app-emulation/libvirt/files/libvirt-6.7.0-fix-paths-for-apparmor.patch
new file mode 100644
index 00000000000..1ca70030062
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirt-6.7.0-fix-paths-for-apparmor.patch
@@ -0,0 +1,26 @@
+diff --git a/src/security/apparmor/libvirt-qemu 
b/src/security/apparmor/libvirt-qemu
+index 80986ae..d550d8c 100644
+--- a/src/security/apparmor/libvirt-qemu
++++ b/src/security/apparmor/libvirt-qemu
+@@ -88,6 +88,7 @@
+   /usr/share/sgabios/** r,
+   /usr/share/slof/** r,
+   /usr/share/vgabios/** r,
++  /usr/share/seavgabios/** r,
+ 
+   # pki for libvirt-vnc and libvirt-spice (LP: #901272, #1690140)
+   /etc/pki/CA/ r,
+diff --git a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in 
b/src/security/apparmor/usr.libexec.virt-aa-helper.in
+similarity index 97%
+rename from src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in
+rename to src/security/apparmor/usr.libexec.virt-aa-helper.in
+index dd18c8a..d06f9cb 100644
+--- a/src/security/apparmor/usr.lib.libvirt.virt-aa-helper.in
++++ b/src/security/apparmor/usr.libexec.virt-aa-helper.in
+@@ -69,5 +69,5 @@ profile virt-aa-helper @libexecdir@/virt-aa-helper {
+   /**.[iI][sS][oO] r,
+   /**/disk{,.*} r,
+ 
+-  #include <local/usr.lib.libvirt.virt-aa-helper>
++  #include <local/usr.libexec.virt-aa-helper>
+ }

diff --git a/app-emulation/libvirt/libvirt-6.7.0.ebuild 
b/app-emulation/libvirt/libvirt-6.7.0.ebuild
new file mode 100644
index 00000000000..8b439d1e9b0
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-6.7.0.ebuild
@@ -0,0 +1,343 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6,7,8,9} )
+
+inherit meson bash-completion-r1 eutils linux-info python-any-r1 
readme.gentoo-r1 systemd
+
+if [[ ${PV} = *9999* ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git";
+       SRC_URI=""
+       SLOT="0"
+else
+       SRC_URI="https://libvirt.org/sources/${P}.tar.xz";
+       KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
+       SLOT="0/${PV}"
+fi
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="https://www.libvirt.org/";
+LICENSE="LGPL-2.1"
+IUSE="
+       apparmor audit +caps +dbus dtrace firewalld fuse glusterfs iscsi
+       iscsi-direct +libvirtd lvm libssh lxc +macvtap nfs nls numa openvz
+       parted pcap policykit +qemu rbd sasl selinux +udev +vepa
+       virtualbox virt-network wireshark-plugins xen zfs
+"
+
+REQUIRED_USE="
+       firewalld? ( virt-network )
+       libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
+       lxc? ( caps libvirtd )
+       openvz? ( libvirtd )
+       policykit? ( dbus )
+       qemu? ( libvirtd )
+       vepa? ( macvtap )
+       virt-network? ( libvirtd )
+       virtualbox? ( libvirtd )
+       xen? ( libvirtd )"
+
+# gettext.sh command is used by the libvirt command wrappers, and it's
+# non-optional, so put it into RDEPEND.
+# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
+# package will use 3 by default. Since we don't have slot pinning in an API,
+# we must go with the most recent
+RDEPEND="
+       acct-user/qemu
+       policykit? ( acct-group/libvirt )
+       app-misc/scrub
+       >=dev-libs/glib-2.48.0
+       dev-libs/libgcrypt:0
+       dev-libs/libnl:3
+       >=dev-libs/libxml2-2.7.6
+       >=net-analyzer/openbsd-netcat-1.105-r1
+       >=net-libs/gnutls-1.0.25:0=
+       net-libs/libssh2
+       net-libs/libtirpc
+       net-libs/rpcsvc-proto
+       >=net-misc/curl-7.18.0
+       sys-apps/dmidecode
+       >=sys-apps/util-linux-2.17
+       sys-devel/gettext
+       sys-libs/ncurses:0=
+       sys-libs/readline:=
+       apparmor? ( sys-libs/libapparmor )
+       audit? ( sys-process/audit )
+       caps? ( sys-libs/libcap-ng )
+       dbus? ( sys-apps/dbus )
+       dtrace? ( dev-util/systemtap )
+       firewalld? ( >=net-firewall/firewalld-0.6.3 )
+       fuse? ( sys-fs/fuse:0= )
+       glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
+       iscsi? ( sys-block/open-iscsi )
+       iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
+       libssh? ( net-libs/libssh )
+       lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
+       nfs? ( net-fs/nfs-utils )
+       numa? (
+               >sys-process/numactl-2.0.2
+               sys-process/numad
+       )
+       parted? (
+               >=sys-block/parted-1.8[device-mapper]
+               sys-fs/lvm2[-device-mapper-only(-)]
+       )
+       pcap? ( >=net-libs/libpcap-1.0.0 )
+       policykit? ( >=sys-auth/polkit-0.9 )
+       qemu? (
+               >=app-emulation/qemu-1.5.0
+               dev-libs/yajl
+       )
+       rbd? ( sys-cluster/ceph )
+       sasl? ( dev-libs/cyrus-sasl )
+       selinux? ( >=sys-libs/libselinux-2.0.85 )
+       virt-network? (
+               net-dns/dnsmasq[script]
+               net-firewall/ebtables
+               >=net-firewall/iptables-1.4.10[ipv6]
+               net-misc/radvd
+               sys-apps/iproute2[-minimal]
+       )
+       virtualbox? ( || ( app-emulation/virtualbox 
>=app-emulation/virtualbox-bin-2.2.0 ) )
+       wireshark-plugins? ( net-analyzer/wireshark:= )
+       xen? (
+               >=app-emulation/xen-4.6.0
+               app-emulation/xen-tools:=
+       )
+       udev? (
+               virtual/udev
+               >=x11-libs/libpciaccess-0.10.9
+       )
+       zfs? ( sys-fs/zfs )"
+
+DEPEND="${RDEPEND}
+       ${PYTHON_DEPS}
+       app-text/xhtml1
+       dev-lang/perl
+       dev-libs/libxslt
+       dev-perl/XML-XPath
+       dev-python/docutils
+       virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
+       "${FILESDIR}"/${PN}-6.7.0-do-not-use-sysconfig.patch
+       "${FILESDIR}"/${PN}-6.7.0-doc-path.patch
+       "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
+)
+
+pkg_setup() {
+       # Check kernel configuration:
+       CONFIG_CHECK=""
+       use fuse && CONFIG_CHECK+="
+               ~FUSE_FS"
+
+       use lvm && CONFIG_CHECK+="
+               ~BLK_DEV_DM
+               ~DM_MULTIPATH
+               ~DM_SNAPSHOT"
+
+       use lxc && CONFIG_CHECK+="
+               ~BLK_CGROUP
+               ~CGROUP_CPUACCT
+               ~CGROUP_DEVICE
+               ~CGROUP_FREEZER
+               ~CGROUP_NET_PRIO
+               ~CGROUP_PERF
+               ~CGROUPS
+               ~CGROUP_SCHED
+               ~CPUSETS
+               ~IPC_NS
+               ~MACVLAN
+               ~NAMESPACES
+               ~NET_CLS_CGROUP
+               ~NET_NS
+               ~PID_NS
+               ~POSIX_MQUEUE
+               ~SECURITYFS
+               ~USER_NS
+               ~UTS_NS
+               ~VETH
+               ~!GRKERNSEC_CHROOT_MOUNT
+               ~!GRKERNSEC_CHROOT_DOUBLE
+               ~!GRKERNSEC_CHROOT_PIVOT
+               ~!GRKERNSEC_CHROOT_CHMOD
+               ~!GRKERNSEC_CHROOT_CAPS"
+
+       kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
+               ~DEVPTS_MULTIPLE_INSTANCES"
+
+       use macvtap && CONFIG_CHECK+="
+               ~MACVTAP"
+
+       use virt-network && CONFIG_CHECK+="
+               ~BRIDGE_EBT_MARK_T
+               ~BRIDGE_NF_EBTABLES
+               ~NETFILTER_ADVANCED
+               ~NETFILTER_XT_CONNMARK
+               ~NETFILTER_XT_MARK
+               ~NETFILTER_XT_TARGET_CHECKSUM
+               ~IP_NF_FILTER
+               ~IP_NF_MANGLE
+               ~IP_NF_NAT
+               ~IP_NF_TARGET_MASQUERADE
+               ~IP6_NF_FILTER
+               ~IP6_NF_MANGLE
+               ~IP6_NF_NAT"
+       # Bandwidth Limiting Support
+       use virt-network && CONFIG_CHECK+="
+               ~BRIDGE_EBT_T_NAT
+               ~IP_NF_TARGET_REJECT
+               ~NET_ACT_POLICE
+               ~NET_CLS_FW
+               ~NET_CLS_U32
+               ~NET_SCH_HTB
+               ~NET_SCH_INGRESS
+               ~NET_SCH_SFQ"
+
+       # Handle specific kernel versions for different features
+       kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+       if kernel_is ge 3 6; then
+               CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP "
+               kernel_is lt 4 5 && CONFIG_CHECK+=" ~MEMCG_KMEM "
+       fi
+
+       ERROR_USER_NS="Optional depending on LXC configuration."
+
+       if [[ -n ${CONFIG_CHECK} ]]; then
+               linux-info_pkg_setup
+       fi
+}
+
+src_prepare() {
+       touch "${S}/.mailmap"
+
+       default
+
+       # Tweak the init script:
+       cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
+       sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
+               -i "${S}/libvirtd.init" || die "sed failed"
+}
+
+src_configure() {
+       local emesonargs=(
+               $(meson_feature apparmor)
+               $(meson_use apparmor apparmor_profiles)
+               $(meson_feature audit)
+               $(meson_feature caps capng)
+               $(meson_feature dbus)
+               $(meson_feature dtrace)
+               $(meson_feature firewalld)
+               $(meson_feature fuse)
+               $(meson_feature glusterfs)
+               $(meson_feature glusterfs storage_gluster)
+               $(meson_feature iscsi storage_iscsi)
+               $(meson_feature iscsi-direct storage_iscsi_direct)
+               $(meson_feature libvirtd driver_libvirtd)
+               $(meson_feature libssh)
+               $(meson_feature lvm storage_lvm)
+               $(meson_feature lvm storage_mpath)
+               $(meson_feature lxc driver_lxc)
+               $(meson_feature macvtap)
+               $(meson_feature nls)
+               $(meson_feature numa numactl)
+               $(meson_feature numa numad)
+               $(meson_feature openvz driver_openvz)
+               $(meson_feature parted storage_disk)
+               $(meson_feature pcap libpcap)
+               $(meson_feature policykit polkit)
+               $(meson_feature qemu driver_qemu)
+               $(meson_feature qemu yajl)
+               $(meson_feature rbd storage_rbd)
+               $(meson_feature sasl)
+               $(meson_feature selinux)
+               $(meson_feature udev)
+               $(meson_feature vepa virtualport)
+               $(meson_feature virt-network driver_network)
+               $(meson_feature virtualbox driver_vbox)
+               $(meson_feature wireshark-plugins wireshark_dissector)
+               $(meson_feature xen driver_libxl)
+               $(meson_feature zfs storage_zfs)
+
+               -Dhal=disabled
+               -Dnetcf=disabled
+               -Dsanlock=disabled
+
+               -Ddriver_esx=enabled
+               -Dinit_script=systemd
+               -Dqemu_user=$(usex caps qemu root)
+               -Dqemu_group=$(usex caps qemu root)
+               -Ddriver_remote=enabled
+               -Dstorage_fs=enabled
+               -Ddriver_vmware=enabled
+
+               --localstatedir="${EPREFIX}/var"
+               -Drunstatedir="${EPREFIX}/run"
+       )
+
+       meson_src_configure
+}
+
+src_test() {
+       # remove problematic tests, bug #591416, bug #591418
+       sed -i -e 's#commandtest$(EXEEXT) # #' \
+               -e 's#virfirewalltest$(EXEEXT) # #' \
+               -e 's#nwfilterebiptablestest$(EXEEXT) # #' \
+               -e 's#nwfilterxml2firewalltest$(EXEEXT)$##' \
+               tests/Makefile
+
+       export VIR_TEST_DEBUG=1
+       meson_src_test
+}
+
+src_install() {
+       meson_src_install
+
+       # Remove bogus, empty directories. They are either not used, or
+       # libvirtd is able to create them on demand
+       rm -rf "${D}"/etc/sysconfig
+       rm -rf "${D}"/var
+       rm -rf "${D}"/run
+
+       newbashcomp "${S}/tools/bash-completion/vsh" virsh
+       bashcomp_alias virsh virt-admin
+
+       use libvirtd || return 0
+       # From here, only libvirtd-related instructions, be warned!
+
+       systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+       newinitd "${S}/libvirtd.init" libvirtd
+       newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
+       newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
+       newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
+
+       newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
+       newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
+
+       DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
+       DISABLE_AUTOFORMATTING=true
+       readme.gentoo_create_doc
+}
+
+pkg_preinst() {
+       # we only ever want to generate this once
+       if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+               rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
+       fi
+}
+
+pkg_postinst() {
+       if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+               touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+       fi
+
+       use libvirtd || return 0
+       # From here, only libvirtd-related instructions, be warned!
+
+       readme.gentoo_print_elog
+}

Reply via email to