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: Sun, 01 May 2016 19:15:20
Message-Id: 1462130104.bb5707e534b3d0237f03c0b9ab00f5c7e177338f.tamiko@gentoo
1 commit: bb5707e534b3d0237f03c0b9ab00f5c7e177338f
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 1 18:49:12 2016 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Sun May 1 19:15:04 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bb5707e5
7
8 app-emulation/libvirt: remove old versions 1.3.0-r1, 1.3.2-r1
9
10 Package-Manager: portage-2.2.26
11
12 app-emulation/libvirt/Manifest | 3 -
13 app-emulation/libvirt/libvirt-1.3.0-r1.ebuild | 385 --------------------------
14 app-emulation/libvirt/libvirt-1.3.2-r1.ebuild | 385 --------------------------
15 3 files changed, 773 deletions(-)
16
17 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
18 index 5d2e4bb..2d735f1 100644
19 --- a/app-emulation/libvirt/Manifest
20 +++ b/app-emulation/libvirt/Manifest
21 @@ -1,7 +1,4 @@
22 DIST libvirt-1.2.21-20151222.tar.xz 1684 SHA256 6c97f288470ec58bcbe98507563c6a191892c6f8813a7b9688c09b823934cbe5 SHA512 4fd43f0e12434b78ac3e671ad8eb0e402d384cff6278f6d0db322a068c2c8807c7c7f7e5774aa9d19e2a85e49f6d9888908b32fca5fc04980134edaccba0afe2 WHIRLPOOL 2bfbc3cbf1ca44a2bb06ddf2e8eabeb116165560b9c73d649d7b8cc9baba851f5e9246414bfc2c4740f27d0d0d42b6176eaec43b05e8c1e54de2804150c2cde1
23 DIST libvirt-1.2.21.tar.gz 29848954 SHA256 8d406582f5fe88d739d1d83e0ba7ac7f91f5a8da4be82162ab85631744d8925b SHA512 5c15d0ba5d75c13f735c6a60dfdbad007426f77e113f95894d520f7fc358fa4361d5cce7bb9a548a436f323b845f13b8940abbad568b8b146418430068bb970e WHIRLPOOL d53bbb07c85b3aa2d9b0f38ff2edd3cd0a2a5300627f3e2f0a82bc057303617cab9d6f1d8a9a771bd968b0496d38d3a39a0154f88bdca44dda359a65fdc2c650
24 -DIST libvirt-1.3.0-20151222.tar.xz 1684 SHA256 3628c3398862eae2966ccf0e55822e4cb8f47e6e8c1b0d17b6fdb9f69dc5490b SHA512 71c8dabc9cb8ead2858bf2d77d3831db59ac34076c99a4ae607c7bb4678b0af28a9f31fdca047ee174237f0e91fbb8db3a843e605256514e1d0ad527fc412275 WHIRLPOOL 47ebd21dd7d17812b8e97ebb70453574550cac18b0cf88cd38c152565d1e01f725a6da90878c41c7836a59318c1294859870e5bb523981954618fdde6704360e
25 -DIST libvirt-1.3.0.tar.gz 30114683 SHA256 ebcf5645fa565e3fe2fe94a86e841db9b768cf0e0a7e6cf395c6327f9a23bd64 SHA512 e252390a05b76e9cd9ed02caadd0ee0d674505f60940bb6ced955e17f69c7dd55fe5b38204ae5c25b6e5703415a0f6a12fc545d138d0e8b016457a85dc8fa2b8 WHIRLPOOL 852c592b27be86d3fb2ec75ca5debf9a1e0ac5de6d1ab06c55c2d70e83de125d10c2fc967b7578fba9137ed7a30b7a7e195f4e5f8d35708deeeddc97424d5e40
26 DIST libvirt-1.3.1.tar.gz 29900143 SHA256 a5d43fbed34d31eeffc641d2ac9b6026a57bf1a4fa74d0fa19a9891d9ec2c21a SHA512 a109c09d947f7c5e924fdbc9c9b6c0a9d6ff64d9411aedd9a3e710d20f749b088ff9895e882dd888b88bfea7724a8933534be4078f16cb9d2047da761515e804 WHIRLPOOL 62fb8486bfa53d55b397d9a90750d32a83f0a73cf2e6685f296489390abf9c62efc69fecd6d011fc51e9f562f75f5b8ce03208c350e98d20de0a5560721c675e
27 -DIST libvirt-1.3.2.tar.gz 30056101 SHA256 e3c6fc2683178660b371efb3ac7a1103a3f4b78efac7ffe560bc5917974ccf05 SHA512 bcca111204c42db3a199c7d35758e78bcd9da557f091cb690dd712912aeee0ee89afa37a427ad972b94cc8ea9ed0788ff555a9042a9bab5ad0b55ca0d13aed1c WHIRLPOOL 551c4232e4890515276824e96a4379cc4908b71ac2d7ad27e4a1f7c78cc0ca39223422c17fee929d5dce090af03eaba5b5bd7ef83b0fc995dcac03398ef5d43b
28 DIST libvirt-1.3.4.tar.gz 30493908 SHA256 e2396ebebb3f3fdb50429ce8faa99559f6e8e3cc0493d5fa0c1999db189c25bd SHA512 6f85e4cd8a696da729bb88368c608694119258c6ab7f9b99f41c34a6cc4492d9ad90b8ff1574fd4ee6c78c674a3a501db60d1d3ba898f7013321ecc996612919 WHIRLPOOL af4a8a0e3d746f50e0f9d95e3920c023c5bbec0d7c641f43aea580db9b95a793027f7579ecd94625a68b7e3662c328d94b7b2d243afea60a8d2f31cab1cc9319
29
30 diff --git a/app-emulation/libvirt/libvirt-1.3.0-r1.ebuild b/app-emulation/libvirt/libvirt-1.3.0-r1.ebuild
31 deleted file mode 100644
32 index 89f5c47..0000000
33 --- a/app-emulation/libvirt/libvirt-1.3.0-r1.ebuild
34 +++ /dev/null
35 @@ -1,385 +0,0 @@
36 -# Copyright 1999-2016 Gentoo Foundation
37 -# Distributed under the terms of the GNU General Public License v2
38 -# $Id$
39 -
40 -EAPI=5
41 -
42 -inherit eutils user autotools-utils linux-info systemd readme.gentoo
43 -
44 -BACKPORTS="20151222" # CVE-2015-5313
45 -
46 -if [[ ${PV} = *9999* ]]; then
47 - inherit git-r3
48 - EGIT_REPO_URI="git://libvirt.org/libvirt.git"
49 - SRC_URI=""
50 - KEYWORDS=""
51 - SLOT="0"
52 -else
53 - # Versions with 4 numbers are stable updates:
54 - if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
55 - SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
56 - else
57 - SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
58 - fi
59 - SRC_URI+=" ${BACKPORTS:+
60 - https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
61 - https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
62 - KEYWORDS="~amd64 ~x86"
63 - SLOT="0/${PV}"
64 -fi
65 -
66 -DESCRIPTION="C toolkit to manipulate virtual machines"
67 -HOMEPAGE="http://www.libvirt.org/"
68 -LICENSE="LGPL-2.1"
69 -IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
70 - lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
71 - selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
72 - xen"
73 -
74 -REQUIRED_USE="
75 - firewalld? ( virt-network )
76 - libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
77 - lxc? ( caps libvirtd )
78 - openvz? ( libvirtd )
79 - qemu? ( libvirtd )
80 - uml? ( libvirtd )
81 - vepa? ( macvtap )
82 - virt-network? ( libvirtd )
83 - virtualbox? ( libvirtd )
84 - xen? ( libvirtd )"
85 -
86 -# gettext.sh command is used by the libvirt command wrappers, and it's
87 -# non-optional, so put it into RDEPEND.
88 -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
89 -# package will use 3 by default. Since we don't have slot pinning in an API,
90 -# we must go with the most recent
91 -RDEPEND="
92 - app-misc/scrub
93 - dev-libs/libgcrypt:0
94 - dev-libs/libnl:3
95 - >=dev-libs/libxml2-2.7.6
96 - >=net-analyzer/netcat6-1.0-r2
97 - >=net-libs/gnutls-1.0.25
98 - net-libs/libssh2
99 - >=net-misc/curl-7.18.0
100 - sys-apps/dmidecode
101 - >=sys-apps/util-linux-2.17
102 - sys-devel/gettext
103 - sys-libs/ncurses:0=
104 - sys-libs/readline:=
105 - apparmor? ( sys-libs/libapparmor )
106 - audit? ( sys-process/audit )
107 - avahi? ( >=net-dns/avahi-0.6[dbus] )
108 - caps? ( sys-libs/libcap-ng )
109 - firewalld? ( net-firewall/firewalld )
110 - fuse? ( >=sys-fs/fuse-2.8.6 )
111 - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
112 - iscsi? ( sys-block/open-iscsi )
113 - lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
114 - lxc? ( !systemd? ( sys-power/pm-utils ) )
115 - nfs? ( net-fs/nfs-utils )
116 - numa? (
117 - >sys-process/numactl-2.0.2
118 - sys-process/numad
119 - )
120 - openvz? ( sys-kernel/openvz-sources:* )
121 - parted? (
122 - >=sys-block/parted-1.8[device-mapper]
123 - sys-fs/lvm2
124 - )
125 - pcap? ( >=net-libs/libpcap-1.0.0 )
126 - policykit? ( >=sys-auth/polkit-0.9 )
127 - qemu? (
128 - >=app-emulation/qemu-0.13.0
129 - dev-libs/yajl
130 - !systemd? ( sys-power/pm-utils )
131 - )
132 - rbd? ( sys-cluster/ceph )
133 - sasl? ( dev-libs/cyrus-sasl )
134 - selinux? ( >=sys-libs/libselinux-2.0.85 )
135 - systemd? ( sys-apps/systemd )
136 - virt-network? (
137 - net-dns/dnsmasq[script]
138 - net-firewall/ebtables
139 - >=net-firewall/iptables-1.4.10[ipv6]
140 - net-misc/radvd
141 - sys-apps/iproute2[-minimal]
142 - )
143 - virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
144 - wireshark-plugins? ( net-analyzer/wireshark:= )
145 - xen? (
146 - app-emulation/xen
147 - app-emulation/xen-tools:=
148 - )
149 - udev? (
150 - virtual/udev
151 - >=x11-libs/libpciaccess-0.10.9
152 - )"
153 -
154 -DEPEND="${RDEPEND}
155 - app-text/xhtml1
156 - dev-lang/perl
157 - dev-libs/libxslt
158 - dev-perl/XML-XPath
159 - virtual/pkgconfig"
160 -
161 -pkg_setup() {
162 - enewgroup qemu 77
163 - enewuser qemu 77 -1 -1 qemu kvm
164 -
165 - # Some people used the masked ebuild which was not adding the qemu
166 - # user to the kvm group originally. This results in VMs failing to
167 - # start for some users. bug #430808
168 - egetent group kvm | grep -q qemu
169 - if [[ $? -ne 0 ]]; then
170 - gpasswd -a qemu kvm
171 - fi
172 -
173 - # Check kernel configuration:
174 - CONFIG_CHECK=""
175 - use fuse && CONFIG_CHECK+="
176 - ~FUSE_FS"
177 -
178 - use lvm && CONFIG_CHECK+="
179 - ~BLK_DEV_DM
180 - ~DM_MULTIPATH
181 - ~DM_SNAPSHOT"
182 -
183 - use lxc && CONFIG_CHECK+="
184 - ~BLK_CGROUP
185 - ~CGROUP_CPUACCT
186 - ~CGROUP_DEVICE
187 - ~CGROUP_FREEZER
188 - ~CGROUP_NET_PRIO
189 - ~CGROUP_PERF
190 - ~CGROUPS
191 - ~CGROUP_SCHED
192 - ~CPUSETS
193 - ~DEVPTS_MULTIPLE_INSTANCES
194 - ~IPC_NS
195 - ~MACVLAN
196 - ~NAMESPACES
197 - ~NET_CLS_CGROUP
198 - ~NET_NS
199 - ~PID_NS
200 - ~POSIX_MQUEUE
201 - ~SECURITYFS
202 - ~USER_NS
203 - ~UTS_NS
204 - ~VETH
205 - ~!GRKERNSEC_CHROOT_MOUNT
206 - ~!GRKERNSEC_CHROOT_DOUBLE
207 - ~!GRKERNSEC_CHROOT_PIVOT
208 - ~!GRKERNSEC_CHROOT_CHMOD
209 - ~!GRKERNSEC_CHROOT_CAPS"
210 - # Handle specific kernel versions for different features
211 - kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
212 - kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
213 -
214 - use macvtap && CONFIG_CHECK+="
215 - ~MACVTAP"
216 -
217 - use virt-network && CONFIG_CHECK+="
218 - ~BRIDGE_EBT_MARK_T
219 - ~BRIDGE_NF_EBTABLES
220 - ~NETFILTER_ADVANCED
221 - ~NETFILTER_XT_CONNMARK
222 - ~NETFILTER_XT_MARK
223 - ~NETFILTER_XT_TARGET_CHECKSUM"
224 - # Bandwidth Limiting Support
225 - use virt-network && CONFIG_CHECK+="
226 - ~BRIDGE_EBT_T_NAT
227 - ~NET_ACT_POLICE
228 - ~NET_CLS_FW
229 - ~NET_CLS_U32
230 - ~NET_SCH_HTB
231 - ~NET_SCH_INGRESS
232 - ~NET_SCH_SFQ"
233 -
234 - ERROR_USER_NS="Optional depending on LXC configuration."
235 -
236 - if [[ -n ${CONFIG_CHECK} ]]; then
237 - linux-info_pkg_setup
238 - fi
239 -}
240 -
241 -src_prepare() {
242 - touch "${S}/.mailmap"
243 -
244 - if [[ ${PV} = *9999* ]]; then
245 - # git checkouts require bootstrapping to create the configure script.
246 - # Additionally the submodules must be cloned to the right locations
247 - # bug #377279
248 - ./bootstrap || die "bootstrap failed"
249 - (
250 - git submodule status | sed 's/^[ +-]//;s/ .*//'
251 - git hash-object bootstrap.conf
252 - ) >.git-module-status
253 - fi
254 -
255 - epatch \
256 - "${FILESDIR}"/${P}-do_not_use_sysconf.patch \
257 - "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
258 - "${FILESDIR}"/${PN}-1.2.17-fix_paths_for_apparmor.patch \
259 - "${FILESDIR}"/${PN}-1.2.21-avoid_deprecated_pc_file.patch
260 -
261 - [[ -n ${BACKPORTS} ]] &&
262 - EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
263 - EPATCH_SOURCE="${WORKDIR}/patches" epatch
264 -
265 - epatch_user
266 -
267 - # Tweak the init script:
268 - cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die
269 - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
270 - -e "s/USE_FLAG_AVAHI/$(usex avahi 'use avahi-daemon' '')/" \
271 - -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \
272 - -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \
273 - -i "${S}/libvirtd.init" || die "sed failed"
274 -
275 - AUTOTOOLS_AUTORECONF=true
276 - autotools-utils_src_prepare
277 -}
278 -
279 -src_configure() {
280 - local myeconfargs=(
281 - $(use_with apparmor)
282 - $(use_with apparmor apparmor-profiles)
283 - $(use_with audit)
284 - $(use_with avahi)
285 - $(use_with caps capng)
286 - $(use_with firewalld)
287 - $(use_with fuse)
288 - $(use_with glusterfs)
289 - $(use_with glusterfs storage-gluster)
290 - $(use_with iscsi storage-iscsi)
291 - $(use_with libvirtd)
292 - $(use_with lvm storage-lvm)
293 - $(use_with lvm storage-mpath)
294 - $(use_with lxc)
295 - $(use_with macvtap)
296 - $(use_enable nls)
297 - $(use_with numa numactl)
298 - $(use_with numa numad)
299 - $(use_with openvz)
300 - $(use_with parted storage-disk)
301 - $(use_with pcap libpcap)
302 - $(use_with phyp)
303 - $(use_with policykit polkit)
304 - $(use_with qemu)
305 - $(use_with qemu yajl)
306 - $(use_with rbd storage-rbd)
307 - $(use_with sasl)
308 - $(use_with selinux)
309 - $(use_with systemd systemd-daemon)
310 - $(usex systemd --with-init-script=systemd '')
311 - $(use_with udev)
312 - $(use_with uml)
313 - $(use_with vepa virtualport)
314 - $(use_with virt-network network)
315 - $(use_with wireshark-plugins wireshark-dissector)
316 - $(use_with xen)
317 - $(use_with xen xen-inotify)
318 - $(usex xen --with-libxl '')
319 -
320 - --without-hal
321 - --without-netcf
322 - --without-sanlock
323 - --without-xenapi
324 - --with-esx
325 - --with-qemu-group=$(usex caps qemu root)
326 - --with-qemu-user=$(usex caps qemu root)
327 - --with-remote
328 - --with-storage-fs
329 - --with-vmware
330 -
331 - --disable-static
332 - --disable-werror
333 -
334 - --with-html-subdir=${PF}/html
335 - --localstatedir=/var
336 - )
337 -
338 - if use virtualbox && has_version app-emulation/virtualbox-ose; then
339 - myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
340 - else
341 - myeconfargs+=( $(use_with virtualbox vbox) )
342 - fi
343 -
344 - autotools-utils_src_configure
345 -
346 - if [[ ${PV} = *9999* ]]; then
347 - # Restore gnulib's config.sub and config.guess
348 - # bug #377279
349 - (cd .gnulib && git reset --hard > /dev/null)
350 - fi
351 -
352 - # Workaround: Sometimes this subdirectory is missing and leads to a
353 - # build failure.
354 - mkdir -p "${BUILD_DIR}"/docs/internals
355 -}
356 -
357 -src_test() {
358 - # Explicitly allow parallel build of tests
359 - export VIR_TEST_DEBUG=1
360 - HOME="${T}" emake check || die "tests failed"
361 -}
362 -
363 -src_install() {
364 - autotools-utils_src_compile install \
365 - DESTDIR="${D}" \
366 - SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
367 -
368 - find "${D}" -name '*.la' -delete || die
369 -
370 - # Remove bogus, empty directories. They are either not used, or
371 - # libvirtd is able to create them on demand
372 - rm -rf "${D}"/etc/sysconfig
373 - rm -rf "${D}"/var/cache
374 - rm -rf "${D}"/var/run
375 - rm -rf "${D}"/var/log
376 -
377 - use libvirtd || return 0
378 - # From here, only libvirtd-related instructions, be warned!
379 -
380 - use systemd && systemd_install_serviced \
381 - "${FILESDIR}"/libvirtd.service.conf libvirtd.service
382 -
383 - systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
384 -
385 - newinitd "${S}/libvirtd.init" libvirtd || die
386 - newinitd "${FILESDIR}/libvirt-guests.init-r1" libvirt-guests || die
387 - newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
388 - newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
389 -
390 - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
391 - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
392 -
393 - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
394 - DISABLE_AUTOFORMATTING=true
395 - readme.gentoo_create_doc
396 -}
397 -
398 -pkg_preinst() {
399 - # we only ever want to generate this once
400 - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
401 - rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
402 - fi
403 -}
404 -
405 -pkg_postinst() {
406 - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
407 - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
408 - fi
409 -
410 - use libvirtd || return 0
411 - # From here, only libvirtd-related instructions, be warned!
412 -
413 - if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
414 - FORCE_PRINT_ELOG=true
415 - fi
416 -
417 - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
418 - DISABLE_AUTOFORMATTING=true
419 - readme.gentoo_print_elog
420 -}
421
422 diff --git a/app-emulation/libvirt/libvirt-1.3.2-r1.ebuild b/app-emulation/libvirt/libvirt-1.3.2-r1.ebuild
423 deleted file mode 100644
424 index 667ff6e..0000000
425 --- a/app-emulation/libvirt/libvirt-1.3.2-r1.ebuild
426 +++ /dev/null
427 @@ -1,385 +0,0 @@
428 -# Copyright 1999-2016 Gentoo Foundation
429 -# Distributed under the terms of the GNU General Public License v2
430 -# $Id$
431 -
432 -EAPI=5
433 -
434 -inherit eutils user autotools-utils linux-info systemd readme.gentoo
435 -
436 -BACKPORTS=""
437 -
438 -if [[ ${PV} = *9999* ]]; then
439 - inherit git-r3
440 - EGIT_REPO_URI="git://libvirt.org/libvirt.git"
441 - SRC_URI=""
442 - KEYWORDS=""
443 - SLOT="0"
444 -else
445 - # Versions with 4 numbers are stable updates:
446 - if [[ ${PV} =~ ^[0-9]+(\.[0-9]+){3} ]]; then
447 - SRC_URI="http://libvirt.org/sources/stable_updates/${P}.tar.gz"
448 - else
449 - SRC_URI="http://libvirt.org/sources/${P}.tar.gz"
450 - fi
451 - SRC_URI+=" ${BACKPORTS:+
452 - https://dev.gentoo.org/~cardoe/distfiles/${P}-${BACKPORTS}.tar.xz
453 - https://dev.gentoo.org/~tamiko/distfiles/${P}-${BACKPORTS}.tar.xz}"
454 - KEYWORDS="~amd64 ~x86"
455 - SLOT="0/${PV}"
456 -fi
457 -
458 -DESCRIPTION="C toolkit to manipulate virtual machines"
459 -HOMEPAGE="http://www.libvirt.org/"
460 -LICENSE="LGPL-2.1"
461 -IUSE="apparmor audit avahi +caps firewalld fuse glusterfs iscsi +libvirtd lvm \
462 - lxc +macvtap nfs nls numa openvz parted pcap phyp policykit +qemu rbd sasl \
463 - selinux systemd +udev uml +vepa virtualbox virt-network wireshark-plugins \
464 - xen"
465 -
466 -REQUIRED_USE="
467 - firewalld? ( virt-network )
468 - libvirtd? ( || ( lxc openvz qemu uml virtualbox xen ) )
469 - lxc? ( caps libvirtd )
470 - openvz? ( libvirtd )
471 - qemu? ( libvirtd )
472 - uml? ( libvirtd )
473 - vepa? ( macvtap )
474 - virt-network? ( libvirtd )
475 - virtualbox? ( libvirtd )
476 - xen? ( libvirtd )"
477 -
478 -# gettext.sh command is used by the libvirt command wrappers, and it's
479 -# non-optional, so put it into RDEPEND.
480 -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
481 -# package will use 3 by default. Since we don't have slot pinning in an API,
482 -# we must go with the most recent
483 -RDEPEND="
484 - app-misc/scrub
485 - dev-libs/libgcrypt:0
486 - dev-libs/libnl:3
487 - >=dev-libs/libxml2-2.7.6
488 - >=net-analyzer/netcat6-1.0-r2
489 - >=net-libs/gnutls-1.0.25
490 - net-libs/libssh2
491 - >=net-misc/curl-7.18.0
492 - sys-apps/dmidecode
493 - >=sys-apps/util-linux-2.17
494 - sys-devel/gettext
495 - sys-libs/ncurses:0=
496 - sys-libs/readline:=
497 - apparmor? ( sys-libs/libapparmor )
498 - audit? ( sys-process/audit )
499 - avahi? ( >=net-dns/avahi-0.6[dbus] )
500 - caps? ( sys-libs/libcap-ng )
501 - firewalld? ( net-firewall/firewalld )
502 - fuse? ( >=sys-fs/fuse-2.8.6 )
503 - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
504 - iscsi? ( sys-block/open-iscsi )
505 - lvm? ( >=sys-fs/lvm2-2.02.48-r2 )
506 - lxc? ( !systemd? ( sys-power/pm-utils ) )
507 - nfs? ( net-fs/nfs-utils )
508 - numa? (
509 - >sys-process/numactl-2.0.2
510 - sys-process/numad
511 - )
512 - openvz? ( sys-kernel/openvz-sources:* )
513 - parted? (
514 - >=sys-block/parted-1.8[device-mapper]
515 - sys-fs/lvm2
516 - )
517 - pcap? ( >=net-libs/libpcap-1.0.0 )
518 - policykit? ( >=sys-auth/polkit-0.9 )
519 - qemu? (
520 - >=app-emulation/qemu-0.13.0
521 - dev-libs/yajl
522 - !systemd? ( sys-power/pm-utils )
523 - )
524 - rbd? ( sys-cluster/ceph )
525 - sasl? ( dev-libs/cyrus-sasl )
526 - selinux? ( >=sys-libs/libselinux-2.0.85 )
527 - systemd? ( sys-apps/systemd )
528 - virt-network? (
529 - net-dns/dnsmasq[script]
530 - net-firewall/ebtables
531 - >=net-firewall/iptables-1.4.10[ipv6]
532 - net-misc/radvd
533 - sys-apps/iproute2[-minimal]
534 - )
535 - virtualbox? ( || ( app-emulation/virtualbox >=app-emulation/virtualbox-bin-2.2.0 ) )
536 - wireshark-plugins? ( net-analyzer/wireshark:= )
537 - xen? (
538 - app-emulation/xen
539 - app-emulation/xen-tools:=
540 - )
541 - udev? (
542 - virtual/udev
543 - >=x11-libs/libpciaccess-0.10.9
544 - )"
545 -
546 -DEPEND="${RDEPEND}
547 - app-text/xhtml1
548 - dev-lang/perl
549 - dev-libs/libxslt
550 - dev-perl/XML-XPath
551 - virtual/pkgconfig"
552 -
553 -pkg_setup() {
554 - enewgroup qemu 77
555 - enewuser qemu 77 -1 -1 qemu kvm
556 -
557 - # Some people used the masked ebuild which was not adding the qemu
558 - # user to the kvm group originally. This results in VMs failing to
559 - # start for some users. bug #430808
560 - egetent group kvm | grep -q qemu
561 - if [[ $? -ne 0 ]]; then
562 - gpasswd -a qemu kvm
563 - fi
564 -
565 - # Check kernel configuration:
566 - CONFIG_CHECK=""
567 - use fuse && CONFIG_CHECK+="
568 - ~FUSE_FS"
569 -
570 - use lvm && CONFIG_CHECK+="
571 - ~BLK_DEV_DM
572 - ~DM_MULTIPATH
573 - ~DM_SNAPSHOT"
574 -
575 - use lxc && CONFIG_CHECK+="
576 - ~BLK_CGROUP
577 - ~CGROUP_CPUACCT
578 - ~CGROUP_DEVICE
579 - ~CGROUP_FREEZER
580 - ~CGROUP_NET_PRIO
581 - ~CGROUP_PERF
582 - ~CGROUPS
583 - ~CGROUP_SCHED
584 - ~CPUSETS
585 - ~DEVPTS_MULTIPLE_INSTANCES
586 - ~IPC_NS
587 - ~MACVLAN
588 - ~NAMESPACES
589 - ~NET_CLS_CGROUP
590 - ~NET_NS
591 - ~PID_NS
592 - ~POSIX_MQUEUE
593 - ~SECURITYFS
594 - ~USER_NS
595 - ~UTS_NS
596 - ~VETH
597 - ~!GRKERNSEC_CHROOT_MOUNT
598 - ~!GRKERNSEC_CHROOT_DOUBLE
599 - ~!GRKERNSEC_CHROOT_PIVOT
600 - ~!GRKERNSEC_CHROOT_CHMOD
601 - ~!GRKERNSEC_CHROOT_CAPS"
602 - # Handle specific kernel versions for different features
603 - kernel_is lt 3 6 && CONFIG_CHECK+=" ~CGROUP_MEM_RES_CTLR"
604 - kernel_is ge 3 6 && CONFIG_CHECK+=" ~MEMCG ~MEMCG_SWAP ~MEMCG_KMEM"
605 -
606 - use macvtap && CONFIG_CHECK+="
607 - ~MACVTAP"
608 -
609 - use virt-network && CONFIG_CHECK+="
610 - ~BRIDGE_EBT_MARK_T
611 - ~BRIDGE_NF_EBTABLES
612 - ~NETFILTER_ADVANCED
613 - ~NETFILTER_XT_CONNMARK
614 - ~NETFILTER_XT_MARK
615 - ~NETFILTER_XT_TARGET_CHECKSUM"
616 - # Bandwidth Limiting Support
617 - use virt-network && CONFIG_CHECK+="
618 - ~BRIDGE_EBT_T_NAT
619 - ~NET_ACT_POLICE
620 - ~NET_CLS_FW
621 - ~NET_CLS_U32
622 - ~NET_SCH_HTB
623 - ~NET_SCH_INGRESS
624 - ~NET_SCH_SFQ"
625 -
626 - ERROR_USER_NS="Optional depending on LXC configuration."
627 -
628 - if [[ -n ${CONFIG_CHECK} ]]; then
629 - linux-info_pkg_setup
630 - fi
631 -}
632 -
633 -src_prepare() {
634 - touch "${S}/.mailmap"
635 -
636 - if [[ ${PV} = *9999* ]]; then
637 - # git checkouts require bootstrapping to create the configure script.
638 - # Additionally the submodules must be cloned to the right locations
639 - # bug #377279
640 - ./bootstrap || die "bootstrap failed"
641 - (
642 - git submodule status | sed 's/^[ +-]//;s/ .*//'
643 - git hash-object bootstrap.conf
644 - ) >.git-module-status
645 - fi
646 -
647 - epatch \
648 - "${FILESDIR}"/${PN}-1.3.0-do_not_use_sysconf.patch \
649 - "${FILESDIR}"/${PN}-1.2.16-fix_paths_in_libvirt-guests_sh.patch \
650 - "${FILESDIR}"/${PN}-1.3.1-fix_paths_for_apparmor.patch \
651 - "${FILESDIR}"/${PN}-1.2.21-avoid_deprecated_pc_file.patch
652 -
653 - [[ -n ${BACKPORTS} ]] &&
654 - EPATCH_FORCE=yes EPATCH_SUFFIX="patch" \
655 - EPATCH_SOURCE="${WORKDIR}/patches" epatch
656 -
657 - epatch_user
658 -
659 - # Tweak the init script:
660 - cp "${FILESDIR}/libvirtd.init-r16" "${S}/libvirtd.init" || die
661 - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
662 - -e "s/USE_FLAG_AVAHI/$(usex avahi 'use avahi-daemon' '')/" \
663 - -e "s/USE_FLAG_ISCSI/$(usex iscsi 'use iscsid' '')/" \
664 - -e "s/USE_FLAG_RBD/$(usex rbd 'use ceph' '')/" \
665 - -i "${S}/libvirtd.init" || die "sed failed"
666 -
667 - AUTOTOOLS_AUTORECONF=true
668 - autotools-utils_src_prepare
669 -}
670 -
671 -src_configure() {
672 - local myeconfargs=(
673 - $(use_with apparmor)
674 - $(use_with apparmor apparmor-profiles)
675 - $(use_with audit)
676 - $(use_with avahi)
677 - $(use_with caps capng)
678 - $(use_with firewalld)
679 - $(use_with fuse)
680 - $(use_with glusterfs)
681 - $(use_with glusterfs storage-gluster)
682 - $(use_with iscsi storage-iscsi)
683 - $(use_with libvirtd)
684 - $(use_with lvm storage-lvm)
685 - $(use_with lvm storage-mpath)
686 - $(use_with lxc)
687 - $(use_with macvtap)
688 - $(use_enable nls)
689 - $(use_with numa numactl)
690 - $(use_with numa numad)
691 - $(use_with openvz)
692 - $(use_with parted storage-disk)
693 - $(use_with pcap libpcap)
694 - $(use_with phyp)
695 - $(use_with policykit polkit)
696 - $(use_with qemu)
697 - $(use_with qemu yajl)
698 - $(use_with rbd storage-rbd)
699 - $(use_with sasl)
700 - $(use_with selinux)
701 - $(use_with systemd systemd-daemon)
702 - $(usex systemd --with-init-script=systemd '')
703 - $(use_with udev)
704 - $(use_with uml)
705 - $(use_with vepa virtualport)
706 - $(use_with virt-network network)
707 - $(use_with wireshark-plugins wireshark-dissector)
708 - $(use_with xen)
709 - $(use_with xen xen-inotify)
710 - $(usex xen --with-libxl '')
711 -
712 - --without-hal
713 - --without-netcf
714 - --without-sanlock
715 - --without-xenapi
716 - --with-esx
717 - --with-qemu-group=$(usex caps qemu root)
718 - --with-qemu-user=$(usex caps qemu root)
719 - --with-remote
720 - --with-storage-fs
721 - --with-vmware
722 -
723 - --disable-static
724 - --disable-werror
725 -
726 - --with-html-subdir=${PF}/html
727 - --localstatedir=/var
728 - )
729 -
730 - if use virtualbox && has_version app-emulation/virtualbox-ose; then
731 - myeconfargs+=( --with-vbox=/usr/lib/virtualbox-ose/ )
732 - else
733 - myeconfargs+=( $(use_with virtualbox vbox) )
734 - fi
735 -
736 - autotools-utils_src_configure
737 -
738 - if [[ ${PV} = *9999* ]]; then
739 - # Restore gnulib's config.sub and config.guess
740 - # bug #377279
741 - (cd .gnulib && git reset --hard > /dev/null)
742 - fi
743 -
744 - # Workaround: Sometimes this subdirectory is missing and leads to a
745 - # build failure.
746 - mkdir -p "${BUILD_DIR}"/docs/internals
747 -}
748 -
749 -src_test() {
750 - # Explicitly allow parallel build of tests
751 - export VIR_TEST_DEBUG=1
752 - HOME="${T}" emake check || die "tests failed"
753 -}
754 -
755 -src_install() {
756 - autotools-utils_src_compile install \
757 - DESTDIR="${D}" \
758 - SYSTEMD_UNIT_DIR="$(systemd_get_unitdir)"
759 -
760 - find "${D}" -name '*.la' -delete || die
761 -
762 - # Remove bogus, empty directories. They are either not used, or
763 - # libvirtd is able to create them on demand
764 - rm -rf "${D}"/etc/sysconfig
765 - rm -rf "${D}"/var/cache
766 - rm -rf "${D}"/var/run
767 - rm -rf "${D}"/var/log
768 -
769 - use libvirtd || return 0
770 - # From here, only libvirtd-related instructions, be warned!
771 -
772 - use systemd && systemd_install_serviced \
773 - "${FILESDIR}"/libvirtd.service.conf libvirtd.service
774 -
775 - systemd_newtmpfilesd "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
776 -
777 - newinitd "${S}/libvirtd.init" libvirtd || die
778 - newinitd "${FILESDIR}/libvirt-guests.init-r2" libvirt-guests || die
779 - newinitd "${FILESDIR}/virtlockd.init-r1" virtlockd || die
780 - newinitd "${FILESDIR}/virtlogd.init-r1" virtlogd || die
781 -
782 - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd || die
783 - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests || die
784 -
785 - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
786 - DISABLE_AUTOFORMATTING=true
787 - readme.gentoo_create_doc
788 -}
789 -
790 -pkg_preinst() {
791 - # we only ever want to generate this once
792 - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
793 - rm -rf "${D}"/etc/libvirt/qemu/networks/default.xml
794 - fi
795 -}
796 -
797 -pkg_postinst() {
798 - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
799 - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml
800 - fi
801 -
802 - use libvirtd || return 0
803 - # From here, only libvirtd-related instructions, be warned!
804 -
805 - if [[ -n ${REPLACING_VERSIONS} ]] && ! version_is_at_least 1.2.18-r2 ${REPLACING_VERSIONS} ]]; then
806 - FORCE_PRINT_ELOG=true
807 - fi
808 -
809 - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r1")
810 - DISABLE_AUTOFORMATTING=true
811 - readme.gentoo_print_elog
812 -}