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