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