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.1-r5.ebuild ChangeLog
Date: Thu, 29 Aug 2013 15:34:08
Message-Id: 20130829153401.AAD8C2004C@flycatcher.gentoo.org
1 cardoe 13/08/29 15:34:01
2
3 Modified: ChangeLog
4 Added: libvirt-1.1.1-r5.ebuild
5 Log:
6 Fix RPC call bounds issue.
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.314 app-emulation/libvirt/ChangeLog
12
13 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.314&view=markup
14 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?rev=1.314&content-type=text/plain
15 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/ChangeLog?r1=1.313&r2=1.314
16
17 Index: ChangeLog
18 ===================================================================
19 RCS file: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v
20 retrieving revision 1.313
21 retrieving revision 1.314
22 diff -u -r1.313 -r1.314
23 --- ChangeLog 28 Aug 2013 11:13:15 -0000 1.313
24 +++ ChangeLog 29 Aug 2013 15:34:01 -0000 1.314
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.313 2013/08/28 11:13:15 ago Exp $
29 +# $Header: /var/cvsroot/gentoo-x86/app-emulation/libvirt/ChangeLog,v 1.314 2013/08/29 15:34:01 cardoe Exp $
30 +
31 +*libvirt-1.1.1-r5 (29 Aug 2013)
32 +
33 + 29 Aug 2013; Doug Goldstein <cardoe@g.o> +libvirt-1.1.1-r5.ebuild:
34 + Fix RPC call bounds issue.
35
36 28 Aug 2013; Agostino Sarubbo <ago@g.o> libvirt-1.1.1-r1.ebuild:
37 Stable for x86, wrt bug #480134
38
39
40
41 1.1 app-emulation/libvirt/libvirt-1.1.1-r5.ebuild
42
43 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.1.1-r5.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/libvirt/libvirt-1.1.1-r5.ebuild?rev=1.1&content-type=text/plain
45
46 Index: libvirt-1.1.1-r5.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.1-r5.ebuild,v 1.1 2013/08/29 15:34:01 cardoe Exp $
51
52 EAPI=5
53
54 BACKPORTS=dfae2d62
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 readme.gentoo
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 DOC_CONTENTS="For the basic networking support (bridged and routed networks)
163 you don't need any extra software. For more complex network modes
164 including but not limited to NATed network, you can enable the
165 'virt-network' USE flag.\n\n
166 If you are using dnsmasq on your system, you will have
167 to configure /etc/dnsmasq.conf to enable the following settings:\n\n
168 bind-interfaces\n
169 interface or except-interface\n\n
170 Otherwise you might have issues with your existing DNS server."
171
172 LXC_CONFIG_CHECK="
173 ~CGROUPS
174 ~CGROUP_FREEZER
175 ~CGROUP_DEVICE
176 ~CGROUP_CPUACCT
177 ~CGROUP_SCHED
178 ~CGROUP_PERF
179 ~BLK_CGROUP
180 ~NET_CLS_CGROUP
181 ~NETPRIO_CGROUP
182 ~CPUSETS
183 ~RESOURCE_COUNTERS
184 ~NAMESPACES
185 ~UTS_NS
186 ~IPC_NS
187 ~PID_NS
188 ~NET_NS
189 ~DEVPTS_MULTIPLE_INSTANCES
190 ~VETH
191 ~MACVLAN
192 ~POSIX_MQUEUE
193 ~!GRKERNSEC_CHROOT_MOUNT
194 ~!GRKERNSEC_CHROOT_DOUBLE
195 ~!GRKERNSEC_CHROOT_PIVOT
196 ~!GRKERNSEC_CHROOT_CHMOD
197 ~!GRKERNSEC_CHROOT_CAPS
198 "
199
200 VIRTNET_CONFIG_CHECK="
201 ~BRIDGE_NF_EBTABLES
202 ~BRIDGE_EBT_MARK_T
203 ~NETFILTER_ADVANCED
204 ~NETFILTER_XT_TARGET_CHECKSUM
205 ~NETFILTER_XT_CONNMARK
206 ~NETFILTER_XT_MARK
207 "
208
209 MACVTAP_CONFIG_CHECK=" ~MACVTAP"
210
211 LVM_CONFIG_CHECK=" ~BLK_DEV_DM ~DM_SNAPSHOT ~DM_MULTIPATH"
212
213 pkg_setup() {
214 enewgroup qemu 77
215 enewuser qemu 77 -1 -1 qemu kvm
216
217 # Some people used the masked ebuild which was not adding the qemu
218 # user to the kvm group originally. This results in VMs failing to
219 # start for some users. bug #430808
220 egetent group kvm | grep -q qemu
221 if [[ $? -ne 0 ]]; then
222 gpasswd -a qemu kvm
223 fi
224
225 python-single-r1_pkg_setup
226
227 # Handle specific kernel versions for different features
228 kernel_is lt 3 6 && LXC_CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
229 kernel_is ge 3 6 && LXC_CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
230
231 CONFIG_CHECK=""
232 use fuse && CONFIG_CHECK+=" ~FUSE_FS"
233 use lvm && CONFIG_CHECK+="${LVM_CONFIG_CHECK}"
234 use lxc && CONFIG_CHECK+="${LXC_CONFIG_CHECK}"
235 use macvtap && CONFIG_CHECK+="${MACVTAP_CONFIG_CHECK}"
236 use virt-network && CONFIG_CHECK+="${VIRTNET_CONFIG_CHECK}"
237 if [[ -n ${CONFIG_CHECK} ]]; then
238 linux-info_pkg_setup
239 fi
240 }
241
242 src_prepare() {
243 touch "${S}/.mailmap"
244 [[ -n ${BACKPORTS} ]] && \
245 EPATCH_FORCE=yes EPATCH_SUFFIX="patch" EPATCH_SOURCE="${S}/patches" \
246 epatch
247
248 if [[ ${PV} = *9999* ]]; then
249
250 # git checkouts require bootstrapping to create the configure script.
251 # Additionally the submodules must be cloned to the right locations
252 # bug #377279
253 ./bootstrap || die "bootstrap failed"
254 (
255 git submodule status | sed 's/^[ +-]//;s/ .*//'
256 git hash-object bootstrap.conf
257 ) >.git-module-status
258 fi
259
260 epatch_user
261
262 [[ -n ${AUTOTOOLIZE} ]] && eautoreconf
263
264 # Tweak the init script
265 local avahi_init=
266 local iscsi_init=
267 local rbd_init=
268 local firewalld_init=
269 cp "${FILESDIR}/libvirtd.init-r12" "${S}/libvirtd.init"
270 use avahi && avahi_init='avahi-daemon'
271 use iscsi && iscsi_init='iscsid'
272 use rbd && rbd_init='ceph'
273 use firewalld && firewalld_init='need firewalld'
274
275 sed -e "s/USE_FLAG_FIREWALLD/${firewalld_init}/" -i "${S}/libvirtd.init"
276 sed -e "s/USE_FLAG_AVAHI/${avahi_init}/" -i "${S}/libvirtd.init"
277 sed -e "s/USE_FLAG_ISCSI/${iscsi_init}/" -i "${S}/libvirtd.init"
278 sed -e "s/USE_FLAG_RBD/${rbd_init}/" -i "${S}/libvirtd.init"
279 }
280
281 src_configure() {
282 local myconf=""
283
284 ## enable/disable daemon, otherwise client only utils
285 myconf="${myconf} $(use_with libvirtd)"
286
287 ## enable/disable the daemon using avahi to find VMs
288 myconf="${myconf} $(use_with avahi)"
289
290 ## hypervisors on the local host
291 myconf="${myconf} $(use_with xen) $(use_with xen xen-inotify)"
292 myconf+=" --without-xenapi"
293 if use xen && has_version ">=app-emulation/xen-tools-4.2.0"; then
294 myconf+=" --with-libxl"
295 else
296 myconf+=" --without-libxl"
297 fi
298 myconf="${myconf} $(use_with openvz)"
299 myconf="${myconf} $(use_with lxc)"
300 if use virtualbox && has_version app-emulation/virtualbox-ose; then
301 myconf="${myconf} --with-vbox=/usr/lib/virtualbox-ose/"
302 else
303 myconf="${myconf} $(use_with virtualbox vbox)"
304 fi
305 myconf="${myconf} $(use_with uml)"
306 myconf="${myconf} $(use_with qemu)"
307 myconf="${myconf} $(use_with qemu yajl)" # Use QMP over HMP
308 myconf="${myconf} $(use_with phyp)"
309 myconf="${myconf} --with-esx"
310 myconf="${myconf} --with-vmware"
311
312 ## additional host drivers
313 myconf="${myconf} $(use_with virt-network network)"
314 myconf="${myconf} --with-storage-fs"
315 myconf="${myconf} $(use_with lvm storage-lvm)"
316 myconf="${myconf} $(use_with iscsi storage-iscsi)"
317 myconf="${myconf} $(use_with parted storage-disk)"
318 myconf="${myconf} $(use_with lvm storage-mpath)"
319 myconf="${myconf} $(use_with rbd storage-rbd)"
320 myconf="${myconf} $(use_with numa numactl)"
321 myconf="${myconf} $(use_with numa numad)"
322 myconf="${myconf} $(use_with selinux)"
323 myconf="${myconf} $(use_with fuse)"
324
325 # udev for device support details
326 myconf="${myconf} $(use_with udev)"
327
328 # linux capability support so we don't need privileged accounts
329 myconf="${myconf} $(use_with caps capng)"
330
331 ## auth stuff
332 myconf="${myconf} $(use_with policykit polkit)"
333 myconf="${myconf} $(use_with sasl)"
334
335 # network bits
336 myconf="${myconf} $(use_with macvtap)"
337 myconf="${myconf} $(use_with pcap libpcap)"
338 myconf="${myconf} $(use_with vepa virtualport)"
339 myconf="${myconf} $(use_with firewalld)"
340
341 ## other
342 myconf="${myconf} $(use_enable nls)"
343 myconf="${myconf} $(use_with python)"
344
345 # user privilege bits fir qemu/kvm
346 if use caps; then
347 myconf="${myconf} --with-qemu-user=qemu"
348 myconf="${myconf} --with-qemu-group=qemu"
349 else
350 myconf="${myconf} --with-qemu-user=root"
351 myconf="${myconf} --with-qemu-group=root"
352 fi
353
354 # audit support
355 myconf="${myconf} $(use_with audit)"
356
357 ## stuff we don't yet support
358 myconf="${myconf} --without-netcf"
359
360 # we use udev over hal
361 myconf="${myconf} --without-hal"
362
363 # locking support
364 myconf="${myconf} --without-sanlock"
365
366 # systemd unit files
367 use systemd && myconf="${myconf} --with-init-script=systemd"
368
369 # this is a nasty trick to work around the problem in bug
370 # #275073. The reason why we don't solve this properly is that
371 # it'll require us to rebuild autotools (and we don't really want
372 # to do that right now). The proper solution has been sent
373 # upstream and should hopefully land in 0.7.7, in the mean time,
374 # mime the same functionality with this.
375 case ${CHOST} in
376 *cygwin* | *mingw* )
377 ;;
378 *)
379 ac_cv_prog_WINDRES=no
380 ;;
381 esac
382
383 econf \
384 ${myconf} \
385 --disable-static \
386 --docdir=/usr/share/doc/${PF} \
387 --with-remote \
388 --localstatedir=/var
389
390 if [[ ${PV} = *9999* ]]; then
391 # Restore gnulib's config.sub and config.guess
392 # bug #377279
393 (cd .gnulib && git reset --hard > /dev/null)
394 fi
395 }
396
397 src_test() {
398 # Explicitly allow parallel build of tests
399 export VIR_TEST_DEBUG=1
400 HOME="${T}" emake check || die "tests failed"
401 }
402
403 src_install() {
404 emake install \
405 DESTDIR="${D}" \
406 HTML_DIR=/usr/share/doc/${PF}/html \
407 DOCS_DIR=/usr/share/doc/${PF} \
408 EXAMPLE_DIR=/usr/share/doc/${PF}/examples \
409 SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)" \
410 || die "emake install failed"
411
412 find "${D}" -name '*.la' -delete || die
413
414 use libvirtd || return 0
415 # From here, only libvirtd-related instructions, be warned!
416
417 newinitd "${S}/libvirtd.init" libvirtd || die
418 newconfd "${FILESDIR}/libvirtd.confd-r4" libvirtd || die
419
420 keepdir /var/lib/libvirt/images
421
422 use python && python_optimize
423
424 readme.gentoo_create_doc
425 }
426
427 pkg_preinst() {
428 # we only ever want to generate this once
429 if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
430 rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
431 fi
432
433 # We really don't want to use or support old PolicyKit cause it
434 # screws with the new polkit integration
435 if has_version sys-auth/policykit; then
436 rm -rf "${D}"/usr/share/PolicyKit/policy/org.libvirt.unix.policy
437 fi
438
439 # Only sysctl files ending in .conf work
440 dodir /etc/sysctl.d
441 mv "${D}"/usr/lib/sysctl.d/libvirtd.conf "${D}"/etc/sysctl.d/libvirtd.conf
442 }
443
444 pkg_postinst() {
445 if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
446 touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
447 fi
448
449 # support for dropped privileges
450 if use qemu; then
451 fperms 0750 "${EROOT}/var/lib/libvirt/qemu"
452 fperms 0750 "${EROOT}/var/cache/libvirt/qemu"
453 fi
454
455 if use caps && use qemu; then
456 fowners -R qemu:qemu "${EROOT}/var/lib/libvirt/qemu"
457 fowners -R qemu:qemu "${EROOT}/var/cache/libvirt/qemu"
458 elif use qemu; then
459 fowners -R root:root "${EROOT}/var/lib/libvirt/qemu"
460 fowners -R root:root "${EROOT}/var/cache/libvirt/qemu"
461 fi
462
463 if ! use policykit; then
464 elog "To allow normal users to connect to libvirtd you must change the"
465 elog "unix sock group and/or perms in /etc/libvirt/libvirtd.conf"
466 fi
467
468 use libvirtd || return 0
469 # From here, only libvirtd-related instructions, be warned!
470
471 readme.gentoo_print_elog
472
473 if use caps && use qemu; then
474 elog "libvirt will now start qemu/kvm VMs with non-root privileges."
475 elog "Ensure any resources your VMs use are accessible by qemu:qemu"
476 fi
477 }