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