diff options
author | Doug Goldstein <cardoe@gentoo.org> | 2013-10-22 02:00:42 +0000 |
---|---|---|
committer | Doug Goldstein <cardoe@gentoo.org> | 2013-10-22 02:00:42 +0000 |
commit | 86f5d04d77153166d912675a820a80a088ff63fe (patch) | |
tree | 029519f764451262462b7d7dcafeee307bf7d16f /app-emulation/libvirt | |
parent | fix mod_spdy mask to point to existing apache bug (diff) | |
download | historical-86f5d04d77153166d912675a820a80a088ff63fe.tar.gz historical-86f5d04d77153166d912675a820a80a088ff63fe.tar.bz2 historical-86f5d04d77153166d912675a820a80a088ff63fe.zip |
Fix for CVE-2013-4400 and CVE-2013-4401.
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/ChangeLog | 7 | ||||
-rw-r--r-- | app-emulation/libvirt/Manifest | 28 | ||||
-rw-r--r-- | app-emulation/libvirt/libvirt-1.1.3-r1.ebuild | 432 |
3 files changed, 451 insertions, 16 deletions
diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog index 761e295a39a8..ae8d341a691f 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.332 2013/10/13 10:32:11 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.333 2013/10/22 02:00:33 cardoe Exp $ + +*libvirt-1.1.3-r1 (22 Oct 2013) + + 22 Oct 2013; Doug Goldstein <cardoe@gentoo.org> +libvirt-1.1.3-r1.ebuild: + Fix for CVE-2013-4400 and CVE-2013-4401. 13 Oct 2013; Agostino Sarubbo <ago@gentoo.org> libvirt-1.1.3.ebuild: Stable for x86, wrt bug #487684 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest index aee019b3af8a..fc86dc9a7b05 100644 --- a/app-emulation/libvirt/Manifest +++ b/app-emulation/libvirt/Manifest @@ -1,5 +1,5 @@ -----BEGIN PGP SIGNED MESSAGE----- -Hash: SHA512 +Hash: SHA256 AUX libvirtd.confd-r4 2015 SHA256 c2ca5d9a2d4ed433e91bd215c2ca678109cc981072897a497955e36760dc3b9f SHA512 b3e1d2433be7838a35386747422a8f98f2a7f6a92a03089f9472eb8ee2efb7d10d2becd363fea7cdaf8771da31b58cd60d192b25e089b6257ad5341b1074e540 WHIRLPOOL 284e72e704b759433d5ddc1a3e4019164dda6b48cb2734ea9a6780747938bba2855a99dcf1b125ab3f500a6145315cafa4a3531ff6938c0c62e5b1a6f99ea9b3 AUX libvirtd.init-r12 3668 SHA256 bae1b0766423b8ff879a7490a2b3e6381029638558923d8c0047414e97b881a5 SHA512 b24cf7dd0f6db454bb23bf4e9c4d40050f6d5aaa43f5b95a04238e028f1cb5c735ba605f6f01caf814f2d2a36407abc6fd1d751e66887fc7af78d543e4b61dd6 WHIRLPOOL 3c04c3acfa061144d16e1e9f2b35e37437855b0162d3ce0d7d3d39618fcfe855d8e82fdf4e16aee8d6cc591424d3d0875a32edd02646e02203b5ca239b7f5d64 @@ -7,29 +7,27 @@ DIST libvirt-1.0.5.6.tar.gz 23998470 SHA256 171e2497d4d4109f4839f6f4b727b92f0253 DIST libvirt-1.1.2-2a32bbbf.tar.xz 8824 SHA256 38d49c3c5f28b809ccce011f23690181f0191a8f50ea2fce882f26637b29af58 SHA512 6fc13dd3766502a2dcb8dc452b8a69c89e1bf84fd800cadc407d6f927294e795814e42e6479d0bd228f457abdb89c7220b19d4c24e60a0c44ba4f1d5385034af WHIRLPOOL 1bcd0ba80eb603ccce5cfe3ac18e143327ecc098b640351bbc5e727f44b1963758a375718e71e33d3e80a5541633d816d8729a3ce431df8d139321b0af8b9d30 DIST libvirt-1.1.2-e89bdf01.tar.xz 1776 SHA256 ff85291f594221a6fbf8ad39d577bdec776f4c22081c7904c4463f8bed50ce5b SHA512 357b03c7e1b4a4b3e0a862d92fd81b800c58cd702c4c88228397ef06b1125f1b565b28821a3a62d93a01338ad70987509836d677051718c1174dc82078ae6855 WHIRLPOOL e3e8dec57def09e9f1aed29571befcb73095ec0b61730361556e745a5732f1744d58e448db768aef82bd6033cd40471f7c7c7a2432623f6e3ee921fca1e2f571 DIST libvirt-1.1.2.tar.gz 26069691 SHA256 16648af54d3e162f5cc5445d970ec29a0bd55b1dbcb568a05533c4c2f25965e3 SHA512 9244640221393abe3c4e48a5a5b87838af4f20ae0664949a5c116aa1dd4568818c41b52077274ade907310fd22a627bde69df1cd53c6c398d10f98f83c217b2c WHIRLPOOL 7fcf575016f26a3570fafe9fc22edc0bd35d01dfeb93a3c90d5c90770677cd07bafb3057de0857961f082c174bd42fd9a88ecb049c42a7388557ab7f51737c86 +DIST libvirt-1.1.3-062ad8b2.tar.xz 18836 SHA256 a16a72d9cc6b49564e234b39f94a987e20da9fd511203ec1cb4534ccf4570121 SHA512 0734836972ef3e7a2d8bcb1d1ab001b3f15202c2921107c28a17f6ccf4002849c920133969b611560a88ca7f969eea468b1a8bc14b432b270f624c6594fc1ade WHIRLPOOL 340ca175f7322ede982455ba311a19cd5cbb33ea49e1fa3a7ab13a0fdb31c37a8a0fc58cec189efb19a861a21d6c677c3c3533e58e9fb9eaa4ce0f3dde721ec9 DIST libvirt-1.1.3-e3fb8465.tar.xz 9176 SHA256 868819430f7d1af65498c5212b8a9ac17b0af2c05ca2aba9d84b2ea680ffc0fe SHA512 61567d47165d788ebb485ca862b1d08bd507aca7d06376742fa44097498a9c684d2536f9573b09ce1fd8bd25ce36ed189359eefb4b01e5e7c50e3636df0bf62f WHIRLPOOL ebec68ce6b20528c040eec7f3f2a1ec38252d24e939fa4f362577a70d5cec88f51eac04379da5470e09b79bcf4d3ebbecc95f4d5a4285b37559f6c0a3ad5a63e DIST libvirt-1.1.3.tar.gz 26578000 SHA256 af83e65b4b26520662ddd183c1358be0d05138dba3e66745419f06441eff5a7c SHA512 895f8ccf1fdf7a36918e4d460b44b1bf67d06842e39142c89c620f6191e299b53c50f80ab47677d7cba6bd570177d79b5ee0d7d2a11472991590389db51fab9d WHIRLPOOL c046f1182976bbd6bf65b460b2017996e63f67b5cce44f0af859d90f892278d0236192e6e7172e16c85183da6e258a003d9c8757af2079ab4d77de9ca300d986 EBUILD libvirt-1.0.5.6.ebuild 12205 SHA256 20c104ed84fb850487f096eb618c8c3369215403969cd8c00d9633de06b101bb SHA512 ad0ba8164cc8c298e7ec6b81f52c4a91355a9bfd3a6fb467f887b087bb93555e0c5dc4cc5bd1b5239453a9885ebc18342e9177d3a1d84d640b9ebfdc67803037 WHIRLPOOL f40672d2adf8381ef60f1a98d3fe29d25cce6aa92549ff446f714e6ba6541581c41668507ae9313e0d7cc528e5b990544b42dee039844e2224aea2dda4e211eb EBUILD libvirt-1.1.2-r1.ebuild 12177 SHA256 5dace7992556f39d2edabe1b5b22c248342ef1a23ee80249225dbd56a5300a0b SHA512 c15f5b26e36e0c9d76570496d5c92d73089ee002d37b6c7b55e70234bac189b5052c7b84735433bb6dc3225654b0fccb4e449119d3250405019f8ab6e845a03c WHIRLPOOL de2343768f3a91749f9cb97a4ff3bea72ace005343ae462f53b3a609c08b93ac33c235427c009dc5eed714d6e922a58a27ed0a958dc8639fde268a94a54d3d16 EBUILD libvirt-1.1.2-r3.ebuild 12174 SHA256 6004b986767cb566c7fddb2dcfab3c780abf5cbe8ef7cbab16e9369c495b62e9 SHA512 a96d035c948f91d5e987f120f9504f2b2b07647a5c22c3308b3f7dea835b2d250272f2bf669c11c26a90dab21d94ab4cff7740e3487bfbdd9982c13ee9a5cd85 WHIRLPOOL 48e28a4602859aed25bf3054401292d0f9e39da945421f470c3f49c462bed72c8d207b8a5930455aaddb024dfc4793e4c5de5f583289c1d41450327452951564 +EBUILD libvirt-1.1.3-r1.ebuild 12179 SHA256 5eefb67e188fc57599e1beff4fe975571f84b3adfa91f640462116b4d1cacd4a SHA512 1e5f1c2508b271f79bc6e1bfbbd70f04e7b66e13a8c13977e2595f8967011098fa5be885628fecad6fb95221297542f95690323b1ddec9b941ed93700bc77032 WHIRLPOOL 34f36f433aec88298c050380e0a70154a890f81e74d41e923e2a7ba73b2e0b2ba9f9816b9643795453bb7b088ed6e1fcdcb789185a961e38657b57c0ebf6259f EBUILD libvirt-1.1.3.ebuild 12171 SHA256 9736e059603828c2a6a8d0c98ecc76b974af6ef7da5155588d17f28a5ebd8c12 SHA512 2f56a9c1d04cebbd1f3172dc1bff78b86bbdca27bacb1b1ac60a3284fb7d40573bc5c237eeee6b1d060eb0b58015c83aa1be4eb26a362668e169c5e967b207d7 WHIRLPOOL 4bd87b052a353c0b68e92ec42dff49722ec5d3fb2ce88324315495137b32439b68372a699c6a5f8e8a0a9bb4e4762a269bae71b0050f8f1a271f90e383c93f80 EBUILD libvirt-9999.ebuild 12208 SHA256 e1ea83ef974e4df786f5596bf4175837cb8f1831de4663563601407cb467350e SHA512 4f6e6fae2f3cd91d564a0e165f68549c2d1dc6041439069ada6413dcd52479f1fc555ddc551dcd3b9fd8cdd70bbfbc3d703deba48ecb11cee1a91669c97834ff WHIRLPOOL cf62713f0bd424483983c5c5cf2493c67d236b0831de1d6c7038b142098b48e3a7920ee024727b1d5da3c6d2f998907dafa29a9ae6ab517a835d2d957df56908 -MISC ChangeLog 13252 SHA256 32c7365d5075fcd144ecf71d53406fcb241149c1890914d8f15825a1d628e734 SHA512 9b41f6bfacddae8714018fb630983f21fe54021634b9cd3670fb4cb57fddc81108f7b40022172712ea95fc32de96cc8dbed742818ec6639ccc704792812b8841 WHIRLPOOL c837ba6c5f10fae2ed5895d43f7656650ca85e5c75b9dfe967a7afd2467ebb6e1c0e6ef79a255c87b79836e637f374a27c3fd83fe01bb766da213e340ccd3e13 +MISC ChangeLog 13408 SHA256 898009e5dcb570741febc2e1082d5fdf4eeadffc70e412d0f8876fac9a841be2 SHA512 73124f8cde7cba4cda8083f905b68e4b0aa16bf8ce1243ac1cd7507b9fd2f4fd585d96b89ec7a6022263bed1d27667e1f655a32ddc0083510a52fe1477ae85e0 WHIRLPOOL 57a3f7991113bec9a476af365b956dba32e8070257372d0ebb52f5b01ed142f9f539fb68db3c24652a6cea22dc6a5b44641cfa7828602769baa4428aa603b571 MISC metadata.xml 3534 SHA256 8678edfd233eaa04266d7e15f71102fb45d1e4843697ba0cd04fe57b45dbb6c6 SHA512 e4b2cc5f9001697b784034ae6e58fea39e9fdc223192772592bcb671a4e1436186ed7757fc72993ee81c1e4005502fbb8c0a2d4588666a186d42024a98c052a2 WHIRLPOOL 9f32ac2763d17e5204da7396eae2a8c79c63e1e82b4a1035c86d93c029902159d3f5697aad86b7307b6e8acee0a4f0f02023d0e5e824a471cdad80a5cebc6886 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) -iQIcBAEBCgAGBQJSWnaiAAoJELp701BxlEWftIwQAI0k9fDxw540c33i6CjK94yV -8yIPaAvk54teo0tPfQUjMTg6asj6VnoRZWIsjzCvYHtVc7Vb2p30ui6tfjUXnJR/ -Fi+/Dovp7qvEe3R9rzI0c5hLUm+tIy3Mh5da8jG1L/xHiLGhkXY1tNsf0u8K/PvL -Uy/SeAiXphCL/qWuYI9rnlBEq7zeDgMdqbvD7zPqPdPNm5ZBpE+dltzuhAWPMtN4 -BfLb5pKaKVduJScFPuCGBti3KN9cw4f98aZynJTg9EMHesmZmwxSHPulk1/Ku81+ -xGPTmoH6LJhdDL+hkTJbM4Xd6kuXJfisPmCxhLRXoSGcyE8hMynHrnFjj1CqNRyN -+MNDatcvDP2t8Pc3CrpUWBQjTVotxGI1FnlENOLGmfN+Gl5j8R2KMvV3sOaAAyoz -k2sysAOpAftqhIPzC+EifDOIVW8P3fCBI4F5HwxoMsm8p0QglUHO7n3fIW24lPuM -kPNbTwFIlcOCwvkvzTWELqLDVnRBToefHni8jYNe079/7+toJuolnH9FKY6ofhV6 -A3qpwa6yJ/1M2hU48VNrP3SkSPMVBWJcLzx5RTdCR9YcTGTWIf8XTiDeZX8dNa4f -xlGz4I6vl60HObM9FTSYavnhSMTn0/oOi8bf4kDcC+7HWS44LLrJPTrhOL+W5lPw -WrkW5MNvYoxtKy+Ui6zE -=Wnlk +iQF8BAEBCABmBQJSZdxFXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w +ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDMDRGNEJFMDZEQTJGRUY3NkI4MEM3NTlE +N0RGQThEMzE4RkE5QUVGAAoJENffqNMY+prvLvwH/jXif7MAD/jibD/iIisAj9il +lQ/VGZHyZ1WUS1oUyNM21bXLQE9GzZ/dlXi3MbPPkiQQA4BT6uY9bGfanedTfP5l +hnQJ0F8Rx2QaYZBXUg7xMH4UfOq0yZW+dSVQr1DApzAgzIf8hGyjfh9X6sBQ0FN+ ++p69er83F9nTh6gvMK3EFImqksHEovl75dYrc9AYNGxrAsnfGnR+bKtll55Ku7aw +ym/ugNnwnDGIeKAKYVM4qKdG8Y7EDDTbc6+UAnPAqp/jGIoC6SIl9eBkFprhQ+1F +utHsAm35CCjDH9/iKTj9AABWpMvftBrV35snGgr+hrMIs9HebCWjYOt0BNHMYvA= +=nOPQ -----END PGP SIGNATURE----- diff --git a/app-emulation/libvirt/libvirt-1.1.3-r1.ebuild b/app-emulation/libvirt/libvirt-1.1.3-r1.ebuild new file mode 100644 index 000000000000..8ed44475540d --- /dev/null +++ b/app-emulation/libvirt/libvirt-1.1.3-r1.ebuild @@ -0,0 +1,432 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.1.3-r1.ebuild,v 1.1 2013/10/22 02:00:33 cardoe Exp $ + +EAPI=5 + +BACKPORTS=062ad8b2 +AUTOTOOLIZE=yes + +MY_P="${P/_rc/-rc}" + +PYTHON_COMPAT=( python{2_6,2_7} ) + +inherit eutils python-single-r1 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" +IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \ + nls numa openvz parted pcap phyp policykit python +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 ) + python? ( ${PYTHON_REQUIRED_USE} )" + +# 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 ) + python? ( ${PYTHON_DEPS} ) + 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" + +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 + + python-single-r1_pkg_setup + + # 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-r12" "${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)" + myconf="${myconf} $(use_with python)" + + # 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 + + keepdir /var/lib/libvirt/images + + use python && python_optimize + + 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 +} |