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