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, 09 Jun 2021 20:43:33
Message-Id: 1623271405.6843b227a59d890d3544c21d086344393f4d9a09.tamiko@gentoo
1 commit: 6843b227a59d890d3544c21d086344393f4d9a09
2 Author: Jonathan Davies <jpds <AT> protonmail <DOT> com>
3 AuthorDate: Wed Jun 2 16:36:20 2021 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 9 20:43:25 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6843b227
7
8 app-emulation/libvirt: Version updated to 7.4.0, with changes:
9
10 * Use meson_feature for apparmor_profiles.
11
12 Closes: https://github.com/gentoo/gentoo/pull/21092
13 Signed-off-by: Jonathan Davies <jpds <AT> protonmail.com>
14 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
15
16 app-emulation/libvirt/Manifest | 2 +
17 app-emulation/libvirt/libvirt-7.4.0.ebuild | 327 +++++++++++++++++++++++++++++
18 2 files changed, 329 insertions(+)
19
20 diff --git a/app-emulation/libvirt/Manifest b/app-emulation/libvirt/Manifest
21 index cd23471daa1..8e02ca9a1ce 100644
22 --- a/app-emulation/libvirt/Manifest
23 +++ b/app-emulation/libvirt/Manifest
24 @@ -6,3 +6,5 @@ DIST libvirt-7.2.0.tar.xz 8661052 BLAKE2B eae6b4e7422690dd780e1647e2a39dfdff0562
25 DIST libvirt-7.2.0.tar.xz.asc 833 BLAKE2B c389d80ef4f7627230b88446ef77daab1bf34e49e20cfb5c5418500fdf388af23aeb2458551548cb732c868f87f35a5c28acff8c01faebe985a6953953a69149 SHA512 526955a9f9d294635e63a4ed20c3e478fb4b5f3a63150a59ff30d84ad16a286ddb4c6508d0317c56df63a0d22a099085697df344fe2b15bce07acf9f05cda331
26 DIST libvirt-7.3.0.tar.xz 8680468 BLAKE2B 88ad3dbac627203419eb80b28649613480a287014688b5b75b9a18d60b3d2b2c6628c803384ce0eed81bf84cdc0dd8539b072f32ccf0319f09bebaaeb0e089bf SHA512 e039d5cc000c0f29ead4faddf154852ee8d8b5943e940b717eabb33cc9990d3f257a942b05a661bf6c36df5b5763c31df3f8b5a0fc21e8111a81c57da42d903e
27 DIST libvirt-7.3.0.tar.xz.asc 833 BLAKE2B 812a7cf4bcaef88a4229008579a18da19d78b0a988890359907e4067b5eb6d74176907875a3a27775ffabaf29fb4d0e92c7f2ec13042ef8657c09ad6b287984d SHA512 f5349bb6c7919b54518a2ffc058592fb588045d37d18dfce5efb7e2f512c2a19b0f956d6ee34a16982cdaec4c23954300f7e130656afeb3cf535c65a0d62c04e
28 +DIST libvirt-7.4.0.tar.xz 8617788 BLAKE2B 06271895ac39865df632b6ad669eb20d1f1bb774b4a854ee2461174ac5ccf688b0f8ecffc2d9d0b12491e0e948beb377d52efdf40a2729d14b4b3d9bc8835cc2 SHA512 efe3fb2813613c3c5e94ed49d0cae4ad92cca6a727a8b55808d8c3bdfacb355642796dfab49362ee59654f9471f9134b96374ced50cc9b3227f4f1c6201bf7f1
29 +DIST libvirt-7.4.0.tar.xz.asc 833 BLAKE2B c9d63bb9cdd604663754ccd927a5a1305131617b1d4edb51d289878ff67b7168e882ec1bf0f16aaea509aa32b8419a3c6420615051bd8f42216ce9d1aeae601b SHA512 9a887cf73fb494e55617a69863a0877fba56d180fecbec892a7990f76bc6e1fe15871b4e688e88289eb7acf3ab4a70c1d6202b224cf3c9a96ecb1ecfb2279b2c
30
31 diff --git a/app-emulation/libvirt/libvirt-7.4.0.ebuild b/app-emulation/libvirt/libvirt-7.4.0.ebuild
32 new file mode 100644
33 index 00000000000..ccc4f6f1ce7
34 --- /dev/null
35 +++ b/app-emulation/libvirt/libvirt-7.4.0.ebuild
36 @@ -0,0 +1,327 @@
37 +# Copyright 1999-2021 Gentoo Authors
38 +# Distributed under the terms of the GNU General Public License v2
39 +
40 +EAPI=7
41 +
42 +PYTHON_COMPAT=( python3_{7,8,9} )
43 +
44 +inherit meson bash-completion-r1 linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig
45 +
46 +if [[ ${PV} = *9999* ]]; then
47 + inherit git-r3
48 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git"
49 + EGIT_BRANCH="master"
50 + SRC_URI=""
51 + SLOT="0"
52 +else
53 + SRC_URI="https://libvirt.org/sources/${P}.tar.xz
54 + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )"
55 + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86"
56 + SLOT="0/${PV}"
57 +fi
58 +
59 +DESCRIPTION="C toolkit to manipulate virtual machines"
60 +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/"
61 +LICENSE="LGPL-2.1"
62 +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc
63 +IUSE="
64 + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs
65 + iscsi iscsi-direct +libvirtd lvm libssh lxc nfs nls numa openvz
66 + parted pcap policykit +qemu rbd sasl selinux +udev
67 + virtualbox +virt-network wireshark-plugins xen zfs
68 +"
69 +
70 +REQUIRED_USE="
71 + firewalld? ( virt-network )
72 + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) )
73 + lxc? ( caps libvirtd )
74 + openvz? ( libvirtd )
75 + qemu? ( libvirtd )
76 + virt-network? ( libvirtd )
77 + virtualbox? ( libvirtd )
78 + xen? ( libvirtd )"
79 +
80 +BDEPEND="
81 + app-text/xhtml1
82 + dev-lang/perl
83 + dev-libs/libxslt
84 + dev-perl/XML-XPath
85 + dev-python/docutils
86 + virtual/pkgconfig
87 + bash-completion? ( >=app-shells/bash-completion-2.0 )
88 + verify-sig? ( app-crypt/openpgp-keys-libvirt )"
89 +
90 +# gettext.sh command is used by the libvirt command wrappers, and it's
91 +# non-optional, so put it into RDEPEND.
92 +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the
93 +# package will use 3 by default. Since we don't have slot pinning in an API,
94 +# we must go with the most recent
95 +RDEPEND="
96 + acct-user/qemu
97 + app-misc/scrub
98 + >=dev-libs/glib-2.48.0
99 + dev-libs/libgcrypt:0
100 + dev-libs/libnl:3
101 + >=dev-libs/libxml2-2.7.6
102 + >=net-analyzer/openbsd-netcat-1.105-r1
103 + >=net-libs/gnutls-1.0.25:0=
104 + net-libs/libssh2
105 + net-libs/libtirpc
106 + net-libs/rpcsvc-proto
107 + >=net-misc/curl-7.18.0
108 + sys-apps/dbus
109 + sys-apps/dmidecode
110 + sys-devel/gettext
111 + sys-libs/ncurses:0=
112 + sys-libs/readline:=
113 + virtual/acl
114 + apparmor? ( sys-libs/libapparmor )
115 + audit? ( sys-process/audit )
116 + caps? ( sys-libs/libcap-ng )
117 + dtrace? ( dev-util/systemtap )
118 + firewalld? ( >=net-firewall/firewalld-0.6.3 )
119 + fuse? ( sys-fs/fuse:0= )
120 + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 )
121 + iscsi? ( sys-block/open-iscsi )
122 + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 )
123 + libssh? ( net-libs/libssh )
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.0.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
143 + )
144 + rbd? ( sys-cluster/ceph )
145 + sasl? ( dev-libs/cyrus-sasl )
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:= )
155 + xen? (
156 + >=app-emulation/xen-4.6.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 +
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}-6.7.0-do-not-use-sysconfig.patch
172 + "${FILESDIR}"/${PN}-6.7.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 + # Tweak the init script:
257 + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die
258 + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \
259 + -i "${S}/libvirtd.init" || die "sed failed"
260 +}
261 +
262 +src_configure() {
263 + local emesonargs=(
264 + $(meson_feature apparmor)
265 + $(meson_feature apparmor apparmor_profiles)
266 + $(meson_feature audit)
267 + $(meson_feature caps capng)
268 + $(meson_feature dtrace)
269 + $(meson_feature firewalld)
270 + $(meson_feature fuse)
271 + $(meson_feature glusterfs)
272 + $(meson_feature glusterfs storage_gluster)
273 + $(meson_feature iscsi storage_iscsi)
274 + $(meson_feature iscsi-direct storage_iscsi_direct)
275 + $(meson_feature libvirtd driver_libvirtd)
276 + $(meson_feature libssh)
277 + $(meson_feature lvm storage_lvm)
278 + $(meson_feature lvm storage_mpath)
279 + $(meson_feature lxc driver_lxc)
280 + $(meson_feature nls)
281 + $(meson_feature numa numactl)
282 + $(meson_feature numa numad)
283 + $(meson_feature openvz driver_openvz)
284 + $(meson_feature parted storage_disk)
285 + $(meson_feature pcap libpcap)
286 + $(meson_feature policykit polkit)
287 + $(meson_feature qemu driver_qemu)
288 + $(meson_feature qemu yajl)
289 + $(meson_feature rbd storage_rbd)
290 + $(meson_feature sasl)
291 + $(meson_feature selinux)
292 + $(meson_feature udev)
293 + $(meson_feature virt-network driver_network)
294 + $(meson_feature virtualbox driver_vbox)
295 + $(meson_feature wireshark-plugins wireshark_dissector)
296 + $(meson_feature xen driver_libxl)
297 + $(meson_feature zfs storage_zfs)
298 +
299 + -Dnetcf=disabled
300 + -Dsanlock=disabled
301 +
302 + -Ddriver_esx=enabled
303 + -Dinit_script=systemd
304 + -Dqemu_user=$(usex caps qemu root)
305 + -Dqemu_group=$(usex caps qemu root)
306 + -Ddriver_remote=enabled
307 + -Dstorage_fs=enabled
308 + -Ddriver_vmware=enabled
309 +
310 + --localstatedir="${EPREFIX}/var"
311 + -Drunstatedir="${EPREFIX}/run"
312 + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}"
313 + )
314 +
315 + meson_src_configure
316 +}
317 +
318 +src_test() {
319 + export VIR_TEST_DEBUG=1
320 + meson_src_test
321 +}
322 +
323 +src_install() {
324 + meson_src_install
325 +
326 + # Depending on configuration option, libvirt will create some bogus
327 + # directoreis. They are either not used, or libvirtd is able to create
328 + # them on demand, so let's remove them.
329 + #
330 + # Note, we are using -f here so that rm does not fail or warn if the
331 + # directory is nonexistent.
332 + rm -rf "${D}"/etc/sysconfig
333 + rm -rf "${D}"/var
334 + rm -rf "${D}"/run
335 +
336 + use libvirtd || return 0
337 + # From here, only libvirtd-related instructions, be warned!
338 +
339 + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf
340 +
341 + newinitd "${S}/libvirtd.init" libvirtd
342 + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests
343 + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd
344 + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd
345 +
346 + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd
347 + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests
348 +
349 + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3")
350 + DISABLE_AUTOFORMATTING=true
351 + readme.gentoo_create_doc
352 +}
353 +
354 +pkg_postinst() {
355 + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then
356 + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die
357 + fi
358 +
359 + use libvirtd || return 0
360 + # From here, only libvirtd-related instructions, be warned!
361 +
362 + readme.gentoo_print_elog
363 +}