summaryrefslogtreecommitdiff
path: root/app-emulation/libvirt
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
committerV3n3RiX <venerix@redcorelinux.org>2019-05-18 00:10:51 +0100
commiteccb70a7f91b2d22582587f26d1a28bb31408b45 (patch)
tree3223e1fd54201bcf4ebecac6fbe87361cbe643e2 /app-emulation/libvirt
parenta2810985afabcc31d3eace5e61d8ea25b852ba17 (diff)
gentoo resync : 18.05.2019
Diffstat (limited to 'app-emulation/libvirt')
-rw-r--r--app-emulation/libvirt/Manifest2
-rw-r--r--app-emulation/libvirt/files/libvirtd.init-r1736
-rw-r--r--app-emulation/libvirt/libvirt-5.2.0-r1.ebuild392
3 files changed, 430 insertions, 0 deletions
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
index 6d4cdaf1eafe..d93eee925ecc 100644
--- a/app-emulation/libvirt/Manifest
+++ b/app-emulation/libvirt/Manifest
@@ -10,6 +10,7 @@ AUX libvirt-guests.confd 2430 BLAKE2B 9d56477c9377e02503782e6d653579c6d149b292c4
AUX libvirt-guests.init-r3 5530 BLAKE2B 5de3e8577ded1401f6dca551c6098418e596287d43b1b90e133859bb9b74dff20b8518bc09853ccff7141e6baa52fc12c9b8d3e8f60b868b72b1993254fac5d9 SHA512 7aa4eac8c293c3063d9435a4ad1ea855f9fdd84eb0ed8cbf0779935f152aab380e2ee7eb9129b2f07147bfa4dd1eae4b836ccae295c35b63dbc767208dd11b0c
AUX libvirtd.confd-r5 740 BLAKE2B 74a069f4902dd1352f06029c886200615a35870ff88496c91956d23a3172db0789086622422f545498e92b7f8de41225022185fe291dd580cbacdeb783163f4b SHA512 98f935589dbc5f2a99329f77fdf84c563fa0dc99404b7476603679478d68ce8dbea2c88645251d3c28f59e7bcae124ae632972146e8a8c3e0e9fcbfb27296f91
AUX libvirtd.init-r16 1093 BLAKE2B 7242ddcc7046392e8c24c1918a1dce343a3198fd80346c97850bb0226888d98f6d57f53eb00e38b8f9e71fd2073feef8399b340aea9ab9d8ed64a646140c3dc1 SHA512 5ea4c2f9e48faf2aa8fe7077d075841d610da17e28bcc85c79c55565f286e345339f042090b453e25accf5c405e322e76b6cf846fdfb3e90db3e2d0c2fff4c48
+AUX libvirtd.init-r17 1153 BLAKE2B b7f775a5bd6a2532da50fecc272036176e1b82db1c3de7e817fa9ded29f351f621fde48a134bc31dc6b4145e55ca4c5906ab9d4b34ec0c45fb738b9908f1a733 SHA512 bd81ff66c6dbaa451627c2e5b17c4428cf6f5cf81ccbf29697060c59a68dbcf75ebd0d8806d0f5af7a79bf32090fadc90af76826d177861a21049541f3832052
AUX libvirtd.service.conf 401 BLAKE2B edd74238f9639ead1d776142e6231d87f39cb6670e72cec9c1ac44f58fcfbc63e72944d2d243a1aabe48b9acc6bb1c52189161a79e3d42603c87a270027c42f8 SHA512 27adbd104ea87e51d423b057392a0c6726692ad8ee9723f73dc4bfe8eb54069725d64883434424ba810d36992d404d1ba4afe6bcefb866d3d3d92dfd161c2b32
AUX libvirtd.tmpfiles.conf 36 BLAKE2B fa0e1dac4117dcb2a2e826c82c4c63e20156db47abf4088167484f1f3149a4998840cf1aba745621851d7e2653df5c7f7268d8d61be3a3731ea053a88f35c13b SHA512 2b1c3c64dd6fa03d8c2ae24e7ce4aa7d754913214542a68a4e99f10fbc251fd23ee26e297a957d7b4b70eec8ef028c41fc915da3a85fbbd16143bb92d1de3aed
AUX virtlockd.init-r1 570 BLAKE2B 734d582d867b79649f863504fcd7c87fe3c59569b56b0996a6229d6eebadc9d4c356c10bbcf5637483fbc930d0c50233da4fffa357d423029b3828b7a3be56de SHA512 65a05d406200da9a534df5caa1b9cb2af97f0b03f64e6b4157322975fa754f59ae74fff9ec8301a6c0510e4b75e2b72a78cddf004a76109e18c375e83527cee5
@@ -21,6 +22,7 @@ DIST libvirt-5.2.0.tar.xz 14992888 BLAKE2B d68aedb634a70063a116e112689f252d3fc2f
EBUILD libvirt-4.9.0.ebuild 9673 BLAKE2B 3ba41380b45f9a4d2b0fdc3826a3af61004213e6acaa7ab0afd2644217bbd984245789e3aeefdb5efcdd77cf5a7389d5b68b13fbd025e8a6518fcba0bddb0611 SHA512 3888b75c3ce8a1049cd2fe14bde03885e5b260a85792f898baf47943546e5d788e281b4cd6163e5bb0336608583e6ea01f29841e4aa8e5689714be45c2747906
EBUILD libvirt-5.0.0-r1.ebuild 9897 BLAKE2B 8e562642eefa5ee6a13dc1aeb1c2f6a84692633d0023e9735b1e3cc2aaa803ea68b56694225f04d145315f5587533e34a9009fe9875307db9d3123d5b086dcf1 SHA512 158d97f7e8465094f303b9cac0fe8b7ce09af8619c1e049695bbafd7ad745382646490a041e78baab92b8db0ba10298acbbf58d2890a6fafcb2902808085a387
EBUILD libvirt-5.1.0-r1.ebuild 9903 BLAKE2B dc8dc7dbfd7ae46d3b449bbcc69a9739333e2714d0bf7f6a89b1c8a93b625ef1bd53ab7ffc5d1f0d5ef7a6a9619f7bc7e5625d9a41006c40e7d0a38023ba46c8 SHA512 70ca917fd8925bf81cd1383996ff704997c8ef13dba7dd7c4b7fba90c6a57255b55f0143f90f51305607a0d964c0216907e7121d92c6d8e88120b49643c20139
+EBUILD libvirt-5.2.0-r1.ebuild 9903 BLAKE2B bc6d1e56e6845e8f75d1aa6af160a45ddd1e3434f1ca2e2766a535ec96a3f76ec86f5058a5f13bd146b4b5a184dec2feb6fb333fbd246743b92abd23580020e9 SHA512 0b00e5ccb7841e20670c3e0eeb1077d265aeb383444519214614a3bf7a416209013eb0946f6804cb6b39542c8d687513037df6c4d5c99a2a59ccf8be4246be45
EBUILD libvirt-5.2.0.ebuild 9903 BLAKE2B 4609c1ec8d3c51b940e200afb5ce9cfe8dcdf0676d2875f65fb8644de0db6c2cc0fb0c2c833241f0a0dc9cd11d2872c3bc14143cf7cc56639e0bca145db04fd1 SHA512 9f3e0e77bbc35be79f99cf9bafaa74d3e314022315ef9c51ddff4120363468f0f651e56fd659f4d9e0358c9d237626720da54a5dd094cebe402c7d0332faded8
EBUILD libvirt-9999.ebuild 9903 BLAKE2B 4609c1ec8d3c51b940e200afb5ce9cfe8dcdf0676d2875f65fb8644de0db6c2cc0fb0c2c833241f0a0dc9cd11d2872c3bc14143cf7cc56639e0bca145db04fd1 SHA512 9f3e0e77bbc35be79f99cf9bafaa74d3e314022315ef9c51ddff4120363468f0f651e56fd659f4d9e0358c9d237626720da54a5dd094cebe402c7d0332faded8
MISC metadata.xml 3857 BLAKE2B bc5dc60897ca70f3a586c947784dec74cf7daa35909836955dc52a442668b08323398473f9df8be46f2819e762638dcfcb646a8fb7ee768210f27584fb91e3f6 SHA512 33274100068f99fe0c69546e81fb47517818adf2991529533b9bacfc6bcb23ee08ae00b9d0a7a7ff47cb920d2ff1e24b5fc788a3533a89ff477ab04dad0194fc
diff --git a/app-emulation/libvirt/files/libvirtd.init-r17 b/app-emulation/libvirt/files/libvirtd.init-r17
new file mode 100644
index 000000000000..ca3f872e14e0
--- /dev/null
+++ b/app-emulation/libvirt/files/libvirtd.init-r17
@@ -0,0 +1,36 @@
+#!/sbin/openrc-run
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Virtual Machine Management daemon (libvirt)"
+
+LIBVIRTD_OPTS=${LIBVIRTD_OPTS:-"${LIBVIRTD_OPTS}"}
+LIBVIRTD_TIMEOUT=${LIBVIRTD_TERMTIMEOUT:-"TERM/25/KILL/5"}
+
+command="/usr/sbin/libvirtd"
+command_args="-d ${LIBVIRTD_OPTS}"
+start_stop_daemon_args="--env KRB5_KTNAME=/etc/libvirt/krb5.tab"
+pidfile="/var/run/libvirtd.pid"
+retry="${LIBVIRTD_TERMTIMEOUT}"
+
+depend() {
+ need virtlogd
+ use dbus virtlockd
+ after ntp-client ntpd nfs nfsmount portmap rpc.statd iptables ip6tables ebtables corosync sanlock cgconfig xenconsoled
+ USE_FLAG_FIREWALLD
+ USE_FLAG_AVAHI
+ USE_FLAG_ISCSI
+ USE_FLAG_RBD
+}
+
+start_pre() {
+ # Test configuration directories in /etc/libvirt/ to be either not
+ # present or a directory, i.e. not a regular file, bug #532892
+
+ checkpath --directory /etc/libvirt/lxc || return 1
+ checkpath --directory /etc/libvirt/nwfilter || return 1
+ [ -L /etc/libvirt/qemu ] ||
+ checkpath --directory /etc/libvirt/qemu || return 1
+ [ -L /etc/libvirt/storage ] ||
+ checkpath --directory /etc/libvirt/storage || return 1
+}
diff --git a/app-emulation/libvirt/libvirt-5.2.0-r1.ebuild b/app-emulation/libvirt/libvirt-5.2.0-r1.ebuild
new file mode 100644
index 000000000000..78ac8a38d3dc
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-5.2.0-r1.ebuild
@@ -0,0 +1,392 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{5,6,7} )
+
+inherit autotools bash-completion-r1 eutils linux-info python-any-r1 readme.gentoo-r1 systemd user
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://libvirt.org/git/libvirt.git"
+ SRC_URI=""
+ KEYWORDS=""
+ SLOT="0"
+else
+ # Versions with 4 numbers are stable updates:
+ if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
+ SRC_URI="https://libvirt.org/sources/stable_updates/${P}.tar.xz"
+ else
+ SRC_URI="https://libvirt.org/sources/${P}.tar.xz"
+ fi
+ KEYWORDS="~amd64 ~arm64 ~x86"
+ SLOT="0/${PV}"
+fi
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+IUSE="
+ apparmor audit +caps +dbus firewalld fuse glusterfs iscsi iscsi-direct
+ +libvirtd lvm libssh lxc +macvtap nfs nls numa openvz parted pcap phyp
+ policykit +qemu rbd sasl selinux +udev +vepa virtualbox virt-network
+ wireshark-plugins xen zeroconf 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="
+ app-misc/scrub
+ 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 )
+ firewalld? ( >=net-firewall/firewalld-0.6.3 )
+ fuse? ( >=sys-fs/fuse-2.8.6:= )
+ 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
+ )
+ zeroconf? ( >=net-dns/avahi-0.6[dbus] )
+ zfs? ( sys-fs/zfs )"
+
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-text/xhtml1
+ dev-lang/perl
+ dev-libs/libxslt
+ dev-perl/XML-XPath
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.2.0-do-not-use-sysconf.patch
+ "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch
+ "${FILESDIR}"/${PN}-5.0.0-fix-paths-for-apparmor.patch
+)
+
+pkg_setup() {
+ if use qemu; then
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 "qemu,kvm"
+ fi
+
+ use policykit && enewgroup libvirt
+
+ # 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
+
+ if [[ ${PV} = *9999* ]]; then
+ # Reinitialize submodules as this is required for gnulib's bootstrap
+ git submodule init
+ # git checkouts require bootstrapping to create the configure script.
+ # Additionally the submodules must be cloned to the right locations
+ # bug #377279
+ ./bootstrap || die "bootstrap failed"
+ (
+ git submodule status .gnulib | awk '{ print $1 }'
+ git hash-object bootstrap.conf
+ git ls-tree -d HEAD gnulib/local | awk '{ print $3 }'
+ ) >.git-module-status
+ fi
+
+ # Tweak the init script:
+ cp "${FILESDIR}/libvirtd.init-r17" "${S}/libvirtd.init" || die
+ sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
+ -e "s/USE_FLAG_AVAHI/$(usex zeroconf 'use avahi-daemon' '')/" \
+ -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \
+ -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \
+ -i "${S}/libvirtd.init" || die "sed failed"
+
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_with apparmor)
+ $(use_with apparmor apparmor-profiles)
+ $(use_with audit)
+ $(use_with caps capng)
+ $(use_with dbus)
+ $(use_with firewalld)
+ $(use_with fuse)
+ $(use_with glusterfs)
+ $(use_with glusterfs storage-gluster)
+ $(use_with iscsi storage-iscsi)
+ $(use_with iscsi-direct storage-iscsi-direct)
+ $(use_with libvirtd)
+ $(use_with libssh)
+ $(use_with lvm storage-lvm)
+ $(use_with lvm storage-mpath)
+ $(use_with lxc)
+ $(use_with macvtap)
+ $(use_enable nls)
+ $(use_with numa numactl)
+ $(use_with numa numad)
+ $(use_with openvz)
+ $(use_with parted storage-disk)
+ $(use_with pcap libpcap)
+ $(use_with phyp)
+ $(use_with policykit polkit)
+ $(use_with qemu)
+ $(use_with qemu yajl)
+ $(use_with rbd storage-rbd)
+ $(use_with sasl)
+ $(use_with selinux)
+ $(use_with udev)
+ $(use_with vepa virtualport)
+ $(use_with virt-network network)
+ $(use_with wireshark-plugins wireshark-dissector)
+ $(use_with xen libxl)
+ $(use_with zeroconf avahi)
+ $(use_with zfs storage-zfs)
+
+ --without-hal
+ --without-netcf
+ --without-sanlock
+
+ --with-esx
+ --with-init-script=systemd
+ --with-qemu-group=$(usex caps qemu root)
+ --with-qemu-user=$(usex caps qemu root)
+ --with-remote
+ --with-storage-fs
+ --with-vmware
+
+ --disable-static
+ --disable-werror
+
+ --with-html-subdir=${PF}/html
+ --localstatedir=/var
+ )
+
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
+ else
+ myeconfargs+=( $(use_with virtualbox vbox) )
+ fi
+
+ econf "${myeconfargs[@]}"
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ cd "${BUILD_DIR}"
+
+ # 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
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" \
+ SYSTEMD_UNIT_DIR="$(systemd_get_systemunitdir)" install
+
+ find "${D}" -name '*.la' -delete || die
+
+ # 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
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ systemd_install_serviced \
+ "${FILESDIR}"/libvirtd.service.conf libvirtd.service
+
+ systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newinitd "${FILESDIR}/libvirt-guests.init-r3" libvirt-guests || die
+ newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
+ newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
+
+ newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
+ newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
+
+ newbashcomp "${S}/tools/bash-completion/vsh" virsh
+ bashcomp_alias virsh virt-admin
+
+ DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r2")
+ 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
+}