Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/libvirt/
Date: Mon, 04 Jul 2022 23:24:19
Message-Id: 1656976858.29fbca71c7b3066edae261709f796c33db4463e5.sam@gentoo
1 commit: 29fbca71c7b3066edae261709f796c33db4463e5
2 Author: Michal Privoznik <michal.privoznik <AT> gmail <DOT> com>
3 AuthorDate: Mon Jul 4 07:03:40 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 4 23:20:58 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=29fbca71
7
8 app-emulation/libvirt: add 8.5.0
9
10 Signed-off-by: Michal Privoznik <michal.privoznik <AT> gmail.com>
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 app-emulation/libvirt/Manifest | 2 +
14 app-emulation/libvirt/libvirt-8.5.0.ebuild | 340 +++++++++++++++++++++++++++++
15 2 files changed, 342 insertions(+)
16
17 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
18 index 879c08d531e1..d365dcb0b366 100644
19 --- a/app-emulation/libvirt/Manifest
20 +++ b/app-emulation/libvirt/Manifest
21 @@ -12,3 +12,5 @@ DIST libvirt-8.3.0.tar.xz 8829288 BLAKE2B 37890dac8f46e14c5f0329f7f3318b611bfe3b
22 DIST libvirt-8.3.0.tar.xz.asc 833 BLAKE2B d1faf041532fc4c33641cab0510401db2fb1c45004f2615df6807729d7a83a8a28bd2410eb5478e479e7cd1b28272ee92885b30ecdccb8a9390536df51377d5e SHA512 5c32087769aba0d2a245a4ce317e1428842a682cf71e03e5f33fc4476309f40c08118241b1ad2b4be14933971431960b89960858a1f841ab1b7c9bda9f571d52
23 DIST libvirt-8.4.0.tar.xz 8846528 BLAKE2B 479d7d47a9d711e0240da09eb295f1a644bc4cfddbe544908f2011eb45dff9cf9ffdfff87ba63ded96f5b69024c65832326f9fb0837c5338114ad5dbbada7af1 SHA512 e9dcaa489f162e3a26fe1ca7bb83a22e3f1952594c3541ddd2a7f8e8a0e6ad37e193fb89421df1efe3d2a4d9bb7cf5455c7b7a0b59e133eb6c0ff3cbbd8403b6
24 DIST libvirt-8.4.0.tar.xz.asc 833 BLAKE2B 7bfbfc05ce7d95018c07e92d475bc0fddbb0b396132c12defd0205638d22534ba83fea8180345635b9f59b8a10fd3177b1a84ad748f1ddb9e533e11700bd4cbd SHA512 5d85ce4764dc36d940033c5feda59b9cff64844a52e3a25b1b8d0278adbc2378978a7dbe6f577f82bc760d617edc75c4a6ab8e1325a38847e1d40e3bf7c9684b
25 +DIST libvirt-8.5.0.tar.xz 8886088 BLAKE2B a789b5d4d4f3d359403b53b1b6bdc31ddd8938d12fce3c77e953a30be359a3f75071c385bc8ce3df11ccc7ad682e433c067781948cf107abef84e54d5aadd0d9 SHA512 62b05c5cd58eab0ab2d945b832fd85807aea9b5f12a7ef5d1205fe0edac8d361ba3a9245f60f200a8548c96f718943d4502d87fff87c4495bd1e2637f14aaccf
26 +DIST libvirt-8.5.0.tar.xz.asc 833 BLAKE2B 2e4ee3309e409fa700b0e09c067d2d7978f5033bc947108012582a9ba4b6a5438a2f419375e10b342dd0082560768eab1913aea86558293abc9a51bdb87111eb SHA512 d05482a7d0ef5649428368553e7a9c49a116435b273179c13248081711ecc2d8fa1f6ad82a3d5ce43efc2afee51718bc3362e483463c61ebd10dbcc41875749e
27
28 diff --git a/app-emulation/libvirt/libvirt-8.5.0.ebuild b/app-emulation/libvirt/libvirt-8.5.0.ebuild
29 new file mode 100644
30 index 000000000000..1ac6f7431bdb
31 --- /dev/null
32 +++ b/app-emulation/libvirt/libvirt-8.5.0.ebuild
33 @@ -0,0 +1,340 @@
34 +# Copyright 1999-2022 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=8
38 +
39 +# Packages which get releases together:
40 +# app-emacs/nxml-libvirt-schemas
41 +# dev-python/libvirt-python
42 +# dev-perl/Sys-Virt
43 +# app-emulation/libvirt
44 +# Please bump them together!
45 +
46 +PYTHON_COMPAT=( python3_{8..11} )
47 +VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/libvirt.org.asc
48 +inherit meson bash-completion-r1 linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig
49 +
50 +if [[ ${PV} = *9999* ]]; then
51 + inherit git-r3
52 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git"
53 + EGIT_BRANCH="master"
54 +else
55 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz
56 + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )"
57 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
58 +fi
59 +
60 +DESCRIPTION="C toolkit to manipulate virtual machines"
61 +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/"
62 +LICENSE="LGPL-2.1"
63 +SLOT="0/${PV}"
64 +IUSE="
65 + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs
66 + iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz
67 + parted pcap policykit +qemu rbd sasl selinux +udev
68 + virtualbox +virt-network wireshark-plugins xen zfs
69 +"
70 +
71 +REQUIRED_USE="
72 + firewalld? ( virt-network )
73 + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
74 + lxc? ( caps libvirtd )
75 + openvz? ( libvirtd )
76 + qemu? ( libvirtd )
77 + virt-network? ( libvirtd )
78 + virtualbox? ( libvirtd )
79 + xen? ( libvirtd )"
80 +
81 +BDEPEND="
82 + app-text/xhtml1
83 + dev-lang/perl
84 + dev-libs/libxslt
85 + dev-perl/XML-XPath
86 + dev-python/docutils
87 + virtual/pkgconfig
88 + net-libs/rpcsvc-proto
89 + bash-completion? ( >=app-shells/bash-completion-2.0 )
90 + verify-sig? ( sec-keys/openpgp-keys-libvirt )"
91 +
92 +# gettext.sh command is used by the libvirt command wrappers, and it's
93 +# non-optional, so put it into RDEPEND.
94 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
95 +# package will use 3 by default. Since we don't have slot pinning in an API,
96 +# we must go with the most recent
97 +RDEPEND="
98 + acct-user/qemu
99 + app-misc/scrub
100 + >=dev-libs/glib-2.56.0
101 + dev-libs/libgcrypt
102 + dev-libs/libnl:3
103 + >=dev-libs/libxml2-2.9.1
104 + >=net-analyzer/openbsd-netcat-1.105-r1
105 + >=net-libs/gnutls-3.2.0:=
106 + net-libs/libtirpc:=
107 + >=net-misc/curl-7.18.0
108 + sys-apps/dbus
109 + sys-apps/dmidecode
110 + sys-devel/gettext
111 + >=sys-libs/readline-7.0:=
112 + virtual/acl
113 + apparmor? ( sys-libs/libapparmor )
114 + audit? ( sys-process/audit )
115 + caps? ( sys-libs/libcap-ng )
116 + dtrace? ( dev-util/systemtap )
117 + firewalld? ( >=net-firewall/firewalld-0.6.3 )
118 + fuse? ( sys-fs/fuse:= )
119 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
120 + iscsi? ( >=sys-block/open-iscsi-1.18.0 )
121 + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
122 + libssh? ( >=net-libs/libssh-0.7:= )
123 + libssh2? ( >=net-libs/libssh2-1.3 )
124 + lvm? ( >=sys-fs/lvm2-2.02.48-r2[-device-mapper-only(-)] )
125 + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] )
126 + nfs? ( net-fs/nfs-utils )
127 + numa? (
128 + >sys-process/numactl-2.0.2
129 + sys-process/numad
130 + )
131 + parted? (
132 + >=sys-block/parted-1.8[device-mapper]
133 + sys-fs/lvm2[-device-mapper-only(-)]
134 + )
135 + pcap? ( >=net-libs/libpcap-1.8.0 )
136 + policykit? (
137 + acct-group/libvirt
138 + >=sys-auth/polkit-0.9
139 + )
140 + qemu? (
141 + >=app-emulation/qemu-2.11
142 + >=dev-libs/yajl-2.0.3:=
143 + )
144 + rbd? ( sys-cluster/ceph )
145 + sasl? ( >=dev-libs/cyrus-sasl-2.1.26 )
146 + selinux? ( >=sys-libs/libselinux-2.0.85 )
147 + virt-network? (
148 + net-dns/dnsmasq[dhcp,ipv6(+),script]
149 + net-firewall/ebtables
150 + >=net-firewall/iptables-1.4.10[ipv6(+)]
151 + net-misc/radvd
152 + sys-apps/iproute2[-minimal]
153 + )
154 + wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= )
155 + xen? (
156 + >=app-emulation/xen-4.9.0
157 + app-emulation/xen-tools:=
158 + )
159 + udev? (
160 + virtual/libudev:=
161 + >=x11-libs/libpciaccess-0.10.9
162 + )
163 + zfs? ( sys-fs/zfs )
164 + kernel_linux? ( sys-apps/util-linux )"
165 +DEPEND="${BDEPEND}
166 + ${RDEPEND}
167 + ${PYTHON_DEPS}"
168 +
169 +PATCHES=(
170 + "${FILESDIR}"/${PN}-6.0.0-fix_paths_in_libvirt-guests_sh.patch
171 + "${FILESDIR}"/${PN}-8.2.0-do-not-use-sysconfig.patch
172 + "${FILESDIR}"/${PN}-8.2.0-fix-paths-for-apparmor.patch
173 +)
174 +
175 +pkg_setup() {
176 + # Check kernel configuration:
177 + CONFIG_CHECK=""
178 + use fuse && CONFIG_CHECK+="
179 + ~FUSE_FS"
180 +
181 + use lvm && CONFIG_CHECK+="
182 + ~BLK_DEV_DM
183 + ~DM_MULTIPATH
184 + ~DM_SNAPSHOT"
185 +
186 + use lxc && CONFIG_CHECK+="
187 + ~BLK_CGROUP
188 + ~CGROUP_CPUACCT
189 + ~CGROUP_DEVICE
190 + ~CGROUP_FREEZER
191 + ~CGROUP_NET_PRIO
192 + ~CGROUP_PERF
193 + ~CGROUPS
194 + ~CGROUP_SCHED
195 + ~CPUSETS
196 + ~IPC_NS
197 + ~MACVLAN
198 + ~NAMESPACES
199 + ~NET_CLS_CGROUP
200 + ~NET_NS
201 + ~PID_NS
202 + ~POSIX_MQUEUE
203 + ~SECURITYFS
204 + ~USER_NS
205 + ~UTS_NS
206 + ~VETH
207 + ~!GRKERNSEC_CHROOT_MOUNT
208 + ~!GRKERNSEC_CHROOT_DOUBLE
209 + ~!GRKERNSEC_CHROOT_PIVOT
210 + ~!GRKERNSEC_CHROOT_CHMOD
211 + ~!GRKERNSEC_CHROOT_CAPS"
212 +
213 + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+="
214 + ~DEVPTS_MULTIPLE_INSTANCES"
215 +
216 + use virt-network && CONFIG_CHECK+="
217 + ~BRIDGE_EBT_MARK_T
218 + ~BRIDGE_NF_EBTABLES
219 + ~NETFILTER_ADVANCED
220 + ~NETFILTER_XT_CONNMARK
221 + ~NETFILTER_XT_MARK
222 + ~NETFILTER_XT_TARGET_CHECKSUM
223 + ~IP_NF_FILTER
224 + ~IP_NF_MANGLE
225 + ~IP_NF_NAT
226 + ~IP_NF_TARGET_MASQUERADE
227 + ~IP6_NF_FILTER
228 + ~IP6_NF_MANGLE
229 + ~IP6_NF_NAT"
230 + # Bandwidth Limiting Support
231 + use virt-network && CONFIG_CHECK+="
232 + ~BRIDGE_EBT_T_NAT
233 + ~IP_NF_TARGET_REJECT
234 + ~NET_ACT_POLICE
235 + ~NET_CLS_FW
236 + ~NET_CLS_U32
237 + ~NET_SCH_HTB
238 + ~NET_SCH_INGRESS
239 + ~NET_SCH_SFQ"
240 +
241 + ERROR_USER_NS="Optional depending on LXC configuration."
242 +
243 + if [[ -n ${CONFIG_CHECK} ]]; then
244 + linux-info_pkg_setup
245 + fi
246 +
247 + python-any-r1_pkg_setup
248 +}
249 +
250 +src_prepare() {
251 + touch "${S}/.mailmap" || die
252 +
253 + default
254 + python_fix_shebang .
255 +
256 + # Skip fragile tests which relies on pristine environment
257 + # (Breaks because of sandbox environment variables)
258 + # bug #802876
259 + sed -i -e "/commandtest/d" tests/meson.build || die
260 +
261 + # Tweak the init script:
262 + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
263 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
264 + -i "${S}/libvirtd.init" || die "sed failed"
265 +}
266 +
267 +src_configure() {
268 + local emesonargs=(
269 + $(meson_feature apparmor)
270 + $(meson_feature apparmor apparmor_profiles)
271 + $(meson_feature audit)
272 + $(meson_feature caps capng)
273 + $(meson_feature dtrace)
274 + $(meson_feature firewalld)
275 + $(meson_feature fuse)
276 + $(meson_feature glusterfs)
277 + $(meson_feature glusterfs storage_gluster)
278 + $(meson_feature iscsi storage_iscsi)
279 + $(meson_feature iscsi-direct storage_iscsi_direct)
280 + $(meson_feature libvirtd driver_libvirtd)
281 + $(meson_feature libssh)
282 + $(meson_feature libssh2)
283 + $(meson_feature lvm storage_lvm)
284 + $(meson_feature lvm storage_mpath)
285 + $(meson_feature lxc driver_lxc)
286 + $(meson_feature nls)
287 + $(meson_feature numa numactl)
288 + $(meson_feature numa numad)
289 + $(meson_feature openvz driver_openvz)
290 + $(meson_feature parted storage_disk)
291 + $(meson_feature pcap libpcap)
292 + $(meson_feature policykit polkit)
293 + $(meson_feature qemu driver_qemu)
294 + $(meson_feature qemu yajl)
295 + $(meson_feature rbd storage_rbd)
296 + $(meson_feature sasl)
297 + $(meson_feature selinux)
298 + $(meson_feature udev)
299 + $(meson_feature virt-network driver_network)
300 + $(meson_feature virtualbox driver_vbox)
301 + $(meson_feature wireshark-plugins wireshark_dissector)
302 + $(meson_feature xen driver_libxl)
303 + $(meson_feature zfs storage_zfs)
304 +
305 + -Dnetcf=disabled
306 + -Dsanlock=disabled
307 +
308 + -Ddriver_esx=enabled
309 + -Dinit_script=systemd
310 + -Dqemu_user=$(usex caps qemu root)
311 + -Dqemu_group=$(usex caps qemu root)
312 + -Ddriver_remote=enabled
313 + -Dstorage_fs=enabled
314 + -Ddriver_vmware=enabled
315 +
316 + --localstatedir="${EPREFIX}/var"
317 + -Drunstatedir="${EPREFIX}/run"
318 + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
319 + )
320 +
321 + meson_src_configure
322 +}
323 +
324 +src_test() {
325 + export VIR_TEST_DEBUG=1
326 + # Don't run the syntax check tests, they're fragile and not relevant
327 + # to us downstream anyway.
328 + # We also crank up the timeout (as Fedora does) just to preempt failures
329 + # on slower arches.
330 + meson_src_test --no-suite syntax-check --timeout-multiplier 10
331 +}
332 +
333 +src_install() {
334 + meson_src_install
335 +
336 + # Depending on configuration option, libvirt will create some bogus
337 + # directoreis. They are either not used, or libvirtd is able to create
338 + # them on demand, so let's remove them.
339 + #
340 + # Note, we are using -f here so that rm does not fail or warn if the
341 + # directory is nonexistent.
342 + rm -rf "${D}"/etc/sysconfig
343 + rm -rf "${D}"/var
344 + rm -rf "${D}"/run
345 +
346 + use libvirtd || return 0
347 + # From here, only libvirtd-related instructions, be warned!
348 +
349 + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
350 +
351 + newinitd "${S}/libvirtd.init" libvirtd
352 + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
353 + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
354 + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
355 +
356 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
357 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
358 +
359 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
360 + DISABLE_AUTOFORMATTING=true
361 + readme.gentoo_create_doc
362 +}
363 +
364 +pkg_postinst() {
365 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
366 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die
367 + fi
368 +
369 + use libvirtd || return 0
370 + # From here, only libvirtd-related instructions, be warned!
371 + tmpfiles_process libvirtd.conf
372 + readme.gentoo_print_elog
373 +}