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