summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Goldstein <cardoe@gentoo.org>2014-01-19 21:35:59 +0000
committerDoug Goldstein <cardoe@gentoo.org>2014-01-19 21:35:59 +0000
commit3d1f04d92966e677aebfdeaf68f08bba63ab0e86 (patch)
tree049e0d028b567d5c638c743fd599d49ccabc324d /app-emulation/libvirt
parentChange virtual/monodoc dep to dev-lang/mono as former is treecleaned (bug 471... (diff)
downloadhistorical-3d1f04d92966e677aebfdeaf68f08bba63ab0e86.tar.gz
historical-3d1f04d92966e677aebfdeaf68f08bba63ab0e86.tar.bz2
historical-3d1f04d92966e677aebfdeaf68f08bba63ab0e86.zip
Version bump. Fix CVE-2013-6458, CVE-2014-0028, CVE-2014-1447
Package-Manager: portage-2.2.7/cvs/Linux x86_64 Manifest-Sign-Key: 0xD7DFA8D318FA9AEF!
Diffstat (limited to 'app-emulation/libvirt')
-rw-r--r--app-emulation/libvirt/ChangeLog9
-rw-r--r--app-emulation/libvirt/Manifest20
-rw-r--r--app-emulation/libvirt/libvirt-1.2.1.ebuild426
3 files changed, 444 insertions, 11 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog
index 11295d08070e..312dcb5655e9 100644
--- a/app-emulation/libvirt/ChangeLog
+++ b/app-emulation/libvirt/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-emulation/libvirt
-# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.345 2013/12/29 01:11:36 cardoe Exp $
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.346 2014/01/19 21:35:51 cardoe Exp $
+
+*libvirt-1.2.1 (19 Jan 2014)
+
+ 19 Jan 2014; Doug Goldstein <cardoe@gentoo.org> +libvirt-1.2.1.ebuild:
+ Version bump. Fix CVE-2013-6458, CVE-2014-0028, CVE-2014-1447
*libvirt-1.2.0-r1 (29 Dec 2013)
diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
index 5b97632659ea..c7ada57530bc 100644
--- a/app-emulation/libvirt/Manifest
+++ b/app-emulation/libvirt/Manifest
@@ -12,6 +12,7 @@ DIST libvirt-1.1.3.tar.gz 26578000 SHA256 af83e65b4b26520662ddd183c1358be0d05138
DIST libvirt-1.1.4.tar.gz 26799019 SHA256 5910f5cf607a50c606d959e6b1e5d6e67966b7aa7324982afd7f85d9c24bd98f SHA512 64455585b8d7e5c0f701e9803ae00d277ee27f9bec92b9890e487cd0298f5f8ff9075d0b2bc81be67e8d8e03bfe58eb2e4fd6292439acd9d22a3f3e7f5b87efc WHIRLPOOL c8de6024b51988415847463064ccf2bcc9d7cb42be8765fbfcf901b594d963351f312d962ca4fb2a5ecce7c2247a60b6201e57a41ba44caa6211148585d65352
DIST libvirt-1.2.0-36378d1a.tar.xz 5200 SHA256 1c1448051bad702eccd7a122496f7995427218152b65de12e3d418f7faaf6412 SHA512 4c01d90dc1e2c46ed65a61321887d1337ea2733dfda1361de9560bd5aba68ff51e425190bbe140893dd96f902111ed5be1ba9bc72a356abc0251f30fff645746 WHIRLPOOL f3778cfd56c0a0857607af1c301e3cf8a96ecf87b5ec85d23dbf98512692fd2bb428c923eab69234e6fdad95ed6e195bb01ebdd843df7a18e910e55bb6dccf82
DIST libvirt-1.2.0.tar.gz 26916717 SHA256 a8e578ae7861db2ac5f454073293d2ef3229fd3f6c4f9029101763244db22ddd SHA512 834274b0249eb39439d21cd9b494fa2acbaee9e5337557b8d57977b483f3e5d00fd0a6743f8f4a02e826114c15d2468ab0c9385e4e4c9537abba18da3d8c5fa6 WHIRLPOOL 057a91ad4296710833721d3a7f9eff616755422462479709b72e5fe679ed8825c5bbfd47fde9f7abaf1e6f4104a680ad874c41bf9759cf45ac7d863061a38cd0
+DIST libvirt-1.2.1.tar.gz 27228694 SHA256 bc29b5751bf36753c17e2fdbb75e70c7b07df3d9527586d3426e90f5f4abb898 SHA512 6184840623156ca01ee7f59078ebf031bc84c25b37bb110372c7bcf230a79b74e267475f989fb73db5e3c096dcc74f03cb30adfc5de022f756ed2cd6ab05bfd0 WHIRLPOOL 75c2a37b1101950474aad8931d999564ff575512d38c9e8d2cf989cef3ad7057853046b738b20bd77be80c1e6677319aea7227797ae95ce91512dc36bd05a142
EBUILD libvirt-1.0.5.6.ebuild 12203 SHA256 76c27356932b38556846b16aa48a3c9f2cc7eef96b63a9811fee508bfe13a321 SHA512 9c0cb354ca8692999c60e3dc59086e7a50340115e9cb9aa53dde50fe0b31dce38283afd6933611e6285a8175331b98db545a93e4d6ab200cc4febe4e9cc14b68 WHIRLPOOL 8d728ec87a9ae26e062124c845045f6fe67a5aff40b5c99dfdf701de0c02e4616f9c882b9bb47ff5ee2f9cd4d53e3c308abf226f1c532bf21619a5130faa808f
EBUILD libvirt-1.1.3-r1.ebuild 12174 SHA256 9431604bfc84faa8384a5735a94520fd6f7003f7f2e6745ef940e3033b25487f SHA512 eac6c9b1d7f5d1d5e10145b7d00f8f30ae7851128769a1a6aecd5265bddfb274e9f40d19d0c59f12caa55a9af047cfcb1eda4c4da490bbae1dca5090573930e8 WHIRLPOOL 33046a59ff42a54001a5d115494d02ae19d5e208e82d435cfaab3ee57a094cd07f9c4df2e0ed454abccfa5c84cacf62ae96b72139a831e79b2dc068b90b68f99
EBUILD libvirt-1.1.3-r2.ebuild 12235 SHA256 41b97566f7eb6ec1dae8d990a95bbc8b58730a6a3b7bbfbb613cfce39604998d SHA512 8b97c87d96f4b7e760fafc1143de83b26f9bfd9960d7d1e64dda11669c99d7da2ba8e00701f9957bad42df1f5de2ba96c6b5b16e30d4a5935f8766a7dfe368bf WHIRLPOOL 8a2768d371ee42ba022c4eab51886ff30bd469624bb97fb48b35d8e5944d75256c735491bd3d192629cda0c302e698a49abf71fafd50d1e2436335d0f2aeacc0
@@ -19,19 +20,20 @@ EBUILD libvirt-1.1.3.1.ebuild 12249 SHA256 bf2335674e69bb0fb4975e5914a339e7eba12
EBUILD libvirt-1.1.4.ebuild 12248 SHA256 09025e92efbd85ac651ec092aafec34981394dd6363d0aa93476d3b5d356fbfb SHA512 f009c470a40fa60aacc341b7cffe40b74d14c8d06cbf5721a3d02aef2ffe6d7697263e32eeef39e05e8913983424e3bda5f5d27bc66ae4a7755e3614f1dadfbe WHIRLPOOL a8c8dfd15f04f61afc5d9927a1fe6894269b5601391bd6f39d9b4b51f3a13ad188413849f1098f13e8c6c97a1dbab48fbaa6131d22e8ca2fcdcf76d77986ffe8
EBUILD libvirt-1.2.0-r1.ebuild 12076 SHA256 d60726eaab3b791c7891a0b96dcb9bc274e1d72277a6e709c35f30ac0e35c350 SHA512 303b9c0dabc85b6590a8b2a2df0b0ec4d0f060a911808a354e13ba25e46f101678044fe85e7b0c811587c2abe2ad772a78a9b05cb9b788873d26f66315fab335 WHIRLPOOL 42891da2c59d87d4953da2100ff630c7eec983ffb882c8c847d1504216f7f1eb0a0c471498d8a4e96aaa3b13a924727c34399c7039b70705fdaa5230b5304ba7
EBUILD libvirt-1.2.0.ebuild 12074 SHA256 197804f5776c68297c990dda843fa2cbe9b830a004ad9934465c91737431ab0d SHA512 26a2e932ecba606a01d4480e1200a89731f85809b7c122b052da6c8ed7d657fbb99ae808d9820cfdb100dbf742c189011bbfa50fae741d3e75b4230981802979 WHIRLPOOL 98facfd9d861125052001c794ecf809ffb3c1b30723fb244b5cfa5bb598c4b426b2a22ac0f4eee56797d198ec83aec17c28be08bfcd0ce17b0ea79f83c7cca03
+EBUILD libvirt-1.2.1.ebuild 12074 SHA256 622582bc51decd79b240ebceb8084609a0b8fefdbbe721e7b085a75f11c1cc24 SHA512 ba73efc0d315d8e218156888d0e3e7993bfe1e77e6575bf3c52a82345e15f44a57d45ad4d7e290313b92a8c50ea4500dee6bd720502905362a475b70b010fc9c WHIRLPOOL 9f20f46b97a4f5a3e5f3bf3c216d6e717e097922220bb596c846a79edb3d1fda3e3e1cd58aa41ce0bb62580557224e8153060e479dfbfd09b33ea28115b5bd5d
EBUILD libvirt-9999.ebuild 12068 SHA256 8f02e85824b26d9c3b4a69784eca8702ab6754725fa533abcfce30cc44677dab SHA512 c39e437689437e47305fa6b10132b2c31e2290b57ed29f1ff87d97426bef87bc1b6c7e7072e66dac0b50422cb4e787aba06a11a3b2b3d15e894e83431e3734ca WHIRLPOOL 56c056adc0a15f4e9e98c7db0dae4fbcdd2459eb62622d862041d746618180292006a10f876343159bc241d720685823fae6db7eec3ff7f52f513640be3698b9
-MISC ChangeLog 15304 SHA256 2799e48823d24752e252dbd83e8c87e589f5a14624c8aac7b91e319cf1472db5 SHA512 e3e47f437076804310a4c81ce15f5a13259118284f096c8d3352dede03602d1ae703b1025295169a6c34dec3a866edc6dc0f0d05c11be385787e173a53624b82 WHIRLPOOL eaa1307be5c4c582de1bed99bad097588c5a1fe429d5f858686972d0d7d18d50fdc932b3e56e082e883f0600bcbdb32e605b0ac1e6d1526a2d365aff183a0da5
+MISC ChangeLog 15472 SHA256 afbadeecc3f0e85ecdb38cd08fc55cc7a8353800e2024a40eb3b469738e90f8d SHA512 66d789943d1771bc701cc8bfb0c83af42b761249365af99cfbc5d4d3a7b9355e001e2851401fe3875e59dbfdc7b25516999943217ce0bdbecf33c3b3605ea647 WHIRLPOOL 89faa9f0909e22df43cda170f17d952336deb89c3d5f6b3f8cb8ed474fc0d7fec1d9e7db57c2cb177994476cc36a80925b9871dc753745b061a04c0aa165084c
MISC metadata.xml 3534 SHA256 8678edfd233eaa04266d7e15f71102fb45d1e4843697ba0cd04fe57b45dbb6c6 SHA512 e4b2cc5f9001697b784034ae6e58fea39e9fdc223192772592bcb671a4e1436186ed7757fc72993ee81c1e4005502fbb8c0a2d4588666a186d42024a98c052a2 WHIRLPOOL 9f32ac2763d17e5204da7396eae2a8c79c63e1e82b4a1035c86d93c029902159d3f5697aad86b7307b6e8acee0a4f0f02023d0e5e824a471cdad80a5cebc6886
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
-iQF8BAEBCABmBQJSv3bMXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
+iQF8BAEBCABmBQJS3EU7XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w
ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDMDRGNEJFMDZEQTJGRUY3NkI4MEM3NTlE
-N0RGQThEMzE4RkE5QUVGAAoJENffqNMY+prvBHQH/jIGaoB4CZnp5GUlr9n6s3AO
-9c+Djm4k89vaLBvQ69VU73lD0XuY83YzA2a6vsPdffZT0sbsnMxyygCvcyzu/qKD
-KvkdtwV3lHQLGlJnFFlJZdg9QKh2DcDrsz8hhKah27ajV17L/aANe7OpVeEXA1I/
-SUQ8i+6aM75UYBqHKixbPPClFHamQOcwNbumBbip1gxkoFSfIldROI4bKuOr0aRY
-3PAd4kPA8tDZOBFwMxMTF6srn059m/NE7feJdZdl0qQH1R7FU9E4mMm7yPCFrufX
-FQVtq4T7FaLalzwqQWJFTOj2OW1emulTbZF8B3QrWdgX9n/52D40n/CI/JWsmpQ=
-=fDVM
+N0RGQThEMzE4RkE5QUVGAAoJENffqNMY+prvceoIAJBMDrLGeRYwK3DmS1lyLgoC
+LTjULIrE4HdeL/t1QFyx7WLlITmc5jiSo1BciNo5PIVwLE3sT9ikRL2uZ3GbsqUR
+SqC79Hrb1d+DEZ21jgob0IgnMUCnx2xm5UCAdmgNEU3crc3cpoDNS7YhTgqK9bRx
+AGqQQWJ2FR6Ja2ZU5p6WUw8wThweYAIiFq4S+Bpo21BTtEGk2/mGyKustSo4ASau
+WROLZdWY2Uf5iyn4kcNDyDIHvARTE6ECe2nTjB/T50LpzUmYOZUs9aliGBLvp+DR
+SMamVazZ7imtw4ycuTNtywTEb4JU1kJTMwsTm+9NoS20KTy4M+hmX+tJ0EJRmmA=
+=bcNm
-----END PGP SIGNATURE-----
diff --git a/app-emulation/libvirt/libvirt-1.2.1.ebuild b/app-emulation/libvirt/libvirt-1.2.1.ebuild
new file mode 100644
index 000000000000..719b1795afea
--- /dev/null
+++ b/app-emulation/libvirt/libvirt-1.2.1.ebuild
@@ -0,0 +1,426 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.2.1.ebuild,v 1.1 2014/01/19 21:35:51 cardoe Exp $
+
+EAPI=5
+
+#BACKPORTS=062ad8b2
+AUTOTOOLIZE=yes
+
+MY_P="${P/_rc/-rc}"
+
+inherit eutils user autotools linux-info systemd readme.gentoo
+
+if [[ ${PV} = *9999* ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://libvirt.org/libvirt.git"
+ AUTOTOOLIZE=yes
+ SRC_URI=""
+ KEYWORDS=""
+else
+ SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz
+ ftp://libvirt.org/libvirt/${MY_P}.tar.gz
+ ${BACKPORTS:+
+ http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
+ KEYWORDS="~amd64 ~x86"
+fi
+S="${WORKDIR}/${P%_rc*}"
+
+DESCRIPTION="C toolkit to manipulate virtual machines"
+HOMEPAGE="http://www.libvirt.org/"
+LICENSE="LGPL-2.1"
+SLOT="0/${PV}"
+IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \
+ nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
+ selinux +udev uml +vepa virtualbox virt-network xen elibc_glibc \
+ systemd"
+REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
+ lxc? ( caps libvirtd )
+ openvz? ( libvirtd )
+ qemu? ( libvirtd )
+ uml? ( libvirtd )
+ vepa? ( macvtap )
+ virtualbox? ( libvirtd )
+ xen? ( libvirtd )
+ virt-network? ( libvirtd )
+ firewalld? ( virt-network )"
+
+# 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="sys-libs/readline
+ sys-libs/ncurses
+ >=net-misc/curl-7.18.0
+ dev-libs/libgcrypt
+ >=dev-libs/libxml2-2.7.6
+ dev-libs/libnl:3
+ >=net-libs/gnutls-1.0.25
+ net-libs/libssh2
+ sys-apps/dmidecode
+ >=sys-apps/util-linux-2.17
+ sys-devel/gettext
+ >=net-analyzer/netcat6-1.0-r2
+ app-misc/scrub
+ audit? ( sys-process/audit )
+ avahi? ( >=net-dns/avahi-0.6[dbus] )
+ caps? ( sys-libs/libcap-ng )
+ fuse? ( >=sys-fs/fuse-2.8.6 )
+ iscsi? ( sys-block/open-iscsi )
+ lxc? ( sys-power/pm-utils )
+ lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
+ nfs? ( net-fs/nfs-utils )
+ numa? (
+ >sys-process/numactl-2.0.2
+ sys-process/numad
+ )
+ openvz? ( sys-kernel/openvz-sources )
+ parted? (
+ >=sys-block/parted-1.8[device-mapper]
+ sys-fs/lvm2
+ )
+ pcap? ( >=net-libs/libpcap-1.0.0 )
+ policykit? ( >=sys-auth/polkit-0.9 )
+ qemu? (
+ >=app-emulation/qemu-0.13.0
+ dev-libs/yajl
+ sys-power/pm-utils
+ )
+ rbd? ( sys-cluster/ceph )
+ sasl? ( dev-libs/cyrus-sasl )
+ selinux? ( >=sys-libs/libselinux-2.0.85 )
+ virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
+ xen? ( app-emulation/xen-tools app-emulation/xen )
+ udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
+ virt-network? ( net-dns/dnsmasq
+ >=net-firewall/iptables-1.4.10
+ net-misc/radvd
+ net-firewall/ebtables
+ sys-apps/iproute2[-minimal]
+ firewalld? ( net-firewall/firewalld )
+ )
+ elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
+# one? ( dev-libs/xmlrpc-c )
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ app-text/xhtml1
+ dev-lang/perl
+ dev-libs/libxslt"
+
+DOC_CONTENTS="For the basic networking support (bridged and routed networks)
+you don't need any extra software. For more complex network modes
+including but not limited to NATed network, you can enable the
+'virt-network' USE flag.\n\n
+If you are using dnsmasq on your system, you will have
+to configure /etc/dnsmasq.conf to enable the following settings:\n\n
+ bind-interfaces\n
+ interface or except-interface\n\n
+Otherwise you might have issues with your existing DNS server."
+
+LXC_CONFIG_CHECK="
+ ~CGROUPS
+ ~CGROUP_FREEZER
+ ~CGROUP_DEVICE
+ ~CGROUP_CPUACCT
+ ~CGROUP_SCHED
+ ~CGROUP_PERF
+ ~BLK_CGROUP
+ ~NET_CLS_CGROUP
+ ~NETPRIO_CGROUP
+ ~CPUSETS
+ ~RESOURCE_COUNTERS
+ ~NAMESPACES
+ ~UTS_NS
+ ~IPC_NS
+ ~PID_NS
+ ~NET_NS
+ ~USER_NS
+ ~DEVPTS_MULTIPLE_INSTANCES
+ ~VETH
+ ~MACVLAN
+ ~POSIX_MQUEUE
+ ~SECURITYFS
+ ~!GRKERNSEC_CHROOT_MOUNT
+ ~!GRKERNSEC_CHROOT_DOUBLE
+ ~!GRKERNSEC_CHROOT_PIVOT
+ ~!GRKERNSEC_CHROOT_CHMOD
+ ~!GRKERNSEC_CHROOT_CAPS
+"
+
+VIRTNET_CONFIG_CHECK="
+ ~BRIDGE_NF_EBTABLES
+ ~BRIDGE_EBT_MARK_T
+ ~NETFILTER_ADVANCED
+ ~NETFILTER_XT_TARGET_CHECKSUM
+ ~NETFILTER_XT_CONNMARK
+ ~NETFILTER_XT_MARK
+"
+
+MACVTAP_CONFIG_CHECK=" ~MACVTAP"
+
+LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
+
+ERROR_USER_NS="Optional depending on LXC configuration."
+
+pkg_setup() {
+ enewgroup qemu 77
+ enewuser qemu 77 -1 -1 qemu kvm
+
+ # Some people used the masked ebuild which was not adding the qemu
+ # user to the kvm group originally. This results in VMs failing to
+ # start for some users. bug #430808
+ egetent group kvm | grep -q qemu
+ if [[ $? -ne 0 ]]; then
+ gpasswd -a qemu kvm
+ fi
+
+ # Handle specific kernel versions for different features
+ kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
+ kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
+
+ CONFIG_CHECK=""
+ use fuse && CONFIG_CHECK+=" ~FUSE_FS"
+ use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
+ use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
+ use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
+ use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
+ if [[ -n ${CONFIG_CHECK} ]]; then
+ linux-info_pkg_setup
+ fi
+}
+
+src_prepare() {
+ touch "${S}/.mailmap"
+ [[ -n ${BACKPORTS} ]] && \
+ EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
+ epatch
+
+ if [[ ${PV} = *9999* ]]; then
+
+ # 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 | sed 's/^[ +-]//;s/ .*//'
+ git hash-object bootstrap.conf
+ ) >.git-module-status
+ fi
+
+ epatch_user
+
+ [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
+
+ # Tweak the init script
+ local avahi_init=
+ local iscsi_init=
+ local rbd_init=
+ local firewalld_init=
+ cp "${FILESDIR}/libvirtd.init-r13" "${S}/libvirtd.init"
+ use avahi && avahi_init='avahi-daemon'
+ use iscsi && iscsi_init='iscsid'
+ use rbd && rbd_init='ceph'
+ use firewalld && firewalld_init='need firewalld'
+
+ sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
+ sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
+}
+
+src_configure() {
+ local myconf=""
+
+ ## enable/disable daemon, otherwise client only utils
+ myconf="${myconf} $(use_with libvirtd)"
+
+ ## enable/disable the daemon using avahi to find VMs
+ myconf="${myconf} $(use_with avahi)"
+
+ ## hypervisors on the local host
+ myconf="${myconf} $(use_with xen) $(use_with xen xen-inotify)"
+ myconf+=" --without-xenapi"
+ if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
+ myconf+=" --with-libxl"
+ else
+ myconf+=" --without-libxl"
+ fi
+ myconf="${myconf} $(use_with openvz)"
+ myconf="${myconf} $(use_with lxc)"
+ if use virtualbox && has_version app-emulation/virtualbox-ose; then
+ myconf="${myconf} --with-vbox=/usr/lib/virtualbox-ose/"
+ else
+ myconf="${myconf} $(use_with virtualbox vbox)"
+ fi
+ myconf="${myconf} $(use_with uml)"
+ myconf="${myconf} $(use_with qemu)"
+ myconf="${myconf} $(use_with qemu yajl)" # Use QMP over HMP
+ myconf="${myconf} $(use_with phyp)"
+ myconf="${myconf} --with-esx"
+ myconf="${myconf} --with-vmware"
+
+ ## additional host drivers
+ myconf="${myconf} $(use_with virt-network network)"
+ myconf="${myconf} --with-storage-fs"
+ myconf="${myconf} $(use_with lvm storage-lvm)"
+ myconf="${myconf} $(use_with iscsi storage-iscsi)"
+ myconf="${myconf} $(use_with parted storage-disk)"
+ myconf="${myconf} $(use_with lvm storage-mpath)"
+ myconf="${myconf} $(use_with rbd storage-rbd)"
+ myconf="${myconf} $(use_with numa numactl)"
+ myconf="${myconf} $(use_with numa numad)"
+ myconf="${myconf} $(use_with selinux)"
+ myconf="${myconf} $(use_with fuse)"
+
+ # udev for device support details
+ myconf="${myconf} $(use_with udev)"
+
+ # linux capability support so we don't need privileged accounts
+ myconf="${myconf} $(use_with caps capng)"
+
+ ## auth stuff
+ myconf="${myconf} $(use_with policykit polkit)"
+ myconf="${myconf} $(use_with sasl)"
+
+ # network bits
+ myconf="${myconf} $(use_with macvtap)"
+ myconf="${myconf} $(use_with pcap libpcap)"
+ myconf="${myconf} $(use_with vepa virtualport)"
+ myconf="${myconf} $(use_with firewalld)"
+
+ ## other
+ myconf="${myconf} $(use_enable nls)"
+
+ # user privilege bits fir qemu/kvm
+ if use caps; then
+ myconf="${myconf} --with-qemu-user=qemu"
+ myconf="${myconf} --with-qemu-group=qemu"
+ else
+ myconf="${myconf} --with-qemu-user=root"
+ myconf="${myconf} --with-qemu-group=root"
+ fi
+
+ # audit support
+ myconf="${myconf} $(use_with audit)"
+
+ ## stuff we don't yet support
+ myconf="${myconf} --without-netcf"
+
+ # we use udev over hal
+ myconf="${myconf} --without-hal"
+
+ # locking support
+ myconf="${myconf} --without-sanlock"
+
+ # systemd unit files
+ use systemd && myconf="${myconf} --with-init-script=systemd"
+
+ # this is a nasty trick to work around the problem in bug
+ # #275073. The reason why we don't solve this properly is that
+ # it'll require us to rebuild autotools (and we don't really want
+ # to do that right now). The proper solution has been sent
+ # upstream and should hopefully land in 0.7.7, in the mean time,
+ # mime the same functionality with this.
+ case ${CHOST} in
+ *cygwin* | *mingw* )
+ ;;
+ *)
+ ac_cv_prog_WINDRES=no
+ ;;
+ esac
+
+ econf \
+ ${myconf} \
+ --disable-static \
+ --docdir=/usr/share/doc/${PF} \
+ --with-remote \
+ --localstatedir=/var
+
+ if [[ ${PV} = *9999* ]]; then
+ # Restore gnulib's config.sub and config.guess
+ # bug #377279
+ (cd .gnulib && git reset --hard > /dev/null)
+ fi
+}
+
+src_test() {
+ # Explicitly allow parallel build of tests
+ export VIR_TEST_DEBUG=1
+ HOME="${T}" emake check || die "tests failed"
+}
+
+src_install() {
+ emake install \
+ DESTDIR="${D}" \
+ HTML_DIR=/usr/share/doc/${PF}/html \
+ DOCS_DIR=/usr/share/doc/${PF} \
+ EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
+ SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
+ || die "emake install failed"
+
+ find "${D}" -name '*.la' -delete || die
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ newinitd "${S}/libvirtd.init" libvirtd || die
+ newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
+ newinitd "${FILESDIR}/virtlockd.init" virtlockd || die
+
+ keepdir /var/lib/libvirt/images
+
+ 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
+
+ # We really don't want to use or support old PolicyKit cause it
+ # screws with the new polkit integration
+ if has_version sys-auth/policykit; then
+ rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
+ fi
+
+ # Only sysctl files ending in .conf work
+ dodir /etc/sysctl.d
+ mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
+}
+
+pkg_postinst() {
+ if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
+ touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
+ fi
+
+ # support for dropped privileges
+ if use qemu; then
+ fperms 0750 "${EROOT}/var/lib/libvirt/qemu"
+ fperms 0750 "${EROOT}/var/cache/libvirt/qemu"
+ fi
+
+ if use caps && use qemu; then
+ fowners -R qemu:qemu "${EROOT}/var/lib/libvirt/qemu"
+ fowners -R qemu:qemu "${EROOT}/var/cache/libvirt/qemu"
+ elif use qemu; then
+ fowners -R root:root "${EROOT}/var/lib/libvirt/qemu"
+ fowners -R root:root "${EROOT}/var/cache/libvirt/qemu"
+ fi
+
+ if ! use policykit; then
+ elog "To allow normal users to connect to libvirtd you must change the"
+ elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
+ fi
+
+ use libvirtd || return 0
+ # From here, only libvirtd-related instructions, be warned!
+
+ readme.gentoo_print_elog
+
+ if use caps && use qemu; then
+ elog "libvirt will now start qemu/kvm VMs with non-root privileges."
+ elog "Ensure any resources your VMs use are accessible by qemu:qemu"
+ fi
+}