From 83da384645a8447ab3e4e69b8d9d1b6b98e1390e Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 18 Dec 2014 21:06:06 +0000 Subject: fail prominently in case of config directories being a regular file, bug #532892 Package-Manager: portage-2.2.15/cvs/Linux x86_64 Manifest-Sign-Key: 0xBD3A97A3 --- app-emulation/libvirt/ChangeLog | 10 +- app-emulation/libvirt/Manifest | 33 +- app-emulation/libvirt/files/libvirtd.init-r14 | 139 ++++++++ app-emulation/libvirt/libvirt-1.2.11-r1.ebuild | 452 ------------------------- app-emulation/libvirt/libvirt-1.2.11-r2.ebuild | 452 +++++++++++++++++++++++++ app-emulation/libvirt/libvirt-9999.ebuild | 4 +- 6 files changed, 619 insertions(+), 471 deletions(-) create mode 100644 app-emulation/libvirt/files/libvirtd.init-r14 delete mode 100644 app-emulation/libvirt/libvirt-1.2.11-r1.ebuild create mode 100644 app-emulation/libvirt/libvirt-1.2.11-r2.ebuild diff --git a/app-emulation/libvirt/ChangeLog b/app-emulation/libvirt/ChangeLog index ccdf0c056100..1a69567545af 100644 --- a/app-emulation/libvirt/ChangeLog +++ b/app-emulation/libvirt/ChangeLog @@ -1,6 +1,14 @@ # ChangeLog for app-emulation/libvirt # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.406 2014/12/18 11:15:49 tamiko Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.407 2014/12/18 21:05:55 tamiko Exp $ + +*libvirt-1.2.11-r2 (18 Dec 2014) + + 18 Dec 2014; Matthias Maier +files/libvirtd.init-r14, + +libvirt-1.2.11-r2.ebuild, -libvirt-1.2.11-r1.ebuild, files/libvirtd.init-r13, + libvirt-9999.ebuild: + fail prominently in case of config directories being a regular file, bug + #532892 *libvirt-1.2.11-r1 (18 Dec 2014) diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest index 0db3d4626925..246fb488896e 100644 --- a/app-emulation/libvirt/Manifest +++ b/app-emulation/libvirt/Manifest @@ -9,29 +9,30 @@ AUX libvirt-1.2.9-do_not_use_sysconf.patch 3879 SHA256 1a0c0b29c481097ee218cc752 AUX libvirt-1.2.9-fix-firewalld-configuration.patch 1069 SHA256 0a4116d91fa068e42735624b78b8fa763f7ee251480151033219981ed11a0c4f SHA512 99addf602f9551e7c2dd92d62d9c3170402d3028dee4f4e8f6809c58cbb2c15d971b518ddc83f2688e0e234194e14156c531eb2ceb0cf2b1740dbb5b099b54ed WHIRLPOOL 7d904c54eb2d98cc446700d1e21ab13080c8bd212122fe5dac91882d564b8453c2ea1e509e8b8995c03623f19d6555b8d126cf0e363e062d2ede93ec12cfcda8 AUX libvirtd.confd-r4 2015 SHA256 c2ca5d9a2d4ed433e91bd215c2ca678109cc981072897a497955e36760dc3b9f SHA512 b3e1d2433be7838a35386747422a8f98f2a7f6a92a03089f9472eb8ee2efb7d10d2becd363fea7cdaf8771da31b58cd60d192b25e089b6257ad5341b1074e540 WHIRLPOOL 284e72e704b759433d5ddc1a3e4019164dda6b48cb2734ea9a6780747938bba2855a99dcf1b125ab3f500a6145315cafa4a3531ff6938c0c62e5b1a6f99ea9b3 AUX libvirtd.init-r13 3678 SHA256 5744e7392b0777d14142552237f517ff1fbf6c4734aff96fa340158ceed09e35 SHA512 d50898c07291aefc0025aa51e7f4356c1e5d7b22c3d6d4c31f6da3dc4b23d88e2678568c4f2c755c6763ddce9bfc0e2aedeba52f001daba9ff3cbba2cd57ebf3 WHIRLPOOL 6a8a39b39b7e9d6efca47800e886cbb1e88b9e948c3ac623d120780d34f1fd8bba48c83e445fd0c0bdbff67926fcc577640eb4db0137fb5d703abc6eaf790dfb +AUX libvirtd.init-r14 4349 SHA256 ed8514d347d3a8a0b243cfc25a85dedb1e595f1e29e874bcadd14ef5f5d03e58 SHA512 a2bcde86fb3ad5e30357ff27e2dd7ed5246d0eb432a22f292f8c1a5aaa92499c5a24417836513dd8655da48c3cbc1696e7ce84aa3e200625cebce77f697eb07f WHIRLPOOL 6dc699c3a105593f6ce2152c5ccad0f04aaa4c57e75a4e3abf88592cce67b92f30a77921c321c7cc7f820851b3ce4bcc9b28dcdf20c2f2851551ec458b1fb517 AUX libvirtd.service.conf 401 SHA256 1cfb6f7dec5746364d9a4cccddb4b63f8ccd0ebf8bfaa000b13a09962ca24fac SHA512 27adbd104ea87e51d423b057392a0c6726692ad8ee9723f73dc4bfe8eb54069725d64883434424ba810d36992d404d1ba4afe6bcefb866d3d3d92dfd161c2b32 WHIRLPOOL d6b960b7d18bdbaf0ff6dc5ecf29e7d10e22fa7d16933a149d6287c007d864a0e0dd67048c25a038dd5f73c9ea911d2cd49bf21c072b0c7eab1e92be35d8b545 AUX virtlockd.init 437 SHA256 0894a839f85dff6f97bde514437935f4c1589ba4f2cbd3e0efe28753698694a1 SHA512 3d7b366736fb98acd26577e29a3c00592e7be038634fc3b51891f557426cd9945bf08a4486f1d62aa91ce7dc7d6bf96d7e57ef06a3a0b4aceb55b9e9c9e9b2da WHIRLPOOL d633a1a7358dbf7bd94d70f44753c9c346adfc78537643e5f379cea017d20e1097998ecfaf87e47e4e0f9216d43a3053af24e3129ecfb8f110f5283a769f368f DIST libvirt-1.2.10.tar.gz 30029503 SHA256 5050f4cea3dd59d3eca25c3d3f16085e10d624ecc18bd35820cd3dac6f46c08e SHA512 9cd5d2a604769cf70e388c367abcde27ee8d6d7043227f17dd2cac92a467ea06547374e1d83c7b1ee4c5322d8b3d9e4cbb6db373efae5eaaceed1b1376cbd09d WHIRLPOOL 986c1fd0128101f936897c97a36d646b8893d9ee0a223d05b004d73408a2720aeb9bb5fe3e4a7c476947021b89d955fb4a1b3a64dfe8dfe0d30dbfe75487b8fe DIST libvirt-1.2.11.tar.gz 30571605 SHA256 1b886429734a53fc9a201f46d77448fda963e1323246269eb0dcb4c12fb02fcc SHA512 4aaeb2eeb563f0a9105a1586054d69c24dada12ddf9b71edd3742ad602eb8c892d9f615ee1a2159051bec52699897c6707d9d0204b8f0fe61bae15885ee986f2 WHIRLPOOL b64ee58d633e4b3fec52125bd9b582f7d07045baa66c492fd2b6bc521d994cec95fa460c3a8b32a0f73043ad812e36d81832c31046bbacc280fb2f2764e9bd75 EBUILD libvirt-1.2.10-r2.ebuild 12737 SHA256 91df435d21611b5e8a0a316a148b0d5449360cad43d61f50c271b87ef8e8b91d SHA512 893277721e06f434efa5f54e102620ff4df71d70a910999caed4dd60075e18eb38aa409b743681a367db6043ae360008da9cfd62932967276a52b2dc6e5750ee WHIRLPOOL 81e528bd5fcc722e916cad403d4bab5fc9f256a1c632163140a6bce90310b9195779255468c52d0f61f2f13fca3a10573c50b5b09571defcea1557aa460d2d00 -EBUILD libvirt-1.2.11-r1.ebuild 12679 SHA256 1647f7ee27bdb231244b30750072aa42e86721cc85f30f81b295ea99134a5b18 SHA512 755e79795acf038844500092c976f80dfce73d77ce8ad02b861bbe772c1262b463a26fe4ff7417f01f8698cb082b39307ba69d57ec60325b9ca230e963a8bb7c WHIRLPOOL 5a958a6bc38330333968e6bba1a06d4f5c1ac04e145ff7c20906f611f8fd050ad265326ba4d814b5135af4f2d5b14c1aa69d1ed85591bf69adcb5b165a03203e -EBUILD libvirt-9999.ebuild 12695 SHA256 75ba7a802edf9f0f52c44643ec587b1965f5d354859bf8aff235619c8099373b SHA512 961abd5261fcb3fe01d621e5894677640a640a5c5d0f85a2f6c2484220917fa88f0bf92e8766a7efc7d454e6a756e43bb08d6de81532808994c3280690f1f825 WHIRLPOOL 1b63c28a218b0f30581209bcdae2261677a4d517fb4db2c2ba578f2f25eb407f6394152f63cd43c498e06590038da12d2c2bddb1455c009f0189c03f2eb5772c -MISC ChangeLog 24776 SHA256 45aec433c082ad742036540e46c5d34e39c73b09123e3d5abbd2c486eac2b53c SHA512 ddf6bf3bb78545dc379e74c2a3154b86503e231aa10abc2c6b38fed2ef1d0576b690a83aae905ba585fb8b03cb388c90423f29209d659c7e5b596637c93a7d46 WHIRLPOOL f65050e5def2bf1af182540cf8d37293cfdef8526a26a4e168f752178264c225103d83e60305cbc90870ba20e870176232036e580f6417603a149e607c8e0d52 +EBUILD libvirt-1.2.11-r2.ebuild 12679 SHA256 6e4bad045b0c8cf22dfd2a26e3278636fafb6156f447a2b7a531f8a008283d3b SHA512 7e71e2f98d6871f1fd3084aec1783fd59b85b74dd55dd8cc297f8b501a7b3c911930162eab056b65dfd0af75012e6b6d444767d025b6ecea8438af6755f3041f WHIRLPOOL 9c689c6f015179b618ad4e197d5897f4813b7a8d7157c8293e735559a4111652f3b89ae61156dec8e984e8df180ca0935af85dbf1808d1fd54ee5f48dcd5d774 +EBUILD libvirt-9999.ebuild 12695 SHA256 f984980eaec7fa121b5b5d3d9e44c4b8aed1161f88aebe6bcf9514face3b1540 SHA512 9299a530f8160abde0101dc27da8641bd176907a66d2e792f2d3588b5dea61637ef0e64f8ec07bc10508c6c3d60692209a4aefd0e60d2b0a8ba9d152be0fe255 WHIRLPOOL fb4564bb4e2410259cf7f0093edf6b6845e52275047d308645064a262439eb2646e1fff7af97bf30e4c093e766f6b2262404ea0cdcdd2010e15f28074bed052f +MISC ChangeLog 25076 SHA256 100d0a50164707c05ae2ba925d69deb04e6c516bb1337386dd3ab10ed6efc1fe SHA512 8da6c0153293a54d0d888dbf5069fbdab7801e8adabd2df685cfe33d6e1ca2a3bd157229f03e435244d90bb8c495b4cd03088c7bcad7ab19ff392b9e6446e7c1 WHIRLPOOL 155245e3a8ae140c2ae6fd9afb761cebf101c6fab29f1069ba0a8a9d1f5c208ca64ce13d45362e7c6f852aa1ea727b8e69ba281e02ce6b429fa8aa422a026839 MISC metadata.xml 3604 SHA256 90d98bcf32df9c4ff5d3fc90cdcac46ddc486efa9706b945cbf749d4a1ddcd30 SHA512 35b1fd9faa961efddec324d3721699068b9b2aefb49271f064b3930c9c246a71829f55566438754c34f294db9b8c2ad55386113a72ab11b31cbb604e4afe7816 WHIRLPOOL 6315f8a01134f62a1f7b9845f0e89624bb1edd713b4965a53209b199609ba4f510f0cbb4ee85f348947556cdeee27ab7ae7fcf52b1b9ed82176076d149c00116 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.1 -iQIcBAEBCAAGBQJUkrdmAAoJELhOzYlK7nn/gI8P/3TFQQLvFw0Gsj9kSDRyk6Am -145nLasrRLi3Q3oh88v/AwU1T0cDzvMdHcliGCY7p6bUHYY639yjCWvLmLURyHee -84I8yuKICJWEpvTTZLTIxi+2WHHGdZcv94NNvI3G2eeD72gdOBaNTKs1/q6QjrUj -UQaHX9Fs43S5Y2/IGtTQ75sNTpASHZrK/i3lEYgDIOhQwcj6ZRJjjtmsYtWdtATu -ACGbMxXRrlLaLO0WyjfUSsv/eTfn6A79mMGvIVQ1ZVTTicMjWz5rGW2qOqnQ6J+K -oNnusZY1SfYyh1i9SJNb2zC9g0MIcQW2wHtegjB3CTiMUpB4DiHhJg7tuAKK5f2V -oLQzMMoZCJLpW75QXk6yFCceyRhBA/3owPDJBaNyp/TdXi1XpvixNvlgDuXu1W/n -GiF76dVzZpLxkssfNeLvDFNoCz53Pt3zlvZ81Y7Y7oNFpC1qrpJxiJlF/1C0XZop -640AM/CfuwHeD8I7H8LaT64MefdwKo8NoXFJ0ttc8UUzbg9LvTSfPpnOEY3NUvIp -w6QBx406yX97g6brJ+TyewHaFcqN/+0byzygjzyJPWKEuu9QHB7o8NNfmGnAIOUc -cvLHbsTU6/qIus3PoJf177UsruareHULAxkkjaNjZEfiU+4sSk3ybXENeqisHH/H -K6nsO/a7lIFrS/hRKrK+ -=zFpM +iQIcBAEBCAAGBQJUk0G0AAoJELhOzYlK7nn/FQ0P/1BS1wTP/jfc4vZWi4cu7Mvn +UaKIXXdzzl+h5G5tQudUUwz1PI5+P3/aNEInMO6BXFLvXykkdOeNprNTmmfvTPBn +qxBZEDVOTDk0T73tyN+4pMjIzPAC5ZybfE/54fCAICAqQZyphSieTcfrRs26550B +LWnoQX4CgNBPbYHWQ3yMrlltDL1UZi+rMDOOgcGjwJACvSuYg65SLkSHkaQ/s8qb +EBJAHrIVXeKG7S33xSb3ShmAUJ0w6zRXtkzL78mDpOTjLUZ1lAvKjSMT0tn0hBWC +MOTLpLPe2K7ajHPbsCKnhAzon9kVEnTNpm8fBKuU3zG29WYg5XWabC/LNj76AfRq +1+sKjdRsONHITF6SRwW1Jtc/X9jJZrp3twmiAVPOmfStonF0esdhF2qjitp2uAUO +SZigb2yVV/p9Haz9FWqGi7l8fwyBHl7O8phh9yeskZPt70suAk0N6hD+0bGu/JXb +R3oehf/eltkuxihOpdCoyu/+qc1TovsfX6ZfnNLAepoEb6eu5lvGP8H8ZBwOEm2Y +h7RjqpIgl944Lp5Wif+F0Z+SGao5TqjTzd13WBOMu9Bdj89GQeuqyiTPrlwjR//u +9CloCHnZ4UdrFhNVQgWvc7urTDBjJyGLcEy/l0iZqZVFN3L7YiDwtCAkdN6yl/sV +ZPB9R0Skp7i6gf2HyGiB +=qYwL -----END PGP SIGNATURE----- diff --git a/app-emulation/libvirt/files/libvirtd.init-r14 b/app-emulation/libvirt/files/libvirtd.init-r14 new file mode 100644 index 000000000000..7bab68249eda --- /dev/null +++ b/app-emulation/libvirt/files/libvirtd.init-r14 @@ -0,0 +1,139 @@ +#!/sbin/runscript + +description="Virtual Machine Management daemon (libvirt)" +extra_started_commands="reload halt" +description_halt="Stops the libvirt daemon without stopping your VMs" +description_reload="Restarts the libvirt daemon without stopping your VMs" + +depend() { + USE_FLAG_FIREWALLD + use USE_FLAG_AVAHI USE_FLAG_ISCSI USE_FLAG_RBD dbus virtlockd + after ntp-client ntpd nfs nfsmount portmap rpc.statd iptables ip6tables ebtables corosync sanlock cgconfig xenconsoled +} + +libvirtd_virsh() { + local mode=$1 + shift + + # Silence errors because virsh always throws an error about + # not finding the hypervisor version when connecting to libvirtd + LC_ALL=C virsh -c ${mode}:///system "$@" 2>/dev/null +} + +libvirtd_dom_list() { + # Make sure that it wouldn't be confused if the domain name + # contains the word running. + libvirtd_virsh $1 list | awk '$3 == "running" { print $1 }' +} + +libvirtd_dom_count() { + # Make sure that it wouldn't be confused if the domain name + # contains the word running. + libvirtd_virsh $1 list | awk 'BEGIN { count = 0 } \ + $3 == "running" { count++ } \ + END { print count }' +} + +libvirtd_net_list() { + # The purpose of the awk is to avoid networks with 'active' in the name + libvirtd_virsh $1 net-list | awk '$2 == "active" { print $1 }' +} + +libvirtd_net_count() { + # The purpose of the awk is to avoid networks with 'active' in the name + libvirtd_virsh $1 net-list | awk 'BEGIN { count = 0 } \ + $2 == "active" { count++ } \ + END { print count }' +} + + +start() { + # Test configuration directories in /etc/libvirt/ to be either not + # present or a directory, i.e. not a regular file, bug #532892 + for dir in lxc nwfilter qemu storage; do + if [ -f /etc/libvirt/$dir ]; then + eerror "/etc/libvirt/$dir was created as a regular file. It must be either" + eerror "a directory or not present for libvirtd to start up successfully." + return 1 + fi + done + + ebegin "Starting libvirtd" + start-stop-daemon --start \ + --env KRB5_KTNAME=/etc/libvirt/krb5.tab \ + --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS} + eend $? +} + +stop() { + local counter= + local vm_name= + local net_name= + local dom_id= + + ebegin "Stopping libvirtd" + # try to shutdown all (KVM/Qemu) domains + if [ "${LIBVIRTD_KVM_SHUTDOWN}" != "none" ] \ + && [ "$(libvirtd_dom_count qemu)" != "0" ] ; then + + einfo " Shutting down domain(s):" + for dom_id in $(libvirtd_dom_list qemu) ; do + vm_name="$(libvirtd_virsh qemu domname ${dom_id} | head -n 1)" + einfo " ${vm_name}" + libvirtd_virsh qemu ${LIBVIRTD_KVM_SHUTDOWN} ${dom_id} > /dev/null + done + + if [ -n "${LIBVIRTD_KVM_SHUTDOWN_MAXWAIT}" ] ; then + counter="${LIBVIRTD_KVM_SHUTDOWN_MAXWAIT}" + else + counter=500 + fi + + if [ "${LIBVIRTD_KVM_SHUTDOWN}" = "shutdown" ]; then + einfo " Waiting ${counter} seconds while domains shutdown ..." + DOM_COUNT="$(libvirtd_dom_count qemu)" + while [ ${DOM_COUNT} -gt 0 ] && [ ${counter} -gt 0 ] ; do + DOM_COUNT="$(libvirtd_dom_count qemu)" + sleep 1 + counter=$((${counter} - 1)) + echo -n "." + done + fi + + if [ "$(libvirtd_dom_count qemu)" != "0" ] ; then + eerror " !!! Some guests are still running, stopping anyway" + fi + + fi + + if [ "${LIBVIRTD_KVM_NET_SHUTDOWN}" != "no" ] \ + && [ "$(libvirtd_net_count qemu)" != "0" ]; then + + einfo " Shutting down network(s):" + for net_name in $(libvirtd_net_list qemu); do + einfo " ${net_name}" + libvirtd_virsh qemu net-destroy ${net_name} > /dev/null + done + + if [ "$(libvirtd_net_count qemu)" != "0" ]; then + eerror " !!! Some networks are still active, stopping anyway" + fi + fi + + # Now actually stop the daemon + start-stop-daemon --stop --quiet --exec \ + /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid + eend $? +} + +halt() { + ebegin "Stopping libvirtd without shutting down your VMs" + start-stop-daemon --stop --quiet --exec \ + /usr/sbin/libvirtd --pidfile=/var/run/libvirtd.pid + eend $? +} + +reload() { + halt + start +} diff --git a/app-emulation/libvirt/libvirt-1.2.11-r1.ebuild b/app-emulation/libvirt/libvirt-1.2.11-r1.ebuild deleted file mode 100644 index fc5c03ce1d1a..000000000000 --- a/app-emulation/libvirt/libvirt-1.2.11-r1.ebuild +++ /dev/null @@ -1,452 +0,0 @@ -# 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.11-r1.ebuild,v 1.1 2014/12/18 11:15:49 tamiko Exp $ - -EAPI=5 - -AUTOTOOLIZE=yes - -MY_P="${P/_rc/-rc}" - -inherit eutils user autotools linux-info systemd readme.gentoo - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="git://libvirt.org/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="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz" - else - SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz" - fi - KEYWORDS="~amd64 ~x86" - SLOT="0/${PV}" -fi -S="${WORKDIR}/${P%_rc*}" - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="http://www.libvirt.org/" -LICENSE="LGPL-2.1" -IUSE="audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm lxc \ - +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ - selinux +udev uml +vepa virtualbox virt-network wireshark-plugins 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:0 - >=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 ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( sys-block/open-iscsi ) - lxc? ( !systemd? ( 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 - !systemd? ( sys-power/pm-utils ) - ) - rbd? ( sys-cluster/ceph ) - sasl? ( dev-libs/cyrus-sasl ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - systemd? ( sys-apps/systemd ) - virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) - wireshark-plugins? ( net-analyzer/wireshark:= ) - xen? ( app-emulation/xen-tools app-emulation/xen ) - udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 ) - virt-network? ( net-dns/dnsmasq[script] - >=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 .git-module-status - fi - - epatch "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch - - 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+=" $(use_with libvirtd)" - - ## enable/disable the daemon using avahi to find VMs - myconf+=" $(use_with avahi)" - - ## hypervisors on the local host - 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+=" $(use_with openvz)" - myconf+=" $(use_with lxc)" - if use virtualbox && has_version app-emulation/virtualbox-ose; then - myconf+=" --with-vbox=/usr/lib/virtualbox-ose/" - else - myconf+=" $(use_with virtualbox vbox)" - fi - myconf+=" $(use_with uml)" - myconf+=" $(use_with qemu)" - myconf+=" $(use_with qemu yajl)" # Use QMP over HMP - myconf+=" $(use_with phyp)" - myconf+=" --with-esx" - myconf+=" --with-vmware" - - ## additional host drivers - myconf+=" $(use_with virt-network network)" - myconf+=" --with-storage-fs" - myconf+=" $(use_with lvm storage-lvm)" - myconf+=" $(use_with iscsi storage-iscsi)" - myconf+=" $(use_with parted storage-disk)" - mycond+=" $(use_with glusterfs)" - mycond+=" $(use_with glusterfs storage-gluster)" - myconf+=" $(use_with lvm storage-mpath)" - myconf+=" $(use_with rbd storage-rbd)" - myconf+=" $(use_with numa numactl)" - myconf+=" $(use_with numa numad)" - myconf+=" $(use_with selinux)" - myconf+=" $(use_with fuse)" - - # udev for device support details - myconf+=" $(use_with udev)" - myconf+=" --without-hal" - - # linux capability support so we don't need privileged accounts - myconf+=" $(use_with caps capng)" - - ## auth stuff - myconf+=" $(use_with policykit polkit)" - myconf+=" $(use_with sasl)" - - # network bits - myconf+=" $(use_with macvtap)" - myconf+=" $(use_with pcap libpcap)" - myconf+=" $(use_with vepa virtualport)" - myconf+=" $(use_with firewalld)" - - ## other - myconf+=" $(use_enable nls)" - - # user privilege bits fir qemu/kvm - if use caps; then - myconf+=" --with-qemu-user=qemu" - myconf+=" --with-qemu-group=qemu" - else - myconf+=" --with-qemu-user=root" - myconf+=" --with-qemu-group=root" - fi - - # audit support - myconf+=" $(use_with audit)" - - # wireshark dissector - myconf+=" $(use_with wireshark-plugins wireshark-dissector)" - - ## stuff we don't yet support - myconf+=" --without-netcf" - - # locking support - myconf+=" --without-sanlock" - - # systemd unit files - myconf+=" $(use_with systemd systemd-daemon)" - use systemd && 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 \ - --disable-werror \ - --with-remote \ - --docdir=/usr/share/doc/${PF} \ - --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 - - # Remove bogus, empty directories. They are either not used, or - # libvirtd is able to create them on demand - rm -rf "${D}"/etc/sysconf - rm -rf "${D}"/var/cache - rm -rf "${D}"/var/run - rm -rf "${D}"/var/log - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - use systemd && \ - systemd_install_serviced "${FILESDIR}"/libvirtd.service.conf libvirtd - - newinitd "${S}/libvirtd.init" libvirtd || die - newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die - newinitd "${FILESDIR}/virtlockd.init" virtlockd || die - - 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 - - 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 - - if [[ -n "${REPLACING_VERSIONS}" ]]; then - elog "" - elog "The systemd service-file configuration under /etc/sysconfig has" - elog "been removed. Please use" - elog " /etc/systemd/system/libvirt.d/00gentoo.conf" - elog "to control the '--listen' parameter for libvirtd. The configuration" - elog "for the libvirt-guests.service is now found under" - elog " /etc/libvirt/libvirt-guests.conf" - elog "The openrc configuration has not been changed. Thus no action is" - elog "required for the openrc service manager." - elog "" - fi -} diff --git a/app-emulation/libvirt/libvirt-1.2.11-r2.ebuild b/app-emulation/libvirt/libvirt-1.2.11-r2.ebuild new file mode 100644 index 000000000000..861a5323b409 --- /dev/null +++ b/app-emulation/libvirt/libvirt-1.2.11-r2.ebuild @@ -0,0 +1,452 @@ +# 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.11-r2.ebuild,v 1.1 2014/12/18 21:05:55 tamiko Exp $ + +EAPI=5 + +AUTOTOOLIZE=yes + +MY_P="${P/_rc/-rc}" + +inherit eutils user autotools linux-info systemd readme.gentoo + +if [[ ${PV} = *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="git://libvirt.org/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="http://libvirt.org/sources/stable_updates/${MY_P}.tar.gz" + else + SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz" + fi + KEYWORDS="~amd64 ~x86" + SLOT="0/${PV}" +fi +S="${WORKDIR}/${P%_rc*}" + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="http://www.libvirt.org/" +LICENSE="LGPL-2.1" +IUSE="audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm lxc \ + +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \ + selinux +udev uml +vepa virtualbox virt-network wireshark-plugins 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:0 + >=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 ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( sys-block/open-iscsi ) + lxc? ( !systemd? ( 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 + !systemd? ( sys-power/pm-utils ) + ) + rbd? ( sys-cluster/ceph ) + sasl? ( dev-libs/cyrus-sasl ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + systemd? ( sys-apps/systemd ) + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) ) + wireshark-plugins? ( net-analyzer/wireshark:= ) + xen? ( app-emulation/xen-tools app-emulation/xen ) + udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 ) + virt-network? ( net-dns/dnsmasq[script] + >=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 .git-module-status + fi + + epatch "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch + + 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-r14" "${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+=" $(use_with libvirtd)" + + ## enable/disable the daemon using avahi to find VMs + myconf+=" $(use_with avahi)" + + ## hypervisors on the local host + 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+=" $(use_with openvz)" + myconf+=" $(use_with lxc)" + if use virtualbox && has_version app-emulation/virtualbox-ose; then + myconf+=" --with-vbox=/usr/lib/virtualbox-ose/" + else + myconf+=" $(use_with virtualbox vbox)" + fi + myconf+=" $(use_with uml)" + myconf+=" $(use_with qemu)" + myconf+=" $(use_with qemu yajl)" # Use QMP over HMP + myconf+=" $(use_with phyp)" + myconf+=" --with-esx" + myconf+=" --with-vmware" + + ## additional host drivers + myconf+=" $(use_with virt-network network)" + myconf+=" --with-storage-fs" + myconf+=" $(use_with lvm storage-lvm)" + myconf+=" $(use_with iscsi storage-iscsi)" + myconf+=" $(use_with parted storage-disk)" + mycond+=" $(use_with glusterfs)" + mycond+=" $(use_with glusterfs storage-gluster)" + myconf+=" $(use_with lvm storage-mpath)" + myconf+=" $(use_with rbd storage-rbd)" + myconf+=" $(use_with numa numactl)" + myconf+=" $(use_with numa numad)" + myconf+=" $(use_with selinux)" + myconf+=" $(use_with fuse)" + + # udev for device support details + myconf+=" $(use_with udev)" + myconf+=" --without-hal" + + # linux capability support so we don't need privileged accounts + myconf+=" $(use_with caps capng)" + + ## auth stuff + myconf+=" $(use_with policykit polkit)" + myconf+=" $(use_with sasl)" + + # network bits + myconf+=" $(use_with macvtap)" + myconf+=" $(use_with pcap libpcap)" + myconf+=" $(use_with vepa virtualport)" + myconf+=" $(use_with firewalld)" + + ## other + myconf+=" $(use_enable nls)" + + # user privilege bits fir qemu/kvm + if use caps; then + myconf+=" --with-qemu-user=qemu" + myconf+=" --with-qemu-group=qemu" + else + myconf+=" --with-qemu-user=root" + myconf+=" --with-qemu-group=root" + fi + + # audit support + myconf+=" $(use_with audit)" + + # wireshark dissector + myconf+=" $(use_with wireshark-plugins wireshark-dissector)" + + ## stuff we don't yet support + myconf+=" --without-netcf" + + # locking support + myconf+=" --without-sanlock" + + # systemd unit files + myconf+=" $(use_with systemd systemd-daemon)" + use systemd && 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 \ + --disable-werror \ + --with-remote \ + --docdir=/usr/share/doc/${PF} \ + --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 + + # Remove bogus, empty directories. They are either not used, or + # libvirtd is able to create them on demand + rm -rf "${D}"/etc/sysconf + rm -rf "${D}"/var/cache + rm -rf "${D}"/var/run + rm -rf "${D}"/var/log + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + use systemd && \ + systemd_install_serviced "${FILESDIR}"/libvirtd.service.conf libvirtd + + newinitd "${S}/libvirtd.init" libvirtd || die + newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die + newinitd "${FILESDIR}/virtlockd.init" virtlockd || die + + 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 + + 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 + + if [[ -n "${REPLACING_VERSIONS}" ]]; then + elog "" + elog "The systemd service-file configuration under /etc/sysconfig has" + elog "been removed. Please use" + elog " /etc/systemd/system/libvirt.d/00gentoo.conf" + elog "to control the '--listen' parameter for libvirtd. The configuration" + elog "for the libvirt-guests.service is now found under" + elog " /etc/libvirt/libvirt-guests.conf" + elog "The openrc configuration has not been changed. Thus no action is" + elog "required for the openrc service manager." + elog "" + fi +} diff --git a/app-emulation/libvirt/libvirt-9999.ebuild b/app-emulation/libvirt/libvirt-9999.ebuild index 791db0ecadd0..4703c2587d87 100644 --- a/app-emulation/libvirt/libvirt-9999.ebuild +++ b/app-emulation/libvirt/libvirt-9999.ebuild @@ -1,6 +1,6 @@ # 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-9999.ebuild,v 1.70 2014/12/18 11:15:49 tamiko Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-9999.ebuild,v 1.71 2014/12/18 21:05:55 tamiko Exp $ EAPI=5 @@ -232,7 +232,7 @@ src_prepare() { local iscsi_init= local rbd_init= local firewalld_init= - cp "${FILESDIR}/libvirtd.init-r13" "${S}/libvirtd.init" + cp "${FILESDIR}/libvirtd.init-r14" "${S}/libvirtd.init" use avahi && avahi_init='avahi-daemon' use iscsi && iscsi_init='iscsid' use rbd && rbd_init='ceph' -- cgit v1.2.3-65-gdbad