Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/
Date: Sat, 09 Jul 2016 15:10:30
Message-Id: 1468077013.45b982e636481053a901137211441a5d8be30fc3.tamiko@gentoo
1 commit: 45b982e636481053a901137211441a5d8be30fc3
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jul 9 14:46:18 2016 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Sat Jul 9 15:10:13 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45b982e6
7
8 app-emulation/libvirt: update 1.2.21, fix CVE-2016-5008, bug #587570
9
10 Package-Manager: portage-2.2.28
11
12 app-emulation/libvirt/Manifest | 1 +
13 app-emulation/libvirt/libvirt-1.2.21-r3.ebuild | 386 +++++++++++++++++++++++++
14 2 files changed, 387 insertions(+)
15
16 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
17 index 92ee3fa..5d86fb8 100644
18 --- a/app-emulation/libvirt/Manifest
19 +++ b/app-emulation/libvirt/Manifest
20 @@ -1,4 +1,5 @@
21 DIST libvirt-1.2.21-20151222.tar.xz 1684 SHA256 6c97f288470ec58bcbe98507563c6a191892c6f8813a7b9688c09b823934cbe5 SHA512 4fd43f0e12434b78ac3e671ad8eb0e402d384cff6278f6d0db322a068c2c8807c7c7f7e5774aa9d19e2a85e49f6d9888908b32fca5fc04980134edaccba0afe2 WHIRLPOOL 2bfbc3cbf1ca44a2bb06ddf2e8eabeb116165560b9c73d649d7b8cc9baba851f5e9246414bfc2c4740f27d0d0d42b6176eaec43b05e8c1e54de2804150c2cde1
22 +DIST libvirt-1.2.21-20160709.tar.xz 3048 SHA256 c2bef1c300099c3ff6ce81488a2678e588d18ca46a27916df160c8304239ca80 SHA512 fdf0cd5e1cc3e0144fa99577c1a8c2d5e69ab610c923071b645465fb58076b2ce7a8e4e7747f3a6c59716917c6d41f369d77565c0f9fe10907a76d9b39edede6 WHIRLPOOL 2816d54588e4a49efd6773982b2b8a281572607c86c5a57c45b1736ce22836ea4cb91cee8d59b8fddcaafd2e552d0422ef5ed4b33d19a1705d4a38f270b9d39d
23 DIST libvirt-1.2.21.tar.gz 29848954 SHA256 8d406582f5fe88d739d1d83e0ba7ac7f91f5a8da4be82162ab85631744d8925b SHA512 5c15d0ba5d75c13f735c6a60dfdbad007426f77e113f95894d520f7fc358fa4361d5cce7bb9a548a436f323b845f13b8940abbad568b8b146418430068bb970e WHIRLPOOL d53bbb07c85b3aa2d9b0f38ff2edd3cd0a2a5300627f3e2f0a82bc057303617cab9d6f1d8a9a771bd968b0496d38d3a39a0154f88bdca44dda359a65fdc2c650
24 DIST libvirt-1.3.5.tar.gz 35109092 SHA256 93a23c44eb431da46c9458f95a66e29c9b98e37515d44b6be09e75b35ec94ac8 SHA512 6c6a09623d3d4d426311bfa7039f5e39584d5f891b8e761bbdb3022601ea066b8e1c3f8d609326e8ba4081ae40b7b03086fbc8ba5759d218b8616ec98200a89d WHIRLPOOL 88ac308cc461efff842c27e40263a3b25ce0bc0ca310fb6e9def9126ab893fe43aed01bda9fc3615439ee797c36e2800f741b346e0b3d96aac64e7909c269879
25 DIST libvirt-2.0.0.tar.xz 13161096 SHA256 10e90af55e613953c0ddc60b4ac3a10c73c0f3493d7014259e3f012b2ffc9acb SHA512 1182346e9268ec50cfd191a18172ad8ca80615a111547cc72fbe227cbbe9579263a1236f80cb36542272bdbf092e2184c9060b65c56dc2098076bbd1a89dd66c WHIRLPOOL 3d6d9e307228f54993c6082f7787d678b2afe84d96b47889d1565e38da489fb99691aeb598831dff04cd9fe47448ea35dc1f5a44b3c6638816cf61533155688c
26
27 diff --git a/app-emulation/libvirt/libvirt-1.2.21-r3.ebuild b/app-emulation/libvirt/libvirt-1.2.21-r3.ebuild
28 new file mode 100644
29 index 0000000..3cc0a55
30 --- /dev/null
31 +++ b/app-emulation/libvirt/libvirt-1.2.21-r3.ebuild
32 @@ -0,0 +1,386 @@
33 +# Copyright 1999-2015 Gentoo Foundation
34 +# Distributed under the terms of the GNU General Public License v2
35 +# $Id$
36 +
37 +EAPI=5
38 +
39 +inherit eutils user autotools-utils linux-info systemd readme.gentoo
40 +
41 +BACKPORTS="20160709" # CVE-2015-5313 CVE-2016-5008
42 +
43 +if [[ ${PV} = *9999* ]]; then
44 + inherit git-r3
45 + EGIT_REPO_URI="git://libvirt.org/libvirt.git"
46 + SRC_URI=""
47 + KEYWORDS=""
48 + SLOT="0"
49 +else
50 + # Versions with 4 numbers are stable updates:
51 + if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
52 + SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
53 + else
54 + SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
55 + fi
56 + SRC_URI+=" ${BACKPORTS:+
57 + https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
58 + https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
59 + KEYWORDS="~amd64 ~x86"
60 + SLOT="0/${PV}"
61 +fi
62 +
63 +DESCRIPTION="C toolkit to manipulate virtual machines"
64 +HOMEPAGE="http://www.libvirt.org/"
65 +LICENSE="LGPL-2.1"
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 systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
69 + xen"
70 +
71 +REQUIRED_USE="
72 + firewalld? ( virt-network )
73 + libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
74 + lxc? ( caps libvirtd )
75 + openvz? ( libvirtd )
76 + qemu? ( libvirtd )
77 + uml? ( libvirtd )
78 + vepa? ( macvtap )
79 + virt-network? ( libvirtd )
80 + virtualbox? ( libvirtd )
81 + xen? ( libvirtd )"
82 +
83 +# gettext.sh command is used by the libvirt command wrappers, and it's
84 +# non-optional, so put it into RDEPEND.
85 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
86 +# package will use 3 by default. Since we don't have slot pinning in an API,
87 +# we must go with the most recent
88 +RDEPEND="
89 + app-misc/scrub
90 + dev-libs/libgcrypt:0
91 + dev-libs/libnl:3
92 + >=dev-libs/libxml2-2.7.6
93 + >=net-analyzer/netcat6-1.0-r2
94 + >=net-libs/gnutls-1.0.25:0=
95 + net-libs/libssh2
96 + >=net-misc/curl-7.18.0
97 + sys-apps/dmidecode
98 + >=sys-apps/util-linux-2.17
99 + sys-devel/gettext
100 + sys-libs/ncurses:0=
101 + sys-libs/readline:=
102 + apparmor? ( sys-libs/libapparmor )
103 + audit? ( sys-process/audit )
104 + avahi? ( >=net-dns/avahi-0.6[dbus] )
105 + caps? ( sys-libs/libcap-ng )
106 + firewalld? ( net-firewall/firewalld )
107 + fuse? ( >=sys-fs/fuse-2.8.6 )
108 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
109 + iscsi? ( sys-block/open-iscsi )
110 + lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
111 + lxc? ( !systemd? ( sys-power/pm-utils ) )
112 + nfs? ( net-fs/nfs-utils )
113 + numa? (
114 + >sys-process/numactl-2.0.2
115 + sys-process/numad
116 + )
117 + openvz? ( sys-kernel/openvz-sources:* )
118 + parted? (
119 + >=sys-block/parted-1.8[device-mapper]
120 + sys-fs/lvm2
121 + )
122 + pcap? ( >=net-libs/libpcap-1.0.0 )
123 + policykit? ( >=sys-auth/polkit-0.9 )
124 + qemu? (
125 + >=app-emulation/qemu-0.13.0
126 + dev-libs/yajl
127 + !systemd? ( sys-power/pm-utils )
128 + )
129 + rbd? ( sys-cluster/ceph )
130 + sasl? ( dev-libs/cyrus-sasl )
131 + selinux? ( >=sys-libs/libselinux-2.0.85 )
132 + systemd? ( sys-apps/systemd )
133 + virt-network? (
134 + net-dns/dnsmasq[script]
135 + net-firewall/ebtables
136 + >=net-firewall/iptables-1.4.10[ipv6]
137 + net-misc/radvd
138 + sys-apps/iproute2[-minimal]
139 + )
140 + virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
141 + wireshark-plugins? ( net-analyzer/wireshark:= )
142 + xen? (
143 + app-emulation/xen
144 + app-emulation/xen-tools:=
145 + )
146 + udev? (
147 + virtual/udev
148 + >=x11-libs/libpciaccess-0.10.9
149 + )"
150 +
151 +DEPEND="${RDEPEND}
152 + app-text/xhtml1
153 + dev-lang/perl
154 + dev-libs/libxslt
155 + dev-perl/XML-XPath
156 + virtual/pkgconfig"
157 +
158 +pkg_setup() {
159 + enewgroup qemu 77
160 + enewuser qemu 77 -1 -1 qemu kvm
161 +
162 + # Some people used the masked ebuild which was not adding the qemu
163 + # user to the kvm group originally. This results in VMs failing to
164 + # start for some users. bug #430808
165 + egetent group kvm | grep -q qemu
166 + if [[ $? -ne 0 ]]; then
167 + gpasswd -a qemu kvm
168 + fi
169 +
170 + # Check kernel configuration:
171 + CONFIG_CHECK=""
172 + use fuse && CONFIG_CHECK+="
173 + ~FUSE_FS"
174 +
175 + use lvm && CONFIG_CHECK+="
176 + ~BLK_DEV_DM
177 + ~DM_MULTIPATH
178 + ~DM_SNAPSHOT"
179 +
180 + use lxc && CONFIG_CHECK+="
181 + ~BLK_CGROUP
182 + ~CGROUP_CPUACCT
183 + ~CGROUP_DEVICE
184 + ~CGROUP_FREEZER
185 + ~CGROUP_NET_PRIO
186 + ~CGROUP_PERF
187 + ~CGROUPS
188 + ~CGROUP_SCHED
189 + ~CPUSETS
190 + ~DEVPTS_MULTIPLE_INSTANCES
191 + ~IPC_NS
192 + ~MACVLAN
193 + ~NAMESPACES
194 + ~NET_CLS_CGROUP
195 + ~NET_NS
196 + ~PID_NS
197 + ~POSIX_MQUEUE
198 + ~SECURITYFS
199 + ~USER_NS
200 + ~UTS_NS
201 + ~VETH
202 + ~!GRKERNSEC_CHROOT_MOUNT
203 + ~!GRKERNSEC_CHROOT_DOUBLE
204 + ~!GRKERNSEC_CHROOT_PIVOT
205 + ~!GRKERNSEC_CHROOT_CHMOD
206 + ~!GRKERNSEC_CHROOT_CAPS"
207 + # Handle specific kernel versions for different features
208 + kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
209 + kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
210 + if $(kernel_is ge 3 6); then
211 + CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP "
212 + if $(kernel_is lt 4 5); then
213 + CONFIG_CHECK+=" ~MEMCG_KMEM "
214 + fi
215 + fi
216 +
217 + use macvtap && CONFIG_CHECK+="
218 + ~MACVTAP"
219 +
220 + use virt-network && CONFIG_CHECK+="
221 + ~BRIDGE_EBT_MARK_T
222 + ~BRIDGE_NF_EBTABLES
223 + ~NETFILTER_ADVANCED
224 + ~NETFILTER_XT_CONNMARK
225 + ~NETFILTER_XT_MARK
226 + ~NETFILTER_XT_TARGET_CHECKSUM"
227 + # Bandwidth Limiting Support
228 + use virt-network && CONFIG_CHECK+="
229 + ~BRIDGE_EBT_T_NAT
230 + ~NET_ACT_POLICE
231 + ~NET_CLS_FW
232 + ~NET_CLS_U32
233 + ~NET_SCH_HTB
234 + ~NET_SCH_INGRESS
235 + ~NET_SCH_SFQ"
236 +
237 + ERROR_USER_NS="Optional depending on LXC configuration."
238 +
239 + if [[ -n ${CONFIG_CHECK} ]]; then
240 + linux-info_pkg_setup
241 + fi
242 +}
243 +
244 +src_prepare() {
245 + touch "${S}/.mailmap"
246 +
247 + if [[ ${PV} = *9999* ]]; then
248 + # git checkouts require bootstrapping to create the configure script.
249 + # Additionally the submodules must be cloned to the right locations
250 + # bug #377279
251 + ./bootstrap || die "bootstrap failed"
252 + (
253 + git submodule status | sed 's/^[ +-]//;s/ .*//'
254 + git hash-object bootstrap.conf
255 + ) >.git-module-status
256 + fi
257 +
258 + epatch \
259 + "${FILESDIR}"/${PN}-1.2.9-do_not_use_sysconf.patch \
260 + "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
261 + "${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch \
262 + "${FILESDIR}"/${P}-avoid_deprecated_pc_file.patch
263 +
264 + [[ -n ${BACKPORTS} ]] &&
265 + EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
266 + EPATCH_SOURCE="${WORKDIR}/patches" epatch
267 +
268 + epatch_user
269 +
270 + # Tweak the init script:
271 + cp "${FILESDIR}/libvirtd.init-r15" "${S}/libvirtd.init" || die
272 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
273 + -e "s/USE_FLAG_AVAHI/$(usex avahi avahi-daemon '')/" \
274 + -e "s/USE_FLAG_ISCSI/$(usex iscsi iscsid '')/" \
275 + -e "s/USE_FLAG_RBD/$(usex rbd ceph '')/" \
276 + -i "${S}/libvirtd.init" || die "sed failed"
277 +
278 + AUTOTOOLS_AUTORECONF=true
279 + autotools-utils_src_prepare
280 +}
281 +
282 +src_configure() {
283 + local myeconfargs=(
284 + $(use_with apparmor)
285 + $(use_with apparmor apparmor-profiles)
286 + $(use_with audit)
287 + $(use_with avahi)
288 + $(use_with caps capng)
289 + $(use_with firewalld)
290 + $(use_with fuse)
291 + $(use_with glusterfs)
292 + $(use_with glusterfs storage-gluster)
293 + $(use_with iscsi storage-iscsi)
294 + $(use_with libvirtd)
295 + $(use_with lvm storage-lvm)
296 + $(use_with lvm storage-mpath)
297 + $(use_with lxc)
298 + $(use_with macvtap)
299 + $(use_enable nls)
300 + $(use_with numa numactl)
301 + $(use_with numa numad)
302 + $(use_with openvz)
303 + $(use_with parted storage-disk)
304 + $(use_with pcap libpcap)
305 + $(use_with phyp)
306 + $(use_with policykit polkit)
307 + $(use_with qemu)
308 + $(use_with qemu yajl)
309 + $(use_with rbd storage-rbd)
310 + $(use_with sasl)
311 + $(use_with selinux)
312 + $(use_with systemd systemd-daemon)
313 + $(usex systemd --with-init-script=systemd '')
314 + $(use_with udev)
315 + $(use_with uml)
316 + $(use_with vepa virtualport)
317 + $(use_with virt-network network)
318 + $(use_with wireshark-plugins wireshark-dissector)
319 + $(use_with xen)
320 + $(use_with xen xen-inotify)
321 + $(usex xen --with-libxl '')
322 +
323 + --without-hal
324 + --without-netcf
325 + --without-sanlock
326 + --without-xenapi
327 + --with-esx
328 + --with-qemu-group=$(usex caps qemu root)
329 + --with-qemu-user=$(usex caps qemu root)
330 + --with-remote
331 + --with-storage-fs
332 + --with-vmware
333 +
334 + --disable-static
335 + --disable-werror
336 +
337 + --with-html-subdir=${PF}/html
338 + --localstatedir=/var
339 + )
340 +
341 + if use virtualbox && has_version app-emulation/virtualbox-ose; then
342 + myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
343 + else
344 + myeconfargs+=( $(use_with virtualbox vbox) )
345 + fi
346 +
347 + autotools-utils_src_configure
348 +
349 + if [[ ${PV} = *9999* ]]; then
350 + # Restore gnulib's config.sub and config.guess
351 + # bug #377279
352 + (cd .gnulib && git reset --hard > /dev/null)
353 + fi
354 +}
355 +
356 +src_test() {
357 + # Explicitly allow parallel build of tests
358 + export VIR_TEST_DEBUG=1
359 + HOME="${T}" emake check || die "tests failed"
360 +}
361 +
362 +src_install() {
363 + autotools-utils_src_compile install \
364 + DESTDIR="${D}" \
365 + SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
366 +
367 + find "${D}" -name '*.la' -delete || die
368 +
369 + # Remove bogus, empty directories. They are either not used, or
370 + # libvirtd is able to create them on demand
371 + rm -rf "${D}"/etc/sysconfig
372 + rm -rf "${D}"/var/cache
373 + rm -rf "${D}"/var/run
374 + rm -rf "${D}"/var/log
375 +
376 + use libvirtd || return 0
377 + # From here, only libvirtd-related instructions, be warned!
378 +
379 + use systemd && systemd_install_serviced \
380 + "${FILESDIR}"/libvirtd.service.conf libvirtd.service
381 +
382 + systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
383 +
384 + newinitd "${S}/libvirtd.init" libvirtd || die
385 + newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die
386 + newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
387 +
388 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
389 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
390 +
391 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
392 + DISABLE_AUTOFORMATTING=true
393 + readme.gentoo_create_doc
394 +}
395 +
396 +pkg_preinst() {
397 + # we only ever want to generate this once
398 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
399 + rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
400 + fi
401 +}
402 +
403 +pkg_postinst() {
404 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
405 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
406 + fi
407 +
408 + use libvirtd || return 0
409 + # From here, only libvirtd-related instructions, be warned!
410 +
411 + if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
412 + FORCE_PRINT_ELOG=true
413 + fi
414 +
415 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
416 + DISABLE_AUTOFORMATTING=true
417 + readme.gentoo_print_elog
418 +}