Gentoo Archives: gentoo-commits

From: "Doug Goldstein (cardoe)" <cardoe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in app-emulation/libvirt: libvirt-1.1.0-r4.ebuild ChangeLog
Date: Mon, 29 Jul 2013 19:49:18
Message-Id: 20130729194915.035792171C@flycatcher.gentoo.org
1 cardoe 13/07/29 19:49:14
2
3 Modified: ChangeLog
4 Added: libvirt-1.1.0-r4.ebuild
5 Log:
6 Handful of stability fixes (races and qemu compat) from upstream.
7
8 (Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key D7DFA8D318FA9AEF!)
9
10 Revision Changes Path
11 1.297 app-emulation/libvirt/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.297&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.297&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?r1=1.296&r2=1.297
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v
20 retrieving revision 1.296
21 retrieving revision 1.297
22 diff -u -r1.296 -r1.297
23 --- ChangeLog 20 Jul 2013 13:02:44 -0000 1.296
24 +++ ChangeLog 29 Jul 2013 19:49:14 -0000 1.297
25 @@ -1,6 +1,11 @@
26 # ChangeLog for app-emulation/libvirt
27 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
28 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.296 2013/07/20 13:02:44 cardoe Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.297 2013/07/29 19:49:14 cardoe Exp $
30 +
31 +*libvirt-1.1.0-r4 (29 Jul 2013)
32 +
33 + 29 Jul 2013; Doug Goldstein <cardoe@g.o> +libvirt-1.1.0-r4.ebuild:
34 + Handful of stability fixes (races and qemu compat) from upstream.
35
36 20 Jul 2013; Doug Goldstein <cardoe@g.o> libvirt-1.0.5.4.ebuild:
37 stable the stable series
38
39
40
41 1.1 app-emulation/libvirt/libvirt-1.1.0-r4.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.1.0-r4.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.1.0-r4.ebuild?rev=1.1&content-type=text/plain
45
46 Index: libvirt-1.1.0-r4.ebuild
47 ===================================================================
48 # Copyright 1999-2013 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/libvirt-1.1.0-r4.ebuild,v 1.1 2013/07/29 19:49:14 cardoe Exp $
51
52 EAPI=5
53
54 BACKPORTS=4785c033
55 AUTOTOOLIZE=yes
56
57 MY_P="${P/_rc/-rc}"
58
59 PYTHON_COMPAT=( python{2_5,2_6,2_7} )
60
61 inherit eutils python-single-r1 user autotools linux-info systemd
62
63 if [[ ${PV} = *9999* ]]; then
64 inherit git-2
65 EGIT_REPO_URI="git://libvirt.org/libvirt.git"
66 AUTOTOOLIZE=yes
67 SRC_URI=""
68 KEYWORDS=""
69 else
70 SRC_URI="http://libvirt.org/sources/${MY_P}.tar.gz
71 ftp://libvirt.org/libvirt/${MY_P}.tar.gz
72 ${BACKPORTS:+
73 http://dev.gentoo.org/~cardoe/distfiles/${MY_P}-${BACKPORTS}.tar.xz}"
74 KEYWORDS="~amd64 ~x86"
75 fi
76 S="${WORKDIR}/${P%_rc*}"
77
78 DESCRIPTION="C toolkit to manipulate virtual machines"
79 HOMEPAGE="http://www.libvirt.org/"
80 LICENSE="LGPL-2.1"
81 SLOT="0"
82 IUSE="audit avahi +caps firewalld fuse iscsi +libvirtd lvm lxc +macvtap nfs \
83 nls numa openvz parted pcap phyp policykit python +qemu rbd sasl \
84 selinux +udev uml +vepa virtualbox virt-network xen elibc_glibc \
85 systemd"
86 REQUIRED_USE="libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
87 lxc? ( caps libvirtd )
88 openvz? ( libvirtd )
89 qemu? ( libvirtd )
90 uml? ( libvirtd )
91 vepa? ( macvtap )
92 virtualbox? ( libvirtd )
93 xen? ( libvirtd )
94 virt-network? ( libvirtd )
95 firewalld? ( virt-network )
96 python? ( ${PYTHON_REQUIRED_USE} )"
97
98 # gettext.sh command is used by the libvirt command wrappers, and it's
99 # non-optional, so put it into RDEPEND.
100 # We can use both libnl:1.1 and libnl:3, but if you have both installed, the
101 # package will use 3 by default. Since we don't have slot pinning in an API,
102 # we must go with the most recent
103 RDEPEND="sys-libs/readline
104 sys-libs/ncurses
105 >=net-misc/curl-7.18.0
106 dev-libs/libgcrypt
107 >=dev-libs/libxml2-2.7.6
108 dev-libs/libnl:3
109 >=net-libs/gnutls-1.0.25
110 net-libs/libssh2
111 sys-apps/dmidecode
112 >=sys-apps/util-linux-2.17
113 sys-devel/gettext
114 >=net-analyzer/netcat6-1.0-r2
115 app-misc/scrub
116 audit? ( sys-process/audit )
117 avahi? ( >=net-dns/avahi-0.6[dbus] )
118 caps? ( sys-libs/libcap-ng )
119 fuse? ( >=sys-fs/fuse-2.8.6 )
120 iscsi? ( sys-block/open-iscsi )
121 lxc? ( sys-power/pm-utils )
122 lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
123 nfs? ( net-fs/nfs-utils )
124 numa? (
125 >sys-process/numactl-2.0.2
126 sys-process/numad
127 )
128 openvz? ( sys-kernel/openvz-sources )
129 parted? (
130 >=sys-block/parted-1.8[device-mapper]
131 sys-fs/lvm2
132 )
133 pcap? ( >=net-libs/libpcap-1.0.0 )
134 policykit? ( >=sys-auth/polkit-0.9 )
135 python? ( ${PYTHON_DEPS} )
136 qemu? (
137 >=app-emulation/qemu-0.13.0
138 dev-libs/yajl
139 sys-power/pm-utils
140 )
141 rbd? ( sys-cluster/ceph )
142 sasl? ( dev-libs/cyrus-sasl )
143 selinux? ( >=sys-libs/libselinux-2.0.85 )
144 virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
145 xen? ( app-emulation/xen-tools app-emulation/xen )
146 udev? ( virtual/udev >=x11-libs/libpciaccess-0.10.9 )
147 virt-network? ( net-dns/dnsmasq
148 >=net-firewall/iptables-1.4.10
149 net-misc/radvd
150 net-firewall/ebtables
151 sys-apps/iproute2[-minimal]
152 firewalld? ( net-firewall/firewalld )
153 )
154 elibc_glibc? ( || ( >=net-libs/libtirpc-0.2.2-r1 <sys-libs/glibc-2.14 ) )"
155 # one? ( dev-libs/xmlrpc-c )
156 DEPEND="${RDEPEND}
157 virtual/pkgconfig
158 app-text/xhtml1
159 dev-lang/perl
160 dev-libs/libxslt"
161
162 LXC_CONFIG_CHECK="
163 ~CGROUPS
164 ~CGROUP_FREEZER
165 ~CGROUP_DEVICE
166 ~CGROUP_CPUACCT
167 ~CGROUP_SCHED
168 ~CGROUP_PERF
169 ~BLK_CGROUP
170 ~NET_CLS_CGROUP
171 ~NETPRIO_CGROUP
172 ~CPUSETS
173 ~RESOURCE_COUNTERS
174 ~NAMESPACES
175 ~UTS_NS
176 ~IPC_NS
177 ~PID_NS
178 ~NET_NS
179 ~DEVPTS_MULTIPLE_INSTANCES
180 ~VETH
181 ~MACVLAN
182 ~POSIX_MQUEUE
183 ~!GRKERNSEC_CHROOT_MOUNT
184 ~!GRKERNSEC_CHROOT_DOUBLE
185 ~!GRKERNSEC_CHROOT_PIVOT
186 ~!GRKERNSEC_CHROOT_CHMOD
187 ~!GRKERNSEC_CHROOT_CAPS
188 "
189
190 VIRTNET_CONFIG_CHECK="
191 ~BRIDGE_NF_EBTABLES
192 ~BRIDGE_EBT_MARK_T
193 ~NETFILTER_ADVANCED
194 ~NETFILTER_XT_TARGET_CHECKSUM
195 ~NETFILTER_XT_CONNMARK
196 ~NETFILTER_XT_MARK
197 "
198
199 MACVTAP_CONFIG_CHECK="~MACVTAP"
200
201 pkg_setup() {
202 enewgroup qemu 77
203 enewuser qemu 77 -1 -1 qemu kvm
204
205 # Some people used the masked ebuild which was not adding the qemu
206 # user to the kvm group originally. This results in VMs failing to
207 # start for some users. bug #430808
208 egetent group kvm | grep -q qemu
209 if [[ $? -ne 0 ]]; then
210 gpasswd -a qemu kvm
211 fi
212
213 python-single-r1_pkg_setup
214
215 # Handle specific kernel versions for different features
216 kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
217 kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
218
219 CONFIG_CHECK=""
220 use fuse && CONFIG_CHECK+=" ~FUSE_FS"
221 use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
222 use macvtap && CONFIG_CHECK+="${MACVTAP}"
223 use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
224 if [[ -n ${CONFIG_CHECK} ]]; then
225 linux-info_pkg_setup
226 fi
227 }
228
229 src_prepare() {
230 touch "${S}/.mailmap"
231 [[ -n ${BACKPORTS} ]] && \
232 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
233 epatch
234
235 if [[ ${PV} = *9999* ]]; then
236
237 # git checkouts require bootstrapping to create the configure script.
238 # Additionally the submodules must be cloned to the right locations
239 # bug #377279
240 ./bootstrap || die "bootstrap failed"
241 (
242 git submodule status | sed 's/^[ +-]//;s/ .*//'
243 git hash-object bootstrap.conf
244 ) >.git-module-status
245 fi
246
247 epatch_user
248
249 [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
250
251 # Tweak the init script
252 local avahi_init=
253 local iscsi_init=
254 local rbd_init=
255 local firewalld_init=
256 cp "${FILESDIR}/libvirtd.init-r12" "${S}/libvirtd.init"
257 use avahi && avahi_init='avahi-daemon'
258 use iscsi && iscsi_init='iscsid'
259 use rbd && rbd_init='ceph'
260 use firewalld && firewalld_init='need firewalld'
261
262 sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
263 sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
264 sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
265 sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
266 }
267
268 src_configure() {
269 local myconf=""
270
271 ## enable/disable daemon, otherwise client only utils
272 myconf="${myconf} $(use_with libvirtd)"
273
274 ## enable/disable the daemon using avahi to find VMs
275 myconf="${myconf} $(use_with avahi)"
276
277 ## hypervisors on the local host
278 myconf="${myconf} $(use_with xen) $(use_with xen xen-inotify)"
279 myconf+=" --without-xenapi"
280 if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
281 myconf+=" --with-libxl"
282 else
283 myconf+=" --without-libxl"
284 fi
285 myconf="${myconf} $(use_with openvz)"
286 myconf="${myconf} $(use_with lxc)"
287 if use virtualbox && has_version app-emulation/virtualbox-ose; then
288 myconf="${myconf} --with-vbox=/usr/lib/virtualbox-ose/"
289 else
290 myconf="${myconf} $(use_with virtualbox vbox)"
291 fi
292 myconf="${myconf} $(use_with uml)"
293 myconf="${myconf} $(use_with qemu)"
294 myconf="${myconf} $(use_with qemu yajl)" # Use QMP over HMP
295 myconf="${myconf} $(use_with phyp)"
296 myconf="${myconf} --with-esx"
297 myconf="${myconf} --with-vmware"
298
299 ## additional host drivers
300 myconf="${myconf} $(use_with virt-network network)"
301 myconf="${myconf} --with-storage-fs"
302 myconf="${myconf} $(use_with lvm storage-lvm)"
303 myconf="${myconf} $(use_with iscsi storage-iscsi)"
304 myconf="${myconf} $(use_with parted storage-disk)"
305 myconf="${myconf} $(use_with lvm storage-mpath)"
306 myconf="${myconf} $(use_with rbd storage-rbd)"
307 myconf="${myconf} $(use_with numa numactl)"
308 myconf="${myconf} $(use_with numa numad)"
309 myconf="${myconf} $(use_with selinux)"
310 myconf="${myconf} $(use_with fuse)"
311
312 # udev for device support details
313 myconf="${myconf} $(use_with udev)"
314
315 # linux capability support so we don't need privileged accounts
316 myconf="${myconf} $(use_with caps capng)"
317
318 ## auth stuff
319 myconf="${myconf} $(use_with policykit polkit)"
320 myconf="${myconf} $(use_with sasl)"
321
322 # network bits
323 myconf="${myconf} $(use_with macvtap)"
324 myconf="${myconf} $(use_with pcap libpcap)"
325 myconf="${myconf} $(use_with vepa virtualport)"
326 myconf="${myconf} $(use_with firewalld)"
327
328 ## other
329 myconf="${myconf} $(use_enable nls)"
330 myconf="${myconf} $(use_with python)"
331
332 # user privilege bits fir qemu/kvm
333 if use caps; then
334 myconf="${myconf} --with-qemu-user=qemu"
335 myconf="${myconf} --with-qemu-group=qemu"
336 else
337 myconf="${myconf} --with-qemu-user=root"
338 myconf="${myconf} --with-qemu-group=root"
339 fi
340
341 # audit support
342 myconf="${myconf} $(use_with audit)"
343
344 ## stuff we don't yet support
345 myconf="${myconf} --without-netcf"
346
347 # we use udev over hal
348 myconf="${myconf} --without-hal"
349
350 # locking support
351 myconf="${myconf} --without-sanlock"
352
353 # systemd unit files
354 use systemd && myconf="${myconf} --with-init-script=systemd"
355
356 # this is a nasty trick to work around the problem in bug
357 # #275073. The reason why we don't solve this properly is that
358 # it'll require us to rebuild autotools (and we don't really want
359 # to do that right now). The proper solution has been sent
360 # upstream and should hopefully land in 0.7.7, in the mean time,
361 # mime the same functionality with this.
362 case ${CHOST} in
363 *cygwin* | *mingw* )
364 ;;
365 *)
366 ac_cv_prog_WINDRES=no
367 ;;
368 esac
369
370 econf \
371 ${myconf} \
372 --disable-static \
373 --docdir=/usr/share/doc/${PF} \
374 --with-remote \
375 --localstatedir=/var
376
377 if [[ ${PV} = *9999* ]]; then
378 # Restore gnulib's config.sub and config.guess
379 # bug #377279
380 (cd .gnulib && git reset --hard > /dev/null)
381 fi
382 }
383
384 src_test() {
385 # Explicitly allow parallel build of tests
386 export VIR_TEST_DEBUG=1
387 HOME="${T}" emake check || die "tests failed"
388 }
389
390 src_install() {
391 emake install \
392 DESTDIR="${D}" \
393 HTML_DIR=/usr/share/doc/${PF}/html \
394 DOCS_DIR=/usr/share/doc/${PF} \
395 EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
396 SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
397 || die "emake install failed"
398
399 find "${D}" -name '*.la' -delete || die
400
401 use libvirtd || return 0
402 # From here, only libvirtd-related instructions, be warned!
403
404 newinitd "${S}/libvirtd.init" libvirtd || die
405 newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
406
407 keepdir /var/lib/libvirt/images
408
409 use python && python_optimize
410 }
411
412 pkg_preinst() {
413 # we only ever want to generate this once
414 if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
415 rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
416 fi
417
418 # We really don't want to use or support old PolicyKit cause it
419 # screws with the new polkit integration
420 if has_version sys-auth/policykit; then
421 rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
422 fi
423
424 # Only sysctl files ending in .conf work
425 mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
426 }
427
428 pkg_postinst() {
429 if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
430 touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
431 fi
432
433 # support for dropped privileges
434 if use qemu; then
435 fperms 0750 "${EROOT}/var/lib/libvirt/qemu"
436 fperms 0750 "${EROOT}/var/cache/libvirt/qemu"
437 fi
438
439 if use caps && use qemu; then
440 fowners -R qemu:qemu "${EROOT}/var/lib/libvirt/qemu"
441 fowners -R qemu:qemu "${EROOT}/var/cache/libvirt/qemu"
442 elif use qemu; then
443 fowners -R root:root "${EROOT}/var/lib/libvirt/qemu"
444 fowners -R root:root "${EROOT}/var/cache/libvirt/qemu"
445 fi
446
447 if ! use policykit; then
448 elog "To allow normal users to connect to libvirtd you must change the"
449 elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
450 fi
451
452 use libvirtd || return 0
453 # From here, only libvirtd-related instructions, be warned!
454
455 elog
456 elog "For the basic networking support (bridged and routed networks)"
457 elog "you don't need any extra software. For more complex network modes"
458 elog "including but not limited to NATed network, you can enable the"
459 elog "'virt-network' USE flag."
460 elog
461 if has_version net-dns/dnsmasq; then
462 ewarn "If you have a DNS server setup on your machine, you will have"
463 ewarn "to configure /etc/dnsmasq.conf to enable the following settings: "
464 ewarn " bind-interfaces"
465 ewarn " interface or except-interface"
466 ewarn
467 ewarn "Otherwise you might have issues with your existing DNS server."
468 fi
469
470 if use caps && use qemu; then
471 elog "libvirt will now start qemu/kvm VMs with non-root privileges."
472 elog "Ensure any resources your VMs use are accessible by qemu:qemu"
473 fi
474 }