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