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: Wed, 08 Dec 2021 03:23:16
Message-Id: 1638933506.b1877e99f228d5c4ec84a49f8806d38c41ac77af.tamiko@gentoo
1 commit: b1877e99f228d5c4ec84a49f8806d38c41ac77af
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 8 03:18:26 2021 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 8 03:18:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1877e99
7
8 app-emulation/libvirt: version bump to 7.9.0 and 7.10.0
9
10 Package-Manager: Portage-3.0.28, Repoman-3.0.3
11 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
12
13 app-emulation/libvirt/Manifest | 4 +
14 app-emulation/libvirt/libvirt-7.10.0.ebuild | 336 ++++++++++++++++++++++++++++
15 app-emulation/libvirt/libvirt-7.9.0.ebuild | 336 ++++++++++++++++++++++++++++
16 3 files changed, 676 insertions(+)
17
18 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
19 index 64d3b21ae74d..5cde70f50158 100644
20 --- a/app-emulation/libvirt/Manifest
21 +++ b/app-emulation/libvirt/Manifest
22 @@ -2,6 +2,8 @@ DIST libvirt-7.0.0.tar.xz 8567648 BLAKE2B 0c0b360c371a14b6d82dc6bef4b228bf7a4a17
23 DIST libvirt-7.0.0.tar.xz.asc 833 BLAKE2B 7cc16442f39de660caa38801b12994ca312b250d6c3e5bbef38613702a03cd31cb9b7eaa792af4f8c1b737d67e62f18baa02b481e7fa4d6ec8fc9a07a44db4de SHA512 fb0b6240dbb4e827456f6c573bb3466f19282383bcee5bae8ece923260eca6d252f64b1adfac9a26fdac2a57bb9390aa4c0071e54d16d3e294230b3562764f18
24 DIST libvirt-7.1.0.tar.xz 8645944 BLAKE2B 97a76091616b427fc64a6a3caf5d9b04d7b9aed7ff7a6d70536ca2eb95d902f0f5ed4b5e56fbdfc6c40f443fb68f4850cff0545256826e575e78fea97158e8f7 SHA512 475b212e920bf8587db4a551126d9eb417d4e18a72550f94feb1aec94821fbac8c84d67ffd59cfe4f8289b6b10ae5f6b579ee170c0d72cb0493ec7ec52183cd6
25 DIST libvirt-7.1.0.tar.xz.asc 833 BLAKE2B 2610cff98967260a5005840e1b03cff16790da82d9a51f14d6b34453db3ba89aa34915bba69d57b333f50d17e2492c77e85ee4e6282b8fe5f4cd0f7ace638334 SHA512 6c92c91bc7f23b32deee3442008b44d6469a9cabf2ed39459afcbfce9b3f2b1b655514a068c4bcdc8909ba02a0a4762e8f845ae4dba8da18719acf45614ca6da
26 +DIST libvirt-7.10.0.tar.xz 8798000 BLAKE2B 6cb2ab5913d382b11d24b46154dc3250355050cd3038f64ba571b35f33ae5bd0a322d4b96469bd6c78fd848c87f2e6fc7213c33e5bdb9d375a9b81d2a40899bb SHA512 c7eecc9538b68852a8cc67565566d64ec7b087b6f009858b2eb524bc3ef0f6ca3c0da67edf801e6a3ae3fcc0364e65e108fa92bcb01ee810c85fa5f37785aa32
27 +DIST libvirt-7.10.0.tar.xz.asc 833 BLAKE2B b9e129dcce43a87320b7284264c0689ce45742c0038a68c86fe7a0b789ddc2a49794fe89ae30d4d3675e884891a3b335b61beeb7ff0c5291fbc763ca6629de40 SHA512 41ef8e5fe9a8d1d6ba1c4fa8bd8204b0be83b50d3c936765d7ad005e75600287de0f13e0b14fab4d94d2d4b8bf8916fbe869cbfccf6293cc61c854513a0ef0c3
28 DIST libvirt-7.2.0.tar.xz 8661052 BLAKE2B eae6b4e7422690dd780e1647e2a39dfdff0562f3e63bce9ca5ee34540dec3755269efaad459d1b516b56fdeb1503cc966ffa60378aaa18210b972b739716fe34 SHA512 f6bb26ca7cb5a8d342f1f39afd051ed76b71414e1b934557cf50784da17e4f2fb3301c2ace3b593fcdeb6a18ad559a007ad594111c2c348b9157d3a59d475928
29 DIST libvirt-7.2.0.tar.xz.asc 833 BLAKE2B c389d80ef4f7627230b88446ef77daab1bf34e49e20cfb5c5418500fdf388af23aeb2458551548cb732c868f87f35a5c28acff8c01faebe985a6953953a69149 SHA512 526955a9f9d294635e63a4ed20c3e478fb4b5f3a63150a59ff30d84ad16a286ddb4c6508d0317c56df63a0d22a099085697df344fe2b15bce07acf9f05cda331
30 DIST libvirt-7.3.0.tar.xz 8680468 BLAKE2B 88ad3dbac627203419eb80b28649613480a287014688b5b75b9a18d60b3d2b2c6628c803384ce0eed81bf84cdc0dd8539b072f32ccf0319f09bebaaeb0e089bf SHA512 e039d5cc000c0f29ead4faddf154852ee8d8b5943e940b717eabb33cc9990d3f257a942b05a661bf6c36df5b5763c31df3f8b5a0fc21e8111a81c57da42d903e
31 @@ -14,3 +16,5 @@ DIST libvirt-7.7.0.tar.xz 8670212 BLAKE2B 93c72117941b0a74484c7510c8437054e66fc3
32 DIST libvirt-7.7.0.tar.xz.asc 833 BLAKE2B 86a77bf461e353776d79f31f1d0c82fa13e28348bd9c6ae7cb653b98886c7e070d67ed0db55f5e1f3b5e5bd2a3861a5cb08dbf95799b14df1037139f8001b030 SHA512 d5f8cd6accd3bfaebfb7c8761e321aaa9a090c7705256785c5507aa88d985f78a788047dc881f37ea6f64a4634c65c9718d8b1ee0a24744acc3ad5ed6e517bdf
33 DIST libvirt-7.8.0.tar.xz 8735184 BLAKE2B 44ad9465a0bcb683777677de87e422741fe88d604297297f859ba94378b91b80855b9d4cd91de60a1c140c6dc2b4cb61020296933f68526605945e8accfadbcb SHA512 0fe31b70178d662a5c8019ef424568b95d9d4c2eb74113c1b697ccf4eef1e110c3095e19835cef2c9459a694a5f4785b0761c19ec78062af88c39651291fa040
34 DIST libvirt-7.8.0.tar.xz.asc 833 BLAKE2B 10d315ec715a9ede62103276631ca4ac95feb543faea984e108f4d74857dbc3929d799a7b28d1816a3a6736fa388489a0c44ec01c6eef27528a94f997e8b2d65 SHA512 283c486ca9a56442f9aaead20e71e496a169f902ea33ad7ffe2a830630a50b4314abdd477727c502d3c273506f2a0014079420079907b568da449aaf546f3b60
35 +DIST libvirt-7.9.0.tar.xz 8785056 BLAKE2B 524b9bbddcf45d441a5b306bdb44bf1d1e54a9dd6867fb7daed833e58d5324cdc3f3d57601b4d2df7e19ace4df73868e45b291bf58813bbd9b746304ac940f55 SHA512 7185ac3da41f662b8142d144a1360f5ed5471812e6961933f2f404a7b88f32739b9b780c809bb8ce04dd56ff13d4486f60dd6725a660cf9f019e15cae49b36bf
36 +DIST libvirt-7.9.0.tar.xz.asc 833 BLAKE2B 295174bcf25352dec83508e7e36cc6e6d12ac514217ed6e27fa3d6dac8b1365d4b8f335ffadd8c33ab70e164f6f82639abf5e496844a23c3f0bf0c557dec56c8 SHA512 570b33dfc0f58c6322d41d3990e4d6f670a10311c221b1b3cd5a746e58e51e520214649891386e5b289c118735e9c17a1f9f478b50fa69c732ca3811074c8c8c
37
38 diff --git a/app-emulation/libvirt/libvirt-7.10.0.ebuild b/app-emulation/libvirt/libvirt-7.10.0.ebuild
39 new file mode 100644
40 index 000000000000..e20eaa25a6c2
41 --- /dev/null
42 +++ b/app-emulation/libvirt/libvirt-7.10.0.ebuild
43 @@ -0,0 +1,336 @@
44 +# Copyright 1999-2021 Gentoo Authors
45 +# Distributed under the terms of the GNU General Public License v2
46 +
47 +EAPI=7
48 +
49 +PYTHON_COMPAT=( python3_{8..10} )
50 +
51 +inherit meson bash-completion-r1 linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig
52 +
53 +if [[ ${PV} = *9999* ]]; then
54 + inherit git-r3
55 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git"
56 + EGIT_BRANCH="master"
57 + SRC_URI=""
58 + SLOT="0"
59 +else
60 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz
61 + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )"
62 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
63 + SLOT="0/${PV}"
64 +fi
65 +
66 +DESCRIPTION="C toolkit to manipulate virtual machines"
67 +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/"
68 +LICENSE="LGPL-2.1"
69 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/libvirt.org.asc
70 +IUSE="
71 + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs
72 + iscsi iscsi-direct +libvirtd lvm libssh lxc nfs nls numa openvz
73 + parted pcap policykit +qemu rbd sasl selinux +udev
74 + virtualbox +virt-network wireshark-plugins xen zfs
75 +"
76 +
77 +REQUIRED_USE="
78 + firewalld? ( virt-network )
79 + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
80 + lxc? ( caps libvirtd )
81 + openvz? ( libvirtd )
82 + qemu? ( libvirtd )
83 + virt-network? ( libvirtd )
84 + virtualbox? ( libvirtd )
85 + xen? ( libvirtd )"
86 +
87 +BDEPEND="
88 + app-text/xhtml1
89 + dev-lang/perl
90 + dev-libs/libxslt
91 + dev-perl/XML-XPath
92 + dev-python/docutils
93 + virtual/pkgconfig
94 + bash-completion? ( >=app-shells/bash-completion-2.0 )
95 + verify-sig? ( app-crypt/openpgp-keys-libvirt )"
96 +
97 +# gettext.sh command is used by the libvirt command wrappers, and it's
98 +# non-optional, so put it into RDEPEND.
99 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
100 +# package will use 3 by default. Since we don't have slot pinning in an API,
101 +# we must go with the most recent
102 +RDEPEND="
103 + acct-user/qemu
104 + app-misc/scrub
105 + >=dev-libs/glib-2.48.0
106 + dev-libs/libgcrypt:0
107 + dev-libs/libnl:3
108 + >=dev-libs/libxml2-2.7.6
109 + >=net-analyzer/openbsd-netcat-1.105-r1
110 + >=net-libs/gnutls-1.0.25:0=
111 + net-libs/libssh2
112 + net-libs/libtirpc
113 + net-libs/rpcsvc-proto
114 + >=net-misc/curl-7.18.0
115 + sys-apps/dbus
116 + sys-apps/dmidecode
117 + sys-devel/gettext
118 + sys-libs/ncurses:0=
119 + sys-libs/readline:=
120 + virtual/acl
121 + apparmor? ( sys-libs/libapparmor )
122 + audit? ( sys-process/audit )
123 + caps? ( sys-libs/libcap-ng )
124 + dtrace? ( dev-util/systemtap )
125 + firewalld? ( >=net-firewall/firewalld-0.6.3 )
126 + fuse? ( sys-fs/fuse:0= )
127 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
128 + iscsi? ( sys-block/open-iscsi )
129 + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
130 + libssh? ( net-libs/libssh )
131 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
132 + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] )
133 + nfs? ( net-fs/nfs-utils )
134 + numa? (
135 + >sys-process/numactl-2.0.2
136 + sys-process/numad
137 + )
138 + parted? (
139 + >=sys-block/parted-1.8[device-mapper]
140 + sys-fs/lvm2[-device-mapper-only(-)]
141 + )
142 + pcap? ( >=net-libs/libpcap-1.0.0 )
143 + policykit? (
144 + acct-group/libvirt
145 + >=sys-auth/polkit-0.9
146 + )
147 + qemu? (
148 + >=app-emulation/qemu-2.11
149 + dev-libs/yajl
150 + )
151 + rbd? ( sys-cluster/ceph )
152 + sasl? ( dev-libs/cyrus-sasl )
153 + selinux? ( >=sys-libs/libselinux-2.0.85 )
154 + virt-network? (
155 + net-dns/dnsmasq[dhcp,ipv6,script]
156 + net-firewall/ebtables
157 + >=net-firewall/iptables-1.4.10[ipv6]
158 + net-misc/radvd
159 + sys-apps/iproute2[-minimal]
160 + )
161 + wireshark-plugins? ( net-analyzer/wireshark:= )
162 + xen? (
163 + >=app-emulation/xen-4.9.0
164 + app-emulation/xen-tools:=
165 + )
166 + udev? (
167 + virtual/libudev
168 + >=x11-libs/libpciaccess-0.10.9
169 + )
170 + zfs? ( sys-fs/zfs )"
171 +
172 +DEPEND="${BDEPEND}
173 + ${RDEPEND}
174 + ${PYTHON_DEPS}"
175 +
176 +PATCHES=(
177 + "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
178 + "${FILESDIR}"/${PN}-6.7.0-do-not-use-sysconfig.patch
179 + "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
180 +)
181 +
182 +pkg_setup() {
183 + # Check kernel configuration:
184 + CONFIG_CHECK=""
185 + use fuse && CONFIG_CHECK+="
186 + ~FUSE_FS"
187 +
188 + use lvm && CONFIG_CHECK+="
189 + ~BLK_DEV_DM
190 + ~DM_MULTIPATH
191 + ~DM_SNAPSHOT"
192 +
193 + use lxc && CONFIG_CHECK+="
194 + ~BLK_CGROUP
195 + ~CGROUP_CPUACCT
196 + ~CGROUP_DEVICE
197 + ~CGROUP_FREEZER
198 + ~CGROUP_NET_PRIO
199 + ~CGROUP_PERF
200 + ~CGROUPS
201 + ~CGROUP_SCHED
202 + ~CPUSETS
203 + ~IPC_NS
204 + ~MACVLAN
205 + ~NAMESPACES
206 + ~NET_CLS_CGROUP
207 + ~NET_NS
208 + ~PID_NS
209 + ~POSIX_MQUEUE
210 + ~SECURITYFS
211 + ~USER_NS
212 + ~UTS_NS
213 + ~VETH
214 + ~!GRKERNSEC_CHROOT_MOUNT
215 + ~!GRKERNSEC_CHROOT_DOUBLE
216 + ~!GRKERNSEC_CHROOT_PIVOT
217 + ~!GRKERNSEC_CHROOT_CHMOD
218 + ~!GRKERNSEC_CHROOT_CAPS"
219 +
220 + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
221 + ~DEVPTS_MULTIPLE_INSTANCES"
222 +
223 + use virt-network && CONFIG_CHECK+="
224 + ~BRIDGE_EBT_MARK_T
225 + ~BRIDGE_NF_EBTABLES
226 + ~NETFILTER_ADVANCED
227 + ~NETFILTER_XT_CONNMARK
228 + ~NETFILTER_XT_MARK
229 + ~NETFILTER_XT_TARGET_CHECKSUM
230 + ~IP_NF_FILTER
231 + ~IP_NF_MANGLE
232 + ~IP_NF_NAT
233 + ~IP_NF_TARGET_MASQUERADE
234 + ~IP6_NF_FILTER
235 + ~IP6_NF_MANGLE
236 + ~IP6_NF_NAT"
237 + # Bandwidth Limiting Support
238 + use virt-network && CONFIG_CHECK+="
239 + ~BRIDGE_EBT_T_NAT
240 + ~IP_NF_TARGET_REJECT
241 + ~NET_ACT_POLICE
242 + ~NET_CLS_FW
243 + ~NET_CLS_U32
244 + ~NET_SCH_HTB
245 + ~NET_SCH_INGRESS
246 + ~NET_SCH_SFQ"
247 +
248 + ERROR_USER_NS="Optional depending on LXC configuration."
249 +
250 + if [[ -n ${CONFIG_CHECK} ]]; then
251 + linux-info_pkg_setup
252 + fi
253 +
254 + python-any-r1_pkg_setup
255 +}
256 +
257 +src_prepare() {
258 + touch "${S}/.mailmap" || die
259 +
260 + default
261 + python_fix_shebang .
262 +
263 + # Skip fragile tests which relies on pristine environment
264 + # (Breaks because of sandbox environment variables)
265 + # bug #802876
266 + sed -i -e "/commandtest/d" tests/meson.build || die
267 +
268 + # Tweak the init script:
269 + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
270 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
271 + -i "${S}/libvirtd.init" || die "sed failed"
272 +}
273 +
274 +src_configure() {
275 + local emesonargs=(
276 + $(meson_feature apparmor)
277 + $(meson_feature apparmor apparmor_profiles)
278 + $(meson_feature audit)
279 + $(meson_feature caps capng)
280 + $(meson_feature dtrace)
281 + $(meson_feature firewalld)
282 + $(meson_feature fuse)
283 + $(meson_feature glusterfs)
284 + $(meson_feature glusterfs storage_gluster)
285 + $(meson_feature iscsi storage_iscsi)
286 + $(meson_feature iscsi-direct storage_iscsi_direct)
287 + $(meson_feature libvirtd driver_libvirtd)
288 + $(meson_feature libssh)
289 + $(meson_feature lvm storage_lvm)
290 + $(meson_feature lvm storage_mpath)
291 + $(meson_feature lxc driver_lxc)
292 + $(meson_feature nls)
293 + $(meson_feature numa numactl)
294 + $(meson_feature numa numad)
295 + $(meson_feature openvz driver_openvz)
296 + $(meson_feature parted storage_disk)
297 + $(meson_feature pcap libpcap)
298 + $(meson_feature policykit polkit)
299 + $(meson_feature qemu driver_qemu)
300 + $(meson_feature qemu yajl)
301 + $(meson_feature rbd storage_rbd)
302 + $(meson_feature sasl)
303 + $(meson_feature selinux)
304 + $(meson_feature udev)
305 + $(meson_feature virt-network driver_network)
306 + $(meson_feature virtualbox driver_vbox)
307 + $(meson_feature wireshark-plugins wireshark_dissector)
308 + $(meson_feature xen driver_libxl)
309 + $(meson_feature zfs storage_zfs)
310 +
311 + -Dnetcf=disabled
312 + -Dsanlock=disabled
313 +
314 + -Ddriver_esx=enabled
315 + -Dinit_script=systemd
316 + -Dqemu_user=$(usex caps qemu root)
317 + -Dqemu_group=$(usex caps qemu root)
318 + -Ddriver_remote=enabled
319 + -Dstorage_fs=enabled
320 + -Ddriver_vmware=enabled
321 +
322 + --localstatedir="${EPREFIX}/var"
323 + -Drunstatedir="${EPREFIX}/run"
324 + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
325 + )
326 +
327 + meson_src_configure
328 +}
329 +
330 +src_test() {
331 + export VIR_TEST_DEBUG=1
332 + # Don't run the syntax check tests, they're fragile and not relevant
333 + # to us downstream anyway.
334 + # We also crank up the timeout (as Fedora does) just to preempt failures
335 + # on slower arches.
336 + meson_src_test --no-suite syntax-check --timeout-multiplier 10
337 +}
338 +
339 +src_install() {
340 + meson_src_install
341 +
342 + # Depending on configuration option, libvirt will create some bogus
343 + # directoreis. They are either not used, or libvirtd is able to create
344 + # them on demand, so let's remove them.
345 + #
346 + # Note, we are using -f here so that rm does not fail or warn if the
347 + # directory is nonexistent.
348 + rm -rf "${D}"/etc/sysconfig
349 + rm -rf "${D}"/var
350 + rm -rf "${D}"/run
351 +
352 + use libvirtd || return 0
353 + # From here, only libvirtd-related instructions, be warned!
354 +
355 + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
356 +
357 + newinitd "${S}/libvirtd.init" libvirtd
358 + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
359 + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
360 + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
361 +
362 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
363 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
364 +
365 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
366 + DISABLE_AUTOFORMATTING=true
367 + readme.gentoo_create_doc
368 +}
369 +
370 +pkg_postinst() {
371 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
372 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die
373 + fi
374 +
375 + use libvirtd || return 0
376 + # From here, only libvirtd-related instructions, be warned!
377 + tmpfiles_process libvirtd.conf
378 + readme.gentoo_print_elog
379 +}
380
381 diff --git a/app-emulation/libvirt/libvirt-7.9.0.ebuild b/app-emulation/libvirt/libvirt-7.9.0.ebuild
382 new file mode 100644
383 index 000000000000..e20eaa25a6c2
384 --- /dev/null
385 +++ b/app-emulation/libvirt/libvirt-7.9.0.ebuild
386 @@ -0,0 +1,336 @@
387 +# Copyright 1999-2021 Gentoo Authors
388 +# Distributed under the terms of the GNU General Public License v2
389 +
390 +EAPI=7
391 +
392 +PYTHON_COMPAT=( python3_{8..10} )
393 +
394 +inherit meson bash-completion-r1 linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig
395 +
396 +if [[ ${PV} = *9999* ]]; then
397 + inherit git-r3
398 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git"
399 + EGIT_BRANCH="master"
400 + SRC_URI=""
401 + SLOT="0"
402 +else
403 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz
404 + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )"
405 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
406 + SLOT="0/${PV}"
407 +fi
408 +
409 +DESCRIPTION="C toolkit to manipulate virtual machines"
410 +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/"
411 +LICENSE="LGPL-2.1"
412 +VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/libvirt.org.asc
413 +IUSE="
414 + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs
415 + iscsi iscsi-direct +libvirtd lvm libssh lxc nfs nls numa openvz
416 + parted pcap policykit +qemu rbd sasl selinux +udev
417 + virtualbox +virt-network wireshark-plugins xen zfs
418 +"
419 +
420 +REQUIRED_USE="
421 + firewalld? ( virt-network )
422 + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
423 + lxc? ( caps libvirtd )
424 + openvz? ( libvirtd )
425 + qemu? ( libvirtd )
426 + virt-network? ( libvirtd )
427 + virtualbox? ( libvirtd )
428 + xen? ( libvirtd )"
429 +
430 +BDEPEND="
431 + app-text/xhtml1
432 + dev-lang/perl
433 + dev-libs/libxslt
434 + dev-perl/XML-XPath
435 + dev-python/docutils
436 + virtual/pkgconfig
437 + bash-completion? ( >=app-shells/bash-completion-2.0 )
438 + verify-sig? ( app-crypt/openpgp-keys-libvirt )"
439 +
440 +# gettext.sh command is used by the libvirt command wrappers, and it's
441 +# non-optional, so put it into RDEPEND.
442 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
443 +# package will use 3 by default. Since we don't have slot pinning in an API,
444 +# we must go with the most recent
445 +RDEPEND="
446 + acct-user/qemu
447 + app-misc/scrub
448 + >=dev-libs/glib-2.48.0
449 + dev-libs/libgcrypt:0
450 + dev-libs/libnl:3
451 + >=dev-libs/libxml2-2.7.6
452 + >=net-analyzer/openbsd-netcat-1.105-r1
453 + >=net-libs/gnutls-1.0.25:0=
454 + net-libs/libssh2
455 + net-libs/libtirpc
456 + net-libs/rpcsvc-proto
457 + >=net-misc/curl-7.18.0
458 + sys-apps/dbus
459 + sys-apps/dmidecode
460 + sys-devel/gettext
461 + sys-libs/ncurses:0=
462 + sys-libs/readline:=
463 + virtual/acl
464 + apparmor? ( sys-libs/libapparmor )
465 + audit? ( sys-process/audit )
466 + caps? ( sys-libs/libcap-ng )
467 + dtrace? ( dev-util/systemtap )
468 + firewalld? ( >=net-firewall/firewalld-0.6.3 )
469 + fuse? ( sys-fs/fuse:0= )
470 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
471 + iscsi? ( sys-block/open-iscsi )
472 + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
473 + libssh? ( net-libs/libssh )
474 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
475 + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] )
476 + nfs? ( net-fs/nfs-utils )
477 + numa? (
478 + >sys-process/numactl-2.0.2
479 + sys-process/numad
480 + )
481 + parted? (
482 + >=sys-block/parted-1.8[device-mapper]
483 + sys-fs/lvm2[-device-mapper-only(-)]
484 + )
485 + pcap? ( >=net-libs/libpcap-1.0.0 )
486 + policykit? (
487 + acct-group/libvirt
488 + >=sys-auth/polkit-0.9
489 + )
490 + qemu? (
491 + >=app-emulation/qemu-2.11
492 + dev-libs/yajl
493 + )
494 + rbd? ( sys-cluster/ceph )
495 + sasl? ( dev-libs/cyrus-sasl )
496 + selinux? ( >=sys-libs/libselinux-2.0.85 )
497 + virt-network? (
498 + net-dns/dnsmasq[dhcp,ipv6,script]
499 + net-firewall/ebtables
500 + >=net-firewall/iptables-1.4.10[ipv6]
501 + net-misc/radvd
502 + sys-apps/iproute2[-minimal]
503 + )
504 + wireshark-plugins? ( net-analyzer/wireshark:= )
505 + xen? (
506 + >=app-emulation/xen-4.9.0
507 + app-emulation/xen-tools:=
508 + )
509 + udev? (
510 + virtual/libudev
511 + >=x11-libs/libpciaccess-0.10.9
512 + )
513 + zfs? ( sys-fs/zfs )"
514 +
515 +DEPEND="${BDEPEND}
516 + ${RDEPEND}
517 + ${PYTHON_DEPS}"
518 +
519 +PATCHES=(
520 + "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
521 + "${FILESDIR}"/${PN}-6.7.0-do-not-use-sysconfig.patch
522 + "${FILESDIR}"/${PN}-6.7.0-fix-paths-for-apparmor.patch
523 +)
524 +
525 +pkg_setup() {
526 + # Check kernel configuration:
527 + CONFIG_CHECK=""
528 + use fuse && CONFIG_CHECK+="
529 + ~FUSE_FS"
530 +
531 + use lvm && CONFIG_CHECK+="
532 + ~BLK_DEV_DM
533 + ~DM_MULTIPATH
534 + ~DM_SNAPSHOT"
535 +
536 + use lxc && CONFIG_CHECK+="
537 + ~BLK_CGROUP
538 + ~CGROUP_CPUACCT
539 + ~CGROUP_DEVICE
540 + ~CGROUP_FREEZER
541 + ~CGROUP_NET_PRIO
542 + ~CGROUP_PERF
543 + ~CGROUPS
544 + ~CGROUP_SCHED
545 + ~CPUSETS
546 + ~IPC_NS
547 + ~MACVLAN
548 + ~NAMESPACES
549 + ~NET_CLS_CGROUP
550 + ~NET_NS
551 + ~PID_NS
552 + ~POSIX_MQUEUE
553 + ~SECURITYFS
554 + ~USER_NS
555 + ~UTS_NS
556 + ~VETH
557 + ~!GRKERNSEC_CHROOT_MOUNT
558 + ~!GRKERNSEC_CHROOT_DOUBLE
559 + ~!GRKERNSEC_CHROOT_PIVOT
560 + ~!GRKERNSEC_CHROOT_CHMOD
561 + ~!GRKERNSEC_CHROOT_CAPS"
562 +
563 + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
564 + ~DEVPTS_MULTIPLE_INSTANCES"
565 +
566 + use virt-network && CONFIG_CHECK+="
567 + ~BRIDGE_EBT_MARK_T
568 + ~BRIDGE_NF_EBTABLES
569 + ~NETFILTER_ADVANCED
570 + ~NETFILTER_XT_CONNMARK
571 + ~NETFILTER_XT_MARK
572 + ~NETFILTER_XT_TARGET_CHECKSUM
573 + ~IP_NF_FILTER
574 + ~IP_NF_MANGLE
575 + ~IP_NF_NAT
576 + ~IP_NF_TARGET_MASQUERADE
577 + ~IP6_NF_FILTER
578 + ~IP6_NF_MANGLE
579 + ~IP6_NF_NAT"
580 + # Bandwidth Limiting Support
581 + use virt-network && CONFIG_CHECK+="
582 + ~BRIDGE_EBT_T_NAT
583 + ~IP_NF_TARGET_REJECT
584 + ~NET_ACT_POLICE
585 + ~NET_CLS_FW
586 + ~NET_CLS_U32
587 + ~NET_SCH_HTB
588 + ~NET_SCH_INGRESS
589 + ~NET_SCH_SFQ"
590 +
591 + ERROR_USER_NS="Optional depending on LXC configuration."
592 +
593 + if [[ -n ${CONFIG_CHECK} ]]; then
594 + linux-info_pkg_setup
595 + fi
596 +
597 + python-any-r1_pkg_setup
598 +}
599 +
600 +src_prepare() {
601 + touch "${S}/.mailmap" || die
602 +
603 + default
604 + python_fix_shebang .
605 +
606 + # Skip fragile tests which relies on pristine environment
607 + # (Breaks because of sandbox environment variables)
608 + # bug #802876
609 + sed -i -e "/commandtest/d" tests/meson.build || die
610 +
611 + # Tweak the init script:
612 + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
613 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
614 + -i "${S}/libvirtd.init" || die "sed failed"
615 +}
616 +
617 +src_configure() {
618 + local emesonargs=(
619 + $(meson_feature apparmor)
620 + $(meson_feature apparmor apparmor_profiles)
621 + $(meson_feature audit)
622 + $(meson_feature caps capng)
623 + $(meson_feature dtrace)
624 + $(meson_feature firewalld)
625 + $(meson_feature fuse)
626 + $(meson_feature glusterfs)
627 + $(meson_feature glusterfs storage_gluster)
628 + $(meson_feature iscsi storage_iscsi)
629 + $(meson_feature iscsi-direct storage_iscsi_direct)
630 + $(meson_feature libvirtd driver_libvirtd)
631 + $(meson_feature libssh)
632 + $(meson_feature lvm storage_lvm)
633 + $(meson_feature lvm storage_mpath)
634 + $(meson_feature lxc driver_lxc)
635 + $(meson_feature nls)
636 + $(meson_feature numa numactl)
637 + $(meson_feature numa numad)
638 + $(meson_feature openvz driver_openvz)
639 + $(meson_feature parted storage_disk)
640 + $(meson_feature pcap libpcap)
641 + $(meson_feature policykit polkit)
642 + $(meson_feature qemu driver_qemu)
643 + $(meson_feature qemu yajl)
644 + $(meson_feature rbd storage_rbd)
645 + $(meson_feature sasl)
646 + $(meson_feature selinux)
647 + $(meson_feature udev)
648 + $(meson_feature virt-network driver_network)
649 + $(meson_feature virtualbox driver_vbox)
650 + $(meson_feature wireshark-plugins wireshark_dissector)
651 + $(meson_feature xen driver_libxl)
652 + $(meson_feature zfs storage_zfs)
653 +
654 + -Dnetcf=disabled
655 + -Dsanlock=disabled
656 +
657 + -Ddriver_esx=enabled
658 + -Dinit_script=systemd
659 + -Dqemu_user=$(usex caps qemu root)
660 + -Dqemu_group=$(usex caps qemu root)
661 + -Ddriver_remote=enabled
662 + -Dstorage_fs=enabled
663 + -Ddriver_vmware=enabled
664 +
665 + --localstatedir="${EPREFIX}/var"
666 + -Drunstatedir="${EPREFIX}/run"
667 + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
668 + )
669 +
670 + meson_src_configure
671 +}
672 +
673 +src_test() {
674 + export VIR_TEST_DEBUG=1
675 + # Don't run the syntax check tests, they're fragile and not relevant
676 + # to us downstream anyway.
677 + # We also crank up the timeout (as Fedora does) just to preempt failures
678 + # on slower arches.
679 + meson_src_test --no-suite syntax-check --timeout-multiplier 10
680 +}
681 +
682 +src_install() {
683 + meson_src_install
684 +
685 + # Depending on configuration option, libvirt will create some bogus
686 + # directoreis. They are either not used, or libvirtd is able to create
687 + # them on demand, so let's remove them.
688 + #
689 + # Note, we are using -f here so that rm does not fail or warn if the
690 + # directory is nonexistent.
691 + rm -rf "${D}"/etc/sysconfig
692 + rm -rf "${D}"/var
693 + rm -rf "${D}"/run
694 +
695 + use libvirtd || return 0
696 + # From here, only libvirtd-related instructions, be warned!
697 +
698 + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
699 +
700 + newinitd "${S}/libvirtd.init" libvirtd
701 + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
702 + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
703 + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
704 +
705 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
706 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
707 +
708 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
709 + DISABLE_AUTOFORMATTING=true
710 + readme.gentoo_create_doc
711 +}
712 +
713 +pkg_postinst() {
714 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
715 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die
716 + fi
717 +
718 + use libvirtd || return 0
719 + # From here, only libvirtd-related instructions, be warned!
720 + tmpfiles_process libvirtd.conf
721 + readme.gentoo_print_elog
722 +}