Gentoo Archives: gentoo-commits

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