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