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