From 3c32491d0bcded18663dd976934ad5c10b29d4c2 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Sat, 13 Apr 2024 20:53:12 +0200 Subject: app-emulation/libvirt: Backport fix for CVE-2024-2494 The fix made it into app-emulation/libvirt-10.2.0 release. Backport the fix into anything older. https://nvd.nist.gov/vuln/detail/CVE-2024-2494 Bug: https://bugs.gentoo.org/929966 Signed-off-by: Michal Privoznik Closes: https://github.com/gentoo/gentoo/pull/36242 Signed-off-by: Sam James --- ...k-for-negative-array-lengths-before-alloc.patch | 222 +++++++++++++ app-emulation/libvirt/libvirt-10.0.0-r1.ebuild | 366 -------------------- app-emulation/libvirt/libvirt-10.0.0-r2.ebuild | 367 +++++++++++++++++++++ app-emulation/libvirt/libvirt-10.1.0-r1.ebuild | 366 ++++++++++++++++++++ app-emulation/libvirt/libvirt-10.1.0.ebuild | 365 -------------------- app-emulation/libvirt/libvirt-9.8.0-r1.ebuild | 365 -------------------- app-emulation/libvirt/libvirt-9.8.0-r2.ebuild | 366 ++++++++++++++++++++ app-emulation/libvirt/libvirt-9.9.0-r1.ebuild | 366 -------------------- app-emulation/libvirt/libvirt-9.9.0-r2.ebuild | 367 +++++++++++++++++++++ 9 files changed, 1688 insertions(+), 1462 deletions(-) create mode 100644 app-emulation/libvirt/files/libvirt-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch delete mode 100644 app-emulation/libvirt/libvirt-10.0.0-r1.ebuild create mode 100644 app-emulation/libvirt/libvirt-10.0.0-r2.ebuild create mode 100644 app-emulation/libvirt/libvirt-10.1.0-r1.ebuild delete mode 100644 app-emulation/libvirt/libvirt-10.1.0.ebuild delete mode 100644 app-emulation/libvirt/libvirt-9.8.0-r1.ebuild create mode 100644 app-emulation/libvirt/libvirt-9.8.0-r2.ebuild delete mode 100644 app-emulation/libvirt/libvirt-9.9.0-r1.ebuild create mode 100644 app-emulation/libvirt/libvirt-9.9.0-r2.ebuild (limited to 'app-emulation') diff --git a/app-emulation/libvirt/files/libvirt-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch b/app-emulation/libvirt/files/libvirt-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch new file mode 100644 index 000000000000..3e0426634f42 --- /dev/null +++ b/app-emulation/libvirt/files/libvirt-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch @@ -0,0 +1,222 @@ +From 10fa5f6ba64b354b99b0f7b372e66e45bb4d9379 Mon Sep 17 00:00:00 2001 +Message-ID: <10fa5f6ba64b354b99b0f7b372e66e45bb4d9379.1713033988.git.mprivozn@redhat.com> +In-Reply-To: <2127032ed8cd49001465dc0dce9f842e13467bc2.1713033988.git.mprivozn@redhat.com> +References: <2127032ed8cd49001465dc0dce9f842e13467bc2.1713033988.git.mprivozn@redhat.com> +From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= +Date: Fri, 15 Mar 2024 10:47:50 +0000 +Subject: [PATCH 2/2] remote: check for negative array lengths before + allocation +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +While the C API entry points will validate non-negative lengths +for various parameters, the RPC server de-serialization code +will need to allocate memory for arrays before entering the C +API. These allocations will thus happen before the non-negative +length check is performed. + +Passing a negative length to the g_new0 function will usually +result in a crash due to the negative length being treated as +a huge positive number. + +This was found and diagnosed by ALT Linux Team with AFLplusplus. + +CVE-2024-2494 +Reviewed-by: Michal Privoznik +Found-by: Alexandr Shashkin +Co-developed-by: Alexander Kuznetsov +Signed-off-by: Daniel P. Berrangé +(cherry picked from commit 8a3f8d957507c1f8223fdcf25a3ff885b15557f2) +Signed-off-by: Michal Privoznik +--- + src/remote/remote_daemon_dispatch.c | 65 +++++++++++++++++++++++++++++ + src/rpc/gendispatch.pl | 5 +++ + 2 files changed, 70 insertions(+) + +diff --git a/src/remote/remote_daemon_dispatch.c b/src/remote/remote_daemon_dispatch.c +index 7daf503b51..7542caa952 100644 +--- a/src/remote/remote_daemon_dispatch.c ++++ b/src/remote/remote_daemon_dispatch.c +@@ -2291,6 +2291,10 @@ remoteDispatchDomainGetSchedulerParameters(virNetServer *server G_GNUC_UNUSED, + if (!conn) + goto cleanup; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -2339,6 +2343,10 @@ remoteDispatchDomainGetSchedulerParametersFlags(virNetServer *server G_GNUC_UNUS + if (!conn) + goto cleanup; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_SCHEDULER_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -2497,6 +2505,10 @@ remoteDispatchDomainBlockStatsFlags(virNetServer *server G_GNUC_UNUSED, + goto cleanup; + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_BLOCK_STATS_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -2717,6 +2729,14 @@ remoteDispatchDomainGetVcpuPinInfo(virNetServer *server G_GNUC_UNUSED, + if (!(dom = get_nonnull_domain(conn, args->dom))) + goto cleanup; + ++ if (args->ncpumaps < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("ncpumaps must be non-negative")); ++ goto cleanup; ++ } ++ if (args->maplen < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("maplen must be non-negative")); ++ goto cleanup; ++ } + if (args->ncpumaps > REMOTE_VCPUINFO_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("ncpumaps > REMOTE_VCPUINFO_MAX")); + goto cleanup; +@@ -2811,6 +2831,11 @@ remoteDispatchDomainGetEmulatorPinInfo(virNetServer *server G_GNUC_UNUSED, + if (!(dom = get_nonnull_domain(conn, args->dom))) + goto cleanup; + ++ if (args->maplen < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("maplen must be non-negative")); ++ goto cleanup; ++ } ++ + /* Allocate buffers to take the results */ + if (args->maplen > 0) + cpumaps = g_new0(unsigned char, args->maplen); +@@ -2858,6 +2883,14 @@ remoteDispatchDomainGetVcpus(virNetServer *server G_GNUC_UNUSED, + if (!(dom = get_nonnull_domain(conn, args->dom))) + goto cleanup; + ++ if (args->maxinfo < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("maxinfo must be non-negative")); ++ goto cleanup; ++ } ++ if (args->maplen < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("maxinfo must be non-negative")); ++ goto cleanup; ++ } + if (args->maxinfo > REMOTE_VCPUINFO_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("maxinfo > REMOTE_VCPUINFO_MAX")); + goto cleanup; +@@ -3096,6 +3129,10 @@ remoteDispatchDomainGetMemoryParameters(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_MEMORY_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -3156,6 +3193,10 @@ remoteDispatchDomainGetNumaParameters(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_NUMA_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -3216,6 +3257,10 @@ remoteDispatchDomainGetBlkioParameters(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_BLKIO_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -3277,6 +3322,10 @@ remoteDispatchNodeGetCPUStats(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_NODE_CPU_STATS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -3339,6 +3388,10 @@ remoteDispatchNodeGetMemoryStats(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_NODE_MEMORY_STATS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -3514,6 +3567,10 @@ remoteDispatchDomainGetBlockIoTune(virNetServer *server G_GNUC_UNUSED, + if (!conn) + goto cleanup; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_BLOCK_IO_TUNE_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -5079,6 +5136,10 @@ remoteDispatchDomainGetInterfaceParameters(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_DOMAIN_INTERFACE_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +@@ -5299,6 +5360,10 @@ remoteDispatchNodeGetMemoryParameters(virNetServer *server G_GNUC_UNUSED, + + flags = args->flags; + ++ if (args->nparams < 0) { ++ virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams must be non-negative")); ++ goto cleanup; ++ } + if (args->nparams > REMOTE_NODE_MEMORY_PARAMETERS_MAX) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", _("nparams too large")); + goto cleanup; +diff --git a/src/rpc/gendispatch.pl b/src/rpc/gendispatch.pl +index fa45d15a92..294e21f8a1 100755 +--- a/src/rpc/gendispatch.pl ++++ b/src/rpc/gendispatch.pl +@@ -1070,6 +1070,11 @@ elsif ($mode eq "server") { + print "\n"; + + if ($single_ret_as_list) { ++ print " if (args->$single_ret_list_max_var < 0) {\n"; ++ print " virReportError(VIR_ERR_RPC,\n"; ++ print " \"%s\", _(\"max$single_ret_list_name must be non-negative\"));\n"; ++ print " goto cleanup;\n"; ++ print " }\n"; + print " if (args->$single_ret_list_max_var > $single_ret_list_max_define) {\n"; + print " virReportError(VIR_ERR_RPC,\n"; + print " \"%s\", _(\"max$single_ret_list_name > $single_ret_list_max_define\"));\n"; +-- +2.43.2 + diff --git a/app-emulation/libvirt/libvirt-10.0.0-r1.ebuild b/app-emulation/libvirt/libvirt-10.0.0-r1.ebuild deleted file mode 100644 index 0f5860138006..000000000000 --- a/app-emulation/libvirt/libvirt-10.0.0-r1.ebuild +++ /dev/null @@ -1,366 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Packages which get releases together: -# app-emacs/nxml-libvirt-schemas -# dev-python/libvirt-python -# dev-perl/Sys-Virt -# app-emulation/libvirt -# Please bump them together! - -PYTHON_COMPAT=( python3_{9..12} ) -VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc -inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" - EGIT_BRANCH="master" -else - SRC_URI="https://libvirt.org/sources/${P}.tar.xz - verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" - KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" -fi - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" -LICENSE="LGPL-2.1" -SLOT="0/${PV}" -IUSE=" - apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs - iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nbd nfs nls numa - openvz parted pcap policykit +qemu rbd sasl selinux test +udev - virtiofsd virtualbox +virt-network wireshark-plugins xen zfs -" -RESTRICT="!test? ( test )" - -REQUIRED_USE=" - firewalld? ( virt-network ) - libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - qemu? ( libvirtd ) - virt-network? ( libvirtd ) - virtualbox? ( libvirtd ) - xen? ( libvirtd )" - -BDEPEND=" - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt - dev-perl/XML-XPath - dev-python/docutils - virtual/pkgconfig - bash-completion? ( >=app-shells/bash-completion-2.0 ) - verify-sig? ( sec-keys/openpgp-keys-libvirt )" - -# gettext.sh command is used by the libvirt command wrappers, and it's -# non-optional, so put it into RDEPEND. -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the -# package will use 3 by default. Since we don't have slot pinning in an API, -# we must go with the most recent. -RDEPEND=" - acct-user/qemu - app-misc/scrub - >=dev-libs/glib-2.56.0 - dev-libs/libgcrypt - dev-libs/libnl:3 - >=dev-libs/libxml2-2.9.1 - >=net-analyzer/openbsd-netcat-1.105-r1 - >=net-libs/gnutls-3.2.0:= - net-libs/libtirpc:= - >=net-misc/curl-7.18.0 - sys-apps/dbus - sys-apps/dmidecode - sys-devel/gettext - >=sys-libs/readline-7.0:= - virtual/acl - apparmor? ( sys-libs/libapparmor ) - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap-ng ) - dtrace? ( dev-debug/systemtap ) - firewalld? ( >=net-firewall/firewalld-0.6.3 ) - fuse? ( sys-fs/fuse:= ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( >=sys-block/open-iscsi-1.18.0 ) - iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) - libssh? ( >=net-libs/libssh-0.8.1:= ) - libssh2? ( >=net-libs/libssh2-1.3 ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) - lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) - nbd? ( sys-block/nbdkit ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2[lvm] - ) - pcap? ( >=net-libs/libpcap-1.8.0 ) - policykit? ( - acct-group/libvirt - >=sys-auth/polkit-0.9 - ) - qemu? ( - >=app-emulation/qemu-4.2 - app-crypt/swtpm - >=dev-libs/yajl-2.0.3:= - ) - rbd? ( sys-cluster/ceph ) - sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - virt-network? ( - net-dns/dnsmasq[dhcp,ipv6(+),script] - net-firewall/ebtables - >=net-firewall/iptables-1.4.10[ipv6(+)] - net-misc/radvd - sys-apps/iproute2[-minimal] - ) - virtiofsd? ( app-emulation/virtiofsd ) - wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) - xen? ( - >=app-emulation/xen-4.9.0 - app-emulation/xen-tools:= - ) - udev? ( - virtual/libudev:= - >=x11-libs/libpciaccess-0.10.9 - ) - zfs? ( sys-fs/zfs ) - kernel_linux? ( sys-apps/util-linux )" -DEPEND=" - ${BDEPEND} - ${RDEPEND} - ${PYTHON_DEPS} -" -# The 'circular' dependency on dev-python/libvirt-python is because of -# virt-qemu-qmp-proxy. -PDEPEND=" - qemu? ( dev-python/libvirt-python ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch - "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch - "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch - "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch -) - -pkg_setup() { - # Check kernel configuration: - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" - ~FUSE_FS" - - use lvm && CONFIG_CHECK+=" - ~BLK_DEV_DM - ~DM_MULTIPATH - ~DM_SNAPSHOT" - - use lxc && CONFIG_CHECK+=" - ~BLK_CGROUP - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - ~CGROUP_NET_PRIO - ~CGROUP_PERF - ~CGROUPS - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - ~NAMESPACES - ~NET_CLS_CGROUP - ~NET_NS - ~PID_NS - ~POSIX_MQUEUE - ~SECURITYFS - ~USER_NS - ~UTS_NS - ~VETH - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS" - - kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" - ~DEVPTS_MULTIPLE_INSTANCES" - - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_MARK_T - ~BRIDGE_NF_EBTABLES - ~NETFILTER_ADVANCED - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK - ~NETFILTER_XT_TARGET_CHECKSUM - ~IP_NF_FILTER - ~IP_NF_MANGLE - ~IP_NF_NAT - ~IP6_NF_FILTER - ~IP6_NF_MANGLE - ~IP6_NF_NAT" - - # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 - if use virt-network ; then - if kernel_is -lt 5 2 ; then - CONFIG_CHECK+=" - ~IP_NF_TARGET_MASQUERADE" - else - CONFIG_CHECK+=" - ~NETFILTER_XT_TARGET_MASQUERADE" - fi - fi - - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_T_NAT - ~IP_NF_TARGET_REJECT - ~NET_ACT_POLICE - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_SCH_HTB - ~NET_SCH_INGRESS - ~NET_SCH_SFQ" - - ERROR_USER_NS="Optional depending on LXC configuration." - - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi - - python-any-r1_pkg_setup -} - -src_prepare() { - touch "${S}/.mailmap" || die - - default - python_fix_shebang . - - # Skip fragile tests which relies on pristine environment - # (Breaks because of sandbox environment variables) - # bug #802876 - sed -i -e "/commandtest/d" tests/meson.build || die - - # Tweak the init script: - cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ - -i "${S}/libvirtd.init" || die "sed failed" -} - -src_configure() { - local emesonargs=( - $(meson_feature apparmor) - $(meson_feature apparmor apparmor_profiles) - $(meson_feature audit) - $(meson_feature caps capng) - $(meson_feature dtrace) - $(meson_feature firewalld) - $(meson_feature fuse) - $(meson_feature glusterfs) - $(meson_feature glusterfs storage_gluster) - $(meson_feature iscsi storage_iscsi) - $(meson_feature iscsi-direct storage_iscsi_direct) - $(meson_feature libvirtd driver_libvirtd) - $(meson_feature libssh) - $(meson_feature libssh2) - $(meson_feature lvm storage_lvm) - $(meson_feature lvm storage_mpath) - $(meson_feature lxc driver_lxc) - $(meson_feature nbd nbdkit) - $(meson_feature nls) - $(meson_feature numa numactl) - $(meson_feature numa numad) - $(meson_feature openvz driver_openvz) - $(meson_feature parted storage_disk) - $(meson_feature pcap libpcap) - $(meson_feature policykit polkit) - $(meson_feature qemu driver_qemu) - $(meson_feature qemu yajl) - $(meson_feature rbd storage_rbd) - $(meson_feature sasl) - $(meson_feature selinux) - $(meson_feature test tests) - $(meson_feature udev) - $(meson_feature virt-network driver_network) - $(meson_feature virtualbox driver_vbox) - $(meson_feature wireshark-plugins wireshark_dissector) - $(meson_feature xen driver_libxl) - $(meson_feature zfs storage_zfs) - - -Dnetcf=disabled - -Dsanlock=disabled - -Dopenwsman=disabled - - -Ddriver_esx=enabled - -Dinit_script=systemd - -Dqemu_user=$(usex caps qemu root) - -Dqemu_group=$(usex caps qemu root) - -Ddriver_remote=enabled - -Dstorage_fs=enabled - -Ddriver_vmware=enabled - - --localstatedir="${EPREFIX}/var" - -Dinitconfdir="${EPREFIX}/etc/systemd" - -Drunstatedir="${EPREFIX}/run" - -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" - ) - - meson_src_configure -} - -src_test() { - export VIR_TEST_DEBUG=1 - # Don't run the syntax check tests, they're fragile and not relevant - # to us downstream anyway. - # We also crank up the timeout (as Fedora does) just to preempt failures - # on slower arches. - meson_src_test --no-suite syntax-check --timeout-multiplier 10 -} - -src_install() { - meson_src_install - - # Depending on configuration option, libvirt will create some bogus - # directoreis. They are either not used, or libvirtd is able to create - # them on demand, so let's remove them. - # - # Note, we are using -f here so that rm does not fail or warn if the - # directory is nonexistent. - rm -rf "${D}"/etc/sysconfig - rm -rf "${D}"/var - rm -rf "${D}"/run - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf - - newinitd "${S}/libvirtd.init" libvirtd - newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests - newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd - newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd - - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests - - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - tmpfiles_process libvirtd.conf - readme.gentoo_print_elog -} diff --git a/app-emulation/libvirt/libvirt-10.0.0-r2.ebuild b/app-emulation/libvirt/libvirt-10.0.0-r2.ebuild new file mode 100644 index 000000000000..baf260598704 --- /dev/null +++ b/app-emulation/libvirt/libvirt-10.0.0-r2.ebuild @@ -0,0 +1,367 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Packages which get releases together: +# app-emacs/nxml-libvirt-schemas +# dev-python/libvirt-python +# dev-perl/Sys-Virt +# app-emulation/libvirt +# Please bump them together! + +PYTHON_COMPAT=( python3_{9..12} ) +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc +inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig + +if [[ ${PV} = *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" + EGIT_BRANCH="master" +else + SRC_URI="https://libvirt.org/sources/${P}.tar.xz + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +fi + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" +LICENSE="LGPL-2.1" +SLOT="0/${PV}" +IUSE=" + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs + iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nbd nfs nls numa + openvz parted pcap policykit +qemu rbd sasl selinux test +udev + virtiofsd virtualbox +virt-network wireshark-plugins xen zfs +" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + firewalld? ( virt-network ) + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) + lxc? ( caps libvirtd ) + openvz? ( libvirtd ) + qemu? ( libvirtd ) + virt-network? ( libvirtd ) + virtualbox? ( libvirtd ) + xen? ( libvirtd )" + +BDEPEND=" + app-text/xhtml1 + dev-lang/perl + dev-libs/libxslt + dev-perl/XML-XPath + dev-python/docutils + virtual/pkgconfig + bash-completion? ( >=app-shells/bash-completion-2.0 ) + verify-sig? ( sec-keys/openpgp-keys-libvirt )" + +# gettext.sh command is used by the libvirt command wrappers, and it's +# non-optional, so put it into RDEPEND. +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the +# package will use 3 by default. Since we don't have slot pinning in an API, +# we must go with the most recent. +RDEPEND=" + acct-user/qemu + app-misc/scrub + >=dev-libs/glib-2.56.0 + dev-libs/libgcrypt + dev-libs/libnl:3 + >=dev-libs/libxml2-2.9.1 + >=net-analyzer/openbsd-netcat-1.105-r1 + >=net-libs/gnutls-3.2.0:= + net-libs/libtirpc:= + >=net-misc/curl-7.18.0 + sys-apps/dbus + sys-apps/dmidecode + sys-devel/gettext + >=sys-libs/readline-7.0:= + virtual/acl + apparmor? ( sys-libs/libapparmor ) + audit? ( sys-process/audit ) + caps? ( sys-libs/libcap-ng ) + dtrace? ( dev-debug/systemtap ) + firewalld? ( >=net-firewall/firewalld-0.6.3 ) + fuse? ( sys-fs/fuse:= ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( >=sys-block/open-iscsi-1.18.0 ) + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) + libssh? ( >=net-libs/libssh-0.8.1:= ) + libssh2? ( >=net-libs/libssh2-1.3 ) + lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) + nbd? ( sys-block/nbdkit ) + nfs? ( net-fs/nfs-utils ) + numa? ( + >sys-process/numactl-2.0.2 + sys-process/numad + ) + parted? ( + >=sys-block/parted-1.8[device-mapper] + sys-fs/lvm2[lvm] + ) + pcap? ( >=net-libs/libpcap-1.8.0 ) + policykit? ( + acct-group/libvirt + >=sys-auth/polkit-0.9 + ) + qemu? ( + >=app-emulation/qemu-4.2 + app-crypt/swtpm + >=dev-libs/yajl-2.0.3:= + ) + rbd? ( sys-cluster/ceph ) + sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + virt-network? ( + net-dns/dnsmasq[dhcp,ipv6(+),script] + net-firewall/ebtables + >=net-firewall/iptables-1.4.10[ipv6(+)] + net-misc/radvd + sys-apps/iproute2[-minimal] + ) + virtiofsd? ( app-emulation/virtiofsd ) + wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) + xen? ( + >=app-emulation/xen-4.9.0 + app-emulation/xen-tools:= + ) + udev? ( + virtual/libudev:= + >=x11-libs/libpciaccess-0.10.9 + ) + zfs? ( sys-fs/zfs ) + kernel_linux? ( sys-apps/util-linux )" +DEPEND=" + ${BDEPEND} + ${RDEPEND} + ${PYTHON_DEPS} +" +# The 'circular' dependency on dev-python/libvirt-python is because of +# virt-qemu-qmp-proxy. +PDEPEND=" + qemu? ( dev-python/libvirt-python ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch + "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch + "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch + "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch + "${FILESDIR}"/${PN}-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch +) + +pkg_setup() { + # Check kernel configuration: + CONFIG_CHECK="" + use fuse && CONFIG_CHECK+=" + ~FUSE_FS" + + use lvm && CONFIG_CHECK+=" + ~BLK_DEV_DM + ~DM_MULTIPATH + ~DM_SNAPSHOT" + + use lxc && CONFIG_CHECK+=" + ~BLK_CGROUP + ~CGROUP_CPUACCT + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~CGROUP_NET_PRIO + ~CGROUP_PERF + ~CGROUPS + ~CGROUP_SCHED + ~CPUSETS + ~IPC_NS + ~MACVLAN + ~NAMESPACES + ~NET_CLS_CGROUP + ~NET_NS + ~PID_NS + ~POSIX_MQUEUE + ~SECURITYFS + ~USER_NS + ~UTS_NS + ~VETH + ~!GRKERNSEC_CHROOT_MOUNT + ~!GRKERNSEC_CHROOT_DOUBLE + ~!GRKERNSEC_CHROOT_PIVOT + ~!GRKERNSEC_CHROOT_CHMOD + ~!GRKERNSEC_CHROOT_CAPS" + + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" + ~DEVPTS_MULTIPLE_INSTANCES" + + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_MARK_T + ~BRIDGE_NF_EBTABLES + ~NETFILTER_ADVANCED + ~NETFILTER_XT_CONNMARK + ~NETFILTER_XT_MARK + ~NETFILTER_XT_TARGET_CHECKSUM + ~IP_NF_FILTER + ~IP_NF_MANGLE + ~IP_NF_NAT + ~IP6_NF_FILTER + ~IP6_NF_MANGLE + ~IP6_NF_NAT" + + # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 + if use virt-network ; then + if kernel_is -lt 5 2 ; then + CONFIG_CHECK+=" + ~IP_NF_TARGET_MASQUERADE" + else + CONFIG_CHECK+=" + ~NETFILTER_XT_TARGET_MASQUERADE" + fi + fi + + # Bandwidth Limiting Support + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_T_NAT + ~IP_NF_TARGET_REJECT + ~NET_ACT_POLICE + ~NET_CLS_FW + ~NET_CLS_U32 + ~NET_SCH_HTB + ~NET_SCH_INGRESS + ~NET_SCH_SFQ" + + ERROR_USER_NS="Optional depending on LXC configuration." + + if [[ -n ${CONFIG_CHECK} ]]; then + linux-info_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + touch "${S}/.mailmap" || die + + default + python_fix_shebang . + + # Skip fragile tests which relies on pristine environment + # (Breaks because of sandbox environment variables) + # bug #802876 + sed -i -e "/commandtest/d" tests/meson.build || die + + # Tweak the init script: + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ + -i "${S}/libvirtd.init" || die "sed failed" +} + +src_configure() { + local emesonargs=( + $(meson_feature apparmor) + $(meson_feature apparmor apparmor_profiles) + $(meson_feature audit) + $(meson_feature caps capng) + $(meson_feature dtrace) + $(meson_feature firewalld) + $(meson_feature fuse) + $(meson_feature glusterfs) + $(meson_feature glusterfs storage_gluster) + $(meson_feature iscsi storage_iscsi) + $(meson_feature iscsi-direct storage_iscsi_direct) + $(meson_feature libvirtd driver_libvirtd) + $(meson_feature libssh) + $(meson_feature libssh2) + $(meson_feature lvm storage_lvm) + $(meson_feature lvm storage_mpath) + $(meson_feature lxc driver_lxc) + $(meson_feature nbd nbdkit) + $(meson_feature nls) + $(meson_feature numa numactl) + $(meson_feature numa numad) + $(meson_feature openvz driver_openvz) + $(meson_feature parted storage_disk) + $(meson_feature pcap libpcap) + $(meson_feature policykit polkit) + $(meson_feature qemu driver_qemu) + $(meson_feature qemu yajl) + $(meson_feature rbd storage_rbd) + $(meson_feature sasl) + $(meson_feature selinux) + $(meson_feature test tests) + $(meson_feature udev) + $(meson_feature virt-network driver_network) + $(meson_feature virtualbox driver_vbox) + $(meson_feature wireshark-plugins wireshark_dissector) + $(meson_feature xen driver_libxl) + $(meson_feature zfs storage_zfs) + + -Dnetcf=disabled + -Dsanlock=disabled + -Dopenwsman=disabled + + -Ddriver_esx=enabled + -Dinit_script=systemd + -Dqemu_user=$(usex caps qemu root) + -Dqemu_group=$(usex caps qemu root) + -Ddriver_remote=enabled + -Dstorage_fs=enabled + -Ddriver_vmware=enabled + + --localstatedir="${EPREFIX}/var" + -Dinitconfdir="${EPREFIX}/etc/systemd" + -Drunstatedir="${EPREFIX}/run" + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + meson_src_configure +} + +src_test() { + export VIR_TEST_DEBUG=1 + # Don't run the syntax check tests, they're fragile and not relevant + # to us downstream anyway. + # We also crank up the timeout (as Fedora does) just to preempt failures + # on slower arches. + meson_src_test --no-suite syntax-check --timeout-multiplier 10 +} + +src_install() { + meson_src_install + + # Depending on configuration option, libvirt will create some bogus + # directoreis. They are either not used, or libvirtd is able to create + # them on demand, so let's remove them. + # + # Note, we are using -f here so that rm does not fail or warn if the + # directory is nonexistent. + rm -rf "${D}"/etc/sysconfig + rm -rf "${D}"/var + rm -rf "${D}"/run + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf + + newinitd "${S}/libvirtd.init" libvirtd + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd + + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests + + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +pkg_postinst() { + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die + fi + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + tmpfiles_process libvirtd.conf + readme.gentoo_print_elog +} diff --git a/app-emulation/libvirt/libvirt-10.1.0-r1.ebuild b/app-emulation/libvirt/libvirt-10.1.0-r1.ebuild new file mode 100644 index 000000000000..128f76475972 --- /dev/null +++ b/app-emulation/libvirt/libvirt-10.1.0-r1.ebuild @@ -0,0 +1,366 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Packages which get releases together: +# app-emacs/nxml-libvirt-schemas +# dev-python/libvirt-python +# dev-perl/Sys-Virt +# app-emulation/libvirt +# Please bump them together! + +PYTHON_COMPAT=( python3_{10..12} ) +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc +inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig + +if [[ ${PV} = *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" + EGIT_BRANCH="master" +else + SRC_URI="https://libvirt.org/sources/${P}.tar.xz + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +fi + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" +LICENSE="LGPL-2.1" +SLOT="0/${PV}" +IUSE=" + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs + iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nbd nfs nls numa + openvz parted pcap policykit +qemu rbd sasl selinux test +udev + virtiofsd virtualbox +virt-network wireshark-plugins xen zfs +" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + firewalld? ( virt-network ) + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) + lxc? ( caps libvirtd ) + openvz? ( libvirtd ) + qemu? ( libvirtd ) + virt-network? ( libvirtd ) + virtualbox? ( libvirtd ) + xen? ( libvirtd )" + +BDEPEND=" + app-text/xhtml1 + dev-lang/perl + dev-libs/libxslt + dev-perl/XML-XPath + dev-python/docutils + virtual/pkgconfig + bash-completion? ( >=app-shells/bash-completion-2.0 ) + verify-sig? ( sec-keys/openpgp-keys-libvirt )" + +# gettext.sh command is used by the libvirt command wrappers, and it's +# non-optional, so put it into RDEPEND. +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the +# package will use 3 by default. Since we don't have slot pinning in an API, +# we must go with the most recent. +RDEPEND=" + acct-user/qemu + app-misc/scrub + >=dev-libs/glib-2.56.0 + dev-libs/libgcrypt + dev-libs/libnl:3 + >=dev-libs/libxml2-2.9.1 + >=net-analyzer/openbsd-netcat-1.105-r1 + >=net-libs/gnutls-3.2.0:= + net-libs/libtirpc:= + >=net-misc/curl-7.18.0 + sys-apps/dbus + sys-apps/dmidecode + sys-devel/gettext + >=sys-libs/readline-7.0:= + virtual/acl + apparmor? ( sys-libs/libapparmor ) + audit? ( sys-process/audit ) + caps? ( sys-libs/libcap-ng ) + dtrace? ( dev-debug/systemtap ) + firewalld? ( >=net-firewall/firewalld-0.6.3 ) + fuse? ( sys-fs/fuse:= ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( >=sys-block/open-iscsi-1.18.0 ) + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) + libssh? ( >=net-libs/libssh-0.8.1:= ) + libssh2? ( >=net-libs/libssh2-1.3 ) + lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) + nbd? ( sys-block/nbdkit ) + nfs? ( net-fs/nfs-utils ) + numa? ( + >sys-process/numactl-2.0.2 + sys-process/numad + ) + parted? ( + >=sys-block/parted-1.8[device-mapper] + sys-fs/lvm2[lvm] + ) + pcap? ( >=net-libs/libpcap-1.8.0 ) + policykit? ( + acct-group/libvirt + >=sys-auth/polkit-0.9 + ) + qemu? ( + >=app-emulation/qemu-4.2 + app-crypt/swtpm + >=dev-libs/yajl-2.0.3:= + ) + rbd? ( sys-cluster/ceph ) + sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + virt-network? ( + net-dns/dnsmasq[dhcp,ipv6(+),script] + net-firewall/ebtables + >=net-firewall/iptables-1.4.10[ipv6(+)] + net-misc/radvd + sys-apps/iproute2[-minimal] + ) + virtiofsd? ( app-emulation/virtiofsd ) + wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) + xen? ( + >=app-emulation/xen-4.9.0 + app-emulation/xen-tools:= + ) + udev? ( + virtual/libudev:= + >=x11-libs/libpciaccess-0.10.9 + ) + zfs? ( sys-fs/zfs ) + kernel_linux? ( sys-apps/util-linux )" +DEPEND=" + ${BDEPEND} + ${RDEPEND} + ${PYTHON_DEPS} +" +# The 'circular' dependency on dev-python/libvirt-python is because of +# virt-qemu-qmp-proxy. +PDEPEND=" + qemu? ( dev-python/libvirt-python ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch + "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch + "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch + "${FILESDIR}"/${PN}-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch +) + +pkg_setup() { + # Check kernel configuration: + CONFIG_CHECK="" + use fuse && CONFIG_CHECK+=" + ~FUSE_FS" + + use lvm && CONFIG_CHECK+=" + ~BLK_DEV_DM + ~DM_MULTIPATH + ~DM_SNAPSHOT" + + use lxc && CONFIG_CHECK+=" + ~BLK_CGROUP + ~CGROUP_CPUACCT + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~CGROUP_NET_PRIO + ~CGROUP_PERF + ~CGROUPS + ~CGROUP_SCHED + ~CPUSETS + ~IPC_NS + ~MACVLAN + ~NAMESPACES + ~NET_CLS_CGROUP + ~NET_NS + ~PID_NS + ~POSIX_MQUEUE + ~SECURITYFS + ~USER_NS + ~UTS_NS + ~VETH + ~!GRKERNSEC_CHROOT_MOUNT + ~!GRKERNSEC_CHROOT_DOUBLE + ~!GRKERNSEC_CHROOT_PIVOT + ~!GRKERNSEC_CHROOT_CHMOD + ~!GRKERNSEC_CHROOT_CAPS" + + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" + ~DEVPTS_MULTIPLE_INSTANCES" + + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_MARK_T + ~BRIDGE_NF_EBTABLES + ~NETFILTER_ADVANCED + ~NETFILTER_XT_CONNMARK + ~NETFILTER_XT_MARK + ~NETFILTER_XT_TARGET_CHECKSUM + ~IP_NF_FILTER + ~IP_NF_MANGLE + ~IP_NF_NAT + ~IP6_NF_FILTER + ~IP6_NF_MANGLE + ~IP6_NF_NAT" + + # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 + if use virt-network ; then + if kernel_is -lt 5 2 ; then + CONFIG_CHECK+=" + ~IP_NF_TARGET_MASQUERADE" + else + CONFIG_CHECK+=" + ~NETFILTER_XT_TARGET_MASQUERADE" + fi + fi + + # Bandwidth Limiting Support + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_T_NAT + ~IP_NF_TARGET_REJECT + ~NET_ACT_POLICE + ~NET_CLS_FW + ~NET_CLS_U32 + ~NET_SCH_HTB + ~NET_SCH_INGRESS + ~NET_SCH_SFQ" + + ERROR_USER_NS="Optional depending on LXC configuration." + + if [[ -n ${CONFIG_CHECK} ]]; then + linux-info_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + touch "${S}/.mailmap" || die + + default + python_fix_shebang . + + # Skip fragile tests which relies on pristine environment + # (Breaks because of sandbox environment variables) + # bug #802876 + sed -i -e "/commandtest/d" tests/meson.build || die + + # Tweak the init script: + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ + -i "${S}/libvirtd.init" || die "sed failed" +} + +src_configure() { + local emesonargs=( + $(meson_feature apparmor) + $(meson_feature apparmor apparmor_profiles) + $(meson_feature audit) + $(meson_feature caps capng) + $(meson_feature dtrace) + $(meson_feature firewalld) + $(meson_feature fuse) + $(meson_feature glusterfs) + $(meson_feature glusterfs storage_gluster) + $(meson_feature iscsi storage_iscsi) + $(meson_feature iscsi-direct storage_iscsi_direct) + $(meson_feature libvirtd driver_libvirtd) + $(meson_feature libssh) + $(meson_feature libssh2) + $(meson_feature lvm storage_lvm) + $(meson_feature lvm storage_mpath) + $(meson_feature lxc driver_lxc) + $(meson_feature nbd nbdkit) + $(meson_feature nls) + $(meson_feature numa numactl) + $(meson_feature numa numad) + $(meson_feature openvz driver_openvz) + $(meson_feature parted storage_disk) + $(meson_feature pcap libpcap) + $(meson_feature policykit polkit) + $(meson_feature qemu driver_qemu) + $(meson_feature qemu yajl) + $(meson_feature rbd storage_rbd) + $(meson_feature sasl) + $(meson_feature selinux) + $(meson_feature test tests) + $(meson_feature udev) + $(meson_feature virt-network driver_network) + $(meson_feature virtualbox driver_vbox) + $(meson_feature wireshark-plugins wireshark_dissector) + $(meson_feature xen driver_libxl) + $(meson_feature zfs storage_zfs) + + -Dnetcf=disabled + -Dsanlock=disabled + -Dopenwsman=disabled + + -Ddriver_esx=enabled + -Dinit_script=systemd + -Dqemu_user=$(usex caps qemu root) + -Dqemu_group=$(usex caps qemu root) + -Ddriver_remote=enabled + -Dstorage_fs=enabled + -Ddriver_vmware=enabled + + --localstatedir="${EPREFIX}/var" + -Dinitconfdir="${EPREFIX}/etc/systemd" + -Drunstatedir="${EPREFIX}/run" + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + meson_src_configure +} + +src_test() { + export VIR_TEST_DEBUG=1 + # Don't run the syntax check tests, they're fragile and not relevant + # to us downstream anyway. + # We also crank up the timeout (as Fedora does) just to preempt failures + # on slower arches. + meson_src_test --no-suite syntax-check --timeout-multiplier 10 +} + +src_install() { + meson_src_install + + # Depending on configuration option, libvirt will create some bogus + # directoreis. They are either not used, or libvirtd is able to create + # them on demand, so let's remove them. + # + # Note, we are using -f here so that rm does not fail or warn if the + # directory is nonexistent. + rm -rf "${D}"/etc/sysconfig + rm -rf "${D}"/var + rm -rf "${D}"/run + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf + + newinitd "${S}/libvirtd.init" libvirtd + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd + + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests + + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +pkg_postinst() { + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die + fi + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + tmpfiles_process libvirtd.conf + readme.gentoo_print_elog +} diff --git a/app-emulation/libvirt/libvirt-10.1.0.ebuild b/app-emulation/libvirt/libvirt-10.1.0.ebuild deleted file mode 100644 index f1c08714d713..000000000000 --- a/app-emulation/libvirt/libvirt-10.1.0.ebuild +++ /dev/null @@ -1,365 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Packages which get releases together: -# app-emacs/nxml-libvirt-schemas -# dev-python/libvirt-python -# dev-perl/Sys-Virt -# app-emulation/libvirt -# Please bump them together! - -PYTHON_COMPAT=( python3_{10..12} ) -VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc -inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" - EGIT_BRANCH="master" -else - SRC_URI="https://libvirt.org/sources/${P}.tar.xz - verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" - KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" -fi - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" -LICENSE="LGPL-2.1" -SLOT="0/${PV}" -IUSE=" - apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs - iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nbd nfs nls numa - openvz parted pcap policykit +qemu rbd sasl selinux test +udev - virtiofsd virtualbox +virt-network wireshark-plugins xen zfs -" -RESTRICT="!test? ( test )" - -REQUIRED_USE=" - firewalld? ( virt-network ) - libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - qemu? ( libvirtd ) - virt-network? ( libvirtd ) - virtualbox? ( libvirtd ) - xen? ( libvirtd )" - -BDEPEND=" - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt - dev-perl/XML-XPath - dev-python/docutils - virtual/pkgconfig - bash-completion? ( >=app-shells/bash-completion-2.0 ) - verify-sig? ( sec-keys/openpgp-keys-libvirt )" - -# gettext.sh command is used by the libvirt command wrappers, and it's -# non-optional, so put it into RDEPEND. -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the -# package will use 3 by default. Since we don't have slot pinning in an API, -# we must go with the most recent. -RDEPEND=" - acct-user/qemu - app-misc/scrub - >=dev-libs/glib-2.56.0 - dev-libs/libgcrypt - dev-libs/libnl:3 - >=dev-libs/libxml2-2.9.1 - >=net-analyzer/openbsd-netcat-1.105-r1 - >=net-libs/gnutls-3.2.0:= - net-libs/libtirpc:= - >=net-misc/curl-7.18.0 - sys-apps/dbus - sys-apps/dmidecode - sys-devel/gettext - >=sys-libs/readline-7.0:= - virtual/acl - apparmor? ( sys-libs/libapparmor ) - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap-ng ) - dtrace? ( dev-debug/systemtap ) - firewalld? ( >=net-firewall/firewalld-0.6.3 ) - fuse? ( sys-fs/fuse:= ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( >=sys-block/open-iscsi-1.18.0 ) - iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) - libssh? ( >=net-libs/libssh-0.8.1:= ) - libssh2? ( >=net-libs/libssh2-1.3 ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) - lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) - nbd? ( sys-block/nbdkit ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2[lvm] - ) - pcap? ( >=net-libs/libpcap-1.8.0 ) - policykit? ( - acct-group/libvirt - >=sys-auth/polkit-0.9 - ) - qemu? ( - >=app-emulation/qemu-4.2 - app-crypt/swtpm - >=dev-libs/yajl-2.0.3:= - ) - rbd? ( sys-cluster/ceph ) - sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - virt-network? ( - net-dns/dnsmasq[dhcp,ipv6(+),script] - net-firewall/ebtables - >=net-firewall/iptables-1.4.10[ipv6(+)] - net-misc/radvd - sys-apps/iproute2[-minimal] - ) - virtiofsd? ( app-emulation/virtiofsd ) - wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) - xen? ( - >=app-emulation/xen-4.9.0 - app-emulation/xen-tools:= - ) - udev? ( - virtual/libudev:= - >=x11-libs/libpciaccess-0.10.9 - ) - zfs? ( sys-fs/zfs ) - kernel_linux? ( sys-apps/util-linux )" -DEPEND=" - ${BDEPEND} - ${RDEPEND} - ${PYTHON_DEPS} -" -# The 'circular' dependency on dev-python/libvirt-python is because of -# virt-qemu-qmp-proxy. -PDEPEND=" - qemu? ( dev-python/libvirt-python ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch - "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch - "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch -) - -pkg_setup() { - # Check kernel configuration: - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" - ~FUSE_FS" - - use lvm && CONFIG_CHECK+=" - ~BLK_DEV_DM - ~DM_MULTIPATH - ~DM_SNAPSHOT" - - use lxc && CONFIG_CHECK+=" - ~BLK_CGROUP - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - ~CGROUP_NET_PRIO - ~CGROUP_PERF - ~CGROUPS - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - ~NAMESPACES - ~NET_CLS_CGROUP - ~NET_NS - ~PID_NS - ~POSIX_MQUEUE - ~SECURITYFS - ~USER_NS - ~UTS_NS - ~VETH - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS" - - kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" - ~DEVPTS_MULTIPLE_INSTANCES" - - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_MARK_T - ~BRIDGE_NF_EBTABLES - ~NETFILTER_ADVANCED - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK - ~NETFILTER_XT_TARGET_CHECKSUM - ~IP_NF_FILTER - ~IP_NF_MANGLE - ~IP_NF_NAT - ~IP6_NF_FILTER - ~IP6_NF_MANGLE - ~IP6_NF_NAT" - - # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 - if use virt-network ; then - if kernel_is -lt 5 2 ; then - CONFIG_CHECK+=" - ~IP_NF_TARGET_MASQUERADE" - else - CONFIG_CHECK+=" - ~NETFILTER_XT_TARGET_MASQUERADE" - fi - fi - - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_T_NAT - ~IP_NF_TARGET_REJECT - ~NET_ACT_POLICE - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_SCH_HTB - ~NET_SCH_INGRESS - ~NET_SCH_SFQ" - - ERROR_USER_NS="Optional depending on LXC configuration." - - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi - - python-any-r1_pkg_setup -} - -src_prepare() { - touch "${S}/.mailmap" || die - - default - python_fix_shebang . - - # Skip fragile tests which relies on pristine environment - # (Breaks because of sandbox environment variables) - # bug #802876 - sed -i -e "/commandtest/d" tests/meson.build || die - - # Tweak the init script: - cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ - -i "${S}/libvirtd.init" || die "sed failed" -} - -src_configure() { - local emesonargs=( - $(meson_feature apparmor) - $(meson_feature apparmor apparmor_profiles) - $(meson_feature audit) - $(meson_feature caps capng) - $(meson_feature dtrace) - $(meson_feature firewalld) - $(meson_feature fuse) - $(meson_feature glusterfs) - $(meson_feature glusterfs storage_gluster) - $(meson_feature iscsi storage_iscsi) - $(meson_feature iscsi-direct storage_iscsi_direct) - $(meson_feature libvirtd driver_libvirtd) - $(meson_feature libssh) - $(meson_feature libssh2) - $(meson_feature lvm storage_lvm) - $(meson_feature lvm storage_mpath) - $(meson_feature lxc driver_lxc) - $(meson_feature nbd nbdkit) - $(meson_feature nls) - $(meson_feature numa numactl) - $(meson_feature numa numad) - $(meson_feature openvz driver_openvz) - $(meson_feature parted storage_disk) - $(meson_feature pcap libpcap) - $(meson_feature policykit polkit) - $(meson_feature qemu driver_qemu) - $(meson_feature qemu yajl) - $(meson_feature rbd storage_rbd) - $(meson_feature sasl) - $(meson_feature selinux) - $(meson_feature test tests) - $(meson_feature udev) - $(meson_feature virt-network driver_network) - $(meson_feature virtualbox driver_vbox) - $(meson_feature wireshark-plugins wireshark_dissector) - $(meson_feature xen driver_libxl) - $(meson_feature zfs storage_zfs) - - -Dnetcf=disabled - -Dsanlock=disabled - -Dopenwsman=disabled - - -Ddriver_esx=enabled - -Dinit_script=systemd - -Dqemu_user=$(usex caps qemu root) - -Dqemu_group=$(usex caps qemu root) - -Ddriver_remote=enabled - -Dstorage_fs=enabled - -Ddriver_vmware=enabled - - --localstatedir="${EPREFIX}/var" - -Dinitconfdir="${EPREFIX}/etc/systemd" - -Drunstatedir="${EPREFIX}/run" - -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" - ) - - meson_src_configure -} - -src_test() { - export VIR_TEST_DEBUG=1 - # Don't run the syntax check tests, they're fragile and not relevant - # to us downstream anyway. - # We also crank up the timeout (as Fedora does) just to preempt failures - # on slower arches. - meson_src_test --no-suite syntax-check --timeout-multiplier 10 -} - -src_install() { - meson_src_install - - # Depending on configuration option, libvirt will create some bogus - # directoreis. They are either not used, or libvirtd is able to create - # them on demand, so let's remove them. - # - # Note, we are using -f here so that rm does not fail or warn if the - # directory is nonexistent. - rm -rf "${D}"/etc/sysconfig - rm -rf "${D}"/var - rm -rf "${D}"/run - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf - - newinitd "${S}/libvirtd.init" libvirtd - newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests - newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd - newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd - - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests - - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - tmpfiles_process libvirtd.conf - readme.gentoo_print_elog -} diff --git a/app-emulation/libvirt/libvirt-9.8.0-r1.ebuild b/app-emulation/libvirt/libvirt-9.8.0-r1.ebuild deleted file mode 100644 index 899d7683f299..000000000000 --- a/app-emulation/libvirt/libvirt-9.8.0-r1.ebuild +++ /dev/null @@ -1,365 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Packages which get releases together: -# app-emacs/nxml-libvirt-schemas -# dev-python/libvirt-python -# dev-perl/Sys-Virt -# app-emulation/libvirt -# Please bump them together! - -PYTHON_COMPAT=( python3_{10..12} ) -VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc -inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" - EGIT_BRANCH="master" -else - SRC_URI="https://libvirt.org/sources/${P}.tar.xz - verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" - KEYWORDS="amd64 ~arm arm64 ppc64 x86" -fi - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" -LICENSE="LGPL-2.1" -SLOT="0/${PV}" -IUSE=" - apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs - iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz - parted pcap policykit +qemu rbd sasl selinux test +udev - virtualbox +virt-network wireshark-plugins xen zfs -" -RESTRICT="!test? ( test )" - -REQUIRED_USE=" - firewalld? ( virt-network ) - libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - qemu? ( libvirtd ) - virt-network? ( libvirtd ) - virtualbox? ( libvirtd ) - xen? ( libvirtd )" - -BDEPEND=" - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt - dev-perl/XML-XPath - dev-python/docutils - virtual/pkgconfig - net-libs/rpcsvc-proto - bash-completion? ( >=app-shells/bash-completion-2.0 ) - verify-sig? ( sec-keys/openpgp-keys-libvirt )" - -# gettext.sh command is used by the libvirt command wrappers, and it's -# non-optional, so put it into RDEPEND. -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the -# package will use 3 by default. Since we don't have slot pinning in an API, -# we must go with the most recent. -RDEPEND=" - acct-user/qemu - app-misc/scrub - >=dev-libs/glib-2.56.0 - dev-libs/libgcrypt - dev-libs/libnl:3 - >=dev-libs/libxml2-2.9.1 - >=net-analyzer/openbsd-netcat-1.105-r1 - >=net-libs/gnutls-3.2.0:= - net-libs/libtirpc:= - >=net-misc/curl-7.18.0 - sys-apps/dbus - sys-apps/dmidecode - sys-devel/gettext - >=sys-libs/readline-7.0:= - virtual/acl - apparmor? ( sys-libs/libapparmor ) - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap-ng ) - dtrace? ( dev-debug/systemtap ) - firewalld? ( >=net-firewall/firewalld-0.6.3 ) - fuse? ( sys-fs/fuse:= ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( >=sys-block/open-iscsi-1.18.0 ) - iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) - libssh? ( >=net-libs/libssh-0.8.1:= ) - libssh2? ( >=net-libs/libssh2-1.3 ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) - lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2[lvm] - ) - pcap? ( >=net-libs/libpcap-1.8.0 ) - policykit? ( - acct-group/libvirt - >=sys-auth/polkit-0.9 - ) - qemu? ( - >=app-emulation/qemu-4.2 - app-crypt/swtpm - >=dev-libs/yajl-2.0.3:= - ) - rbd? ( sys-cluster/ceph ) - sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - virt-network? ( - net-dns/dnsmasq[dhcp,ipv6(+),script] - net-firewall/ebtables - >=net-firewall/iptables-1.4.10[ipv6(+)] - net-misc/radvd - sys-apps/iproute2[-minimal] - ) - wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) - xen? ( - >=app-emulation/xen-4.9.0 - app-emulation/xen-tools:= - ) - udev? ( - virtual/libudev:= - >=x11-libs/libpciaccess-0.10.9 - ) - zfs? ( sys-fs/zfs ) - kernel_linux? ( sys-apps/util-linux )" -DEPEND=" - ${BDEPEND} - ${RDEPEND} - ${PYTHON_DEPS} -" -# The 'circular' dependency on dev-python/libvirt-python is because of -# virt-qemu-qmp-proxy. -PDEPEND=" - qemu? ( dev-python/libvirt-python ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch - "${FILESDIR}"/${PN}-9.4.0-do-not-use-sysconfig.patch - "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch - "${FILESDIR}"/${PN}-9.10.0-virxml-include-libxml-xmlsave.h-for-xmlIndentTreeOut.patch - "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch -) - -pkg_setup() { - # Check kernel configuration: - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" - ~FUSE_FS" - - use lvm && CONFIG_CHECK+=" - ~BLK_DEV_DM - ~DM_MULTIPATH - ~DM_SNAPSHOT" - - use lxc && CONFIG_CHECK+=" - ~BLK_CGROUP - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - ~CGROUP_NET_PRIO - ~CGROUP_PERF - ~CGROUPS - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - ~NAMESPACES - ~NET_CLS_CGROUP - ~NET_NS - ~PID_NS - ~POSIX_MQUEUE - ~SECURITYFS - ~USER_NS - ~UTS_NS - ~VETH - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS" - - kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" - ~DEVPTS_MULTIPLE_INSTANCES" - - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_MARK_T - ~BRIDGE_NF_EBTABLES - ~NETFILTER_ADVANCED - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK - ~NETFILTER_XT_TARGET_CHECKSUM - ~IP_NF_FILTER - ~IP_NF_MANGLE - ~IP_NF_NAT - ~IP6_NF_FILTER - ~IP6_NF_MANGLE - ~IP6_NF_NAT" - - # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 - if use virt-network ; then - if kernel_is -lt 5 2 ; then - CONFIG_CHECK+=" - ~IP_NF_TARGET_MASQUERADE" - else - CONFIG_CHECK+=" - ~NETFILTER_XT_TARGET_MASQUERADE" - fi - fi - - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_T_NAT - ~IP_NF_TARGET_REJECT - ~NET_ACT_POLICE - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_SCH_HTB - ~NET_SCH_INGRESS - ~NET_SCH_SFQ" - - ERROR_USER_NS="Optional depending on LXC configuration." - - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi - - python-any-r1_pkg_setup -} - -src_prepare() { - touch "${S}/.mailmap" || die - - default - python_fix_shebang . - - # Skip fragile tests which relies on pristine environment - # (Breaks because of sandbox environment variables) - # bug #802876 - sed -i -e "/commandtest/d" tests/meson.build || die - - # Tweak the init script: - cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ - -i "${S}/libvirtd.init" || die "sed failed" -} - -src_configure() { - local emesonargs=( - $(meson_feature apparmor) - $(meson_feature apparmor apparmor_profiles) - $(meson_feature audit) - $(meson_feature caps capng) - $(meson_feature dtrace) - $(meson_feature firewalld) - $(meson_feature fuse) - $(meson_feature glusterfs) - $(meson_feature glusterfs storage_gluster) - $(meson_feature iscsi storage_iscsi) - $(meson_feature iscsi-direct storage_iscsi_direct) - $(meson_feature libvirtd driver_libvirtd) - $(meson_feature libssh) - $(meson_feature libssh2) - $(meson_feature lvm storage_lvm) - $(meson_feature lvm storage_mpath) - $(meson_feature lxc driver_lxc) - $(meson_feature nls) - $(meson_feature numa numactl) - $(meson_feature numa numad) - $(meson_feature openvz driver_openvz) - $(meson_feature parted storage_disk) - $(meson_feature pcap libpcap) - $(meson_feature policykit polkit) - $(meson_feature qemu driver_qemu) - $(meson_feature qemu yajl) - $(meson_feature rbd storage_rbd) - $(meson_feature sasl) - $(meson_feature selinux) - $(meson_feature test tests) - $(meson_feature udev) - $(meson_feature virt-network driver_network) - $(meson_feature virtualbox driver_vbox) - $(meson_feature wireshark-plugins wireshark_dissector) - $(meson_feature xen driver_libxl) - $(meson_feature zfs storage_zfs) - - -Dnetcf=disabled - -Dsanlock=disabled - -Dopenwsman=disabled - - -Ddriver_esx=enabled - -Dinit_script=systemd - -Dqemu_user=$(usex caps qemu root) - -Dqemu_group=$(usex caps qemu root) - -Ddriver_remote=enabled - -Dstorage_fs=enabled - -Ddriver_vmware=enabled - - --localstatedir="${EPREFIX}/var" - -Dinitconfdir="${EPREFIX}/etc/systemd" - -Drunstatedir="${EPREFIX}/run" - -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" - ) - - meson_src_configure -} - -src_test() { - export VIR_TEST_DEBUG=1 - # Don't run the syntax check tests, they're fragile and not relevant - # to us downstream anyway. - # We also crank up the timeout (as Fedora does) just to preempt failures - # on slower arches. - meson_src_test --no-suite syntax-check --timeout-multiplier 10 -} - -src_install() { - meson_src_install - - # Depending on configuration option, libvirt will create some bogus - # directoreis. They are either not used, or libvirtd is able to create - # them on demand, so let's remove them. - # - # Note, we are using -f here so that rm does not fail or warn if the - # directory is nonexistent. - rm -rf "${D}"/etc/sysconfig - rm -rf "${D}"/var - rm -rf "${D}"/run - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf - - newinitd "${S}/libvirtd.init" libvirtd - newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests - newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd - newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd - - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests - - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - tmpfiles_process libvirtd.conf - readme.gentoo_print_elog -} diff --git a/app-emulation/libvirt/libvirt-9.8.0-r2.ebuild b/app-emulation/libvirt/libvirt-9.8.0-r2.ebuild new file mode 100644 index 000000000000..500ab7f572ad --- /dev/null +++ b/app-emulation/libvirt/libvirt-9.8.0-r2.ebuild @@ -0,0 +1,366 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Packages which get releases together: +# app-emacs/nxml-libvirt-schemas +# dev-python/libvirt-python +# dev-perl/Sys-Virt +# app-emulation/libvirt +# Please bump them together! + +PYTHON_COMPAT=( python3_{10..12} ) +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc +inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig + +if [[ ${PV} = *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" + EGIT_BRANCH="master" +else + SRC_URI="https://libvirt.org/sources/${P}.tar.xz + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" + KEYWORDS="amd64 ~arm arm64 ppc64 x86" +fi + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" +LICENSE="LGPL-2.1" +SLOT="0/${PV}" +IUSE=" + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs + iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz + parted pcap policykit +qemu rbd sasl selinux test +udev + virtualbox +virt-network wireshark-plugins xen zfs +" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + firewalld? ( virt-network ) + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) + lxc? ( caps libvirtd ) + openvz? ( libvirtd ) + qemu? ( libvirtd ) + virt-network? ( libvirtd ) + virtualbox? ( libvirtd ) + xen? ( libvirtd )" + +BDEPEND=" + app-text/xhtml1 + dev-lang/perl + dev-libs/libxslt + dev-perl/XML-XPath + dev-python/docutils + virtual/pkgconfig + net-libs/rpcsvc-proto + bash-completion? ( >=app-shells/bash-completion-2.0 ) + verify-sig? ( sec-keys/openpgp-keys-libvirt )" + +# gettext.sh command is used by the libvirt command wrappers, and it's +# non-optional, so put it into RDEPEND. +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the +# package will use 3 by default. Since we don't have slot pinning in an API, +# we must go with the most recent. +RDEPEND=" + acct-user/qemu + app-misc/scrub + >=dev-libs/glib-2.56.0 + dev-libs/libgcrypt + dev-libs/libnl:3 + >=dev-libs/libxml2-2.9.1 + >=net-analyzer/openbsd-netcat-1.105-r1 + >=net-libs/gnutls-3.2.0:= + net-libs/libtirpc:= + >=net-misc/curl-7.18.0 + sys-apps/dbus + sys-apps/dmidecode + sys-devel/gettext + >=sys-libs/readline-7.0:= + virtual/acl + apparmor? ( sys-libs/libapparmor ) + audit? ( sys-process/audit ) + caps? ( sys-libs/libcap-ng ) + dtrace? ( dev-debug/systemtap ) + firewalld? ( >=net-firewall/firewalld-0.6.3 ) + fuse? ( sys-fs/fuse:= ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( >=sys-block/open-iscsi-1.18.0 ) + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) + libssh? ( >=net-libs/libssh-0.8.1:= ) + libssh2? ( >=net-libs/libssh2-1.3 ) + lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) + nfs? ( net-fs/nfs-utils ) + numa? ( + >sys-process/numactl-2.0.2 + sys-process/numad + ) + parted? ( + >=sys-block/parted-1.8[device-mapper] + sys-fs/lvm2[lvm] + ) + pcap? ( >=net-libs/libpcap-1.8.0 ) + policykit? ( + acct-group/libvirt + >=sys-auth/polkit-0.9 + ) + qemu? ( + >=app-emulation/qemu-4.2 + app-crypt/swtpm + >=dev-libs/yajl-2.0.3:= + ) + rbd? ( sys-cluster/ceph ) + sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + virt-network? ( + net-dns/dnsmasq[dhcp,ipv6(+),script] + net-firewall/ebtables + >=net-firewall/iptables-1.4.10[ipv6(+)] + net-misc/radvd + sys-apps/iproute2[-minimal] + ) + wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) + xen? ( + >=app-emulation/xen-4.9.0 + app-emulation/xen-tools:= + ) + udev? ( + virtual/libudev:= + >=x11-libs/libpciaccess-0.10.9 + ) + zfs? ( sys-fs/zfs ) + kernel_linux? ( sys-apps/util-linux )" +DEPEND=" + ${BDEPEND} + ${RDEPEND} + ${PYTHON_DEPS} +" +# The 'circular' dependency on dev-python/libvirt-python is because of +# virt-qemu-qmp-proxy. +PDEPEND=" + qemu? ( dev-python/libvirt-python ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch + "${FILESDIR}"/${PN}-9.4.0-do-not-use-sysconfig.patch + "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch + "${FILESDIR}"/${PN}-9.10.0-virxml-include-libxml-xmlsave.h-for-xmlIndentTreeOut.patch + "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch + "${FILESDIR}"/${PN}-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch +) + +pkg_setup() { + # Check kernel configuration: + CONFIG_CHECK="" + use fuse && CONFIG_CHECK+=" + ~FUSE_FS" + + use lvm && CONFIG_CHECK+=" + ~BLK_DEV_DM + ~DM_MULTIPATH + ~DM_SNAPSHOT" + + use lxc && CONFIG_CHECK+=" + ~BLK_CGROUP + ~CGROUP_CPUACCT + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~CGROUP_NET_PRIO + ~CGROUP_PERF + ~CGROUPS + ~CGROUP_SCHED + ~CPUSETS + ~IPC_NS + ~MACVLAN + ~NAMESPACES + ~NET_CLS_CGROUP + ~NET_NS + ~PID_NS + ~POSIX_MQUEUE + ~SECURITYFS + ~USER_NS + ~UTS_NS + ~VETH + ~!GRKERNSEC_CHROOT_MOUNT + ~!GRKERNSEC_CHROOT_DOUBLE + ~!GRKERNSEC_CHROOT_PIVOT + ~!GRKERNSEC_CHROOT_CHMOD + ~!GRKERNSEC_CHROOT_CAPS" + + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" + ~DEVPTS_MULTIPLE_INSTANCES" + + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_MARK_T + ~BRIDGE_NF_EBTABLES + ~NETFILTER_ADVANCED + ~NETFILTER_XT_CONNMARK + ~NETFILTER_XT_MARK + ~NETFILTER_XT_TARGET_CHECKSUM + ~IP_NF_FILTER + ~IP_NF_MANGLE + ~IP_NF_NAT + ~IP6_NF_FILTER + ~IP6_NF_MANGLE + ~IP6_NF_NAT" + + # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 + if use virt-network ; then + if kernel_is -lt 5 2 ; then + CONFIG_CHECK+=" + ~IP_NF_TARGET_MASQUERADE" + else + CONFIG_CHECK+=" + ~NETFILTER_XT_TARGET_MASQUERADE" + fi + fi + + # Bandwidth Limiting Support + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_T_NAT + ~IP_NF_TARGET_REJECT + ~NET_ACT_POLICE + ~NET_CLS_FW + ~NET_CLS_U32 + ~NET_SCH_HTB + ~NET_SCH_INGRESS + ~NET_SCH_SFQ" + + ERROR_USER_NS="Optional depending on LXC configuration." + + if [[ -n ${CONFIG_CHECK} ]]; then + linux-info_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + touch "${S}/.mailmap" || die + + default + python_fix_shebang . + + # Skip fragile tests which relies on pristine environment + # (Breaks because of sandbox environment variables) + # bug #802876 + sed -i -e "/commandtest/d" tests/meson.build || die + + # Tweak the init script: + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ + -i "${S}/libvirtd.init" || die "sed failed" +} + +src_configure() { + local emesonargs=( + $(meson_feature apparmor) + $(meson_feature apparmor apparmor_profiles) + $(meson_feature audit) + $(meson_feature caps capng) + $(meson_feature dtrace) + $(meson_feature firewalld) + $(meson_feature fuse) + $(meson_feature glusterfs) + $(meson_feature glusterfs storage_gluster) + $(meson_feature iscsi storage_iscsi) + $(meson_feature iscsi-direct storage_iscsi_direct) + $(meson_feature libvirtd driver_libvirtd) + $(meson_feature libssh) + $(meson_feature libssh2) + $(meson_feature lvm storage_lvm) + $(meson_feature lvm storage_mpath) + $(meson_feature lxc driver_lxc) + $(meson_feature nls) + $(meson_feature numa numactl) + $(meson_feature numa numad) + $(meson_feature openvz driver_openvz) + $(meson_feature parted storage_disk) + $(meson_feature pcap libpcap) + $(meson_feature policykit polkit) + $(meson_feature qemu driver_qemu) + $(meson_feature qemu yajl) + $(meson_feature rbd storage_rbd) + $(meson_feature sasl) + $(meson_feature selinux) + $(meson_feature test tests) + $(meson_feature udev) + $(meson_feature virt-network driver_network) + $(meson_feature virtualbox driver_vbox) + $(meson_feature wireshark-plugins wireshark_dissector) + $(meson_feature xen driver_libxl) + $(meson_feature zfs storage_zfs) + + -Dnetcf=disabled + -Dsanlock=disabled + -Dopenwsman=disabled + + -Ddriver_esx=enabled + -Dinit_script=systemd + -Dqemu_user=$(usex caps qemu root) + -Dqemu_group=$(usex caps qemu root) + -Ddriver_remote=enabled + -Dstorage_fs=enabled + -Ddriver_vmware=enabled + + --localstatedir="${EPREFIX}/var" + -Dinitconfdir="${EPREFIX}/etc/systemd" + -Drunstatedir="${EPREFIX}/run" + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + meson_src_configure +} + +src_test() { + export VIR_TEST_DEBUG=1 + # Don't run the syntax check tests, they're fragile and not relevant + # to us downstream anyway. + # We also crank up the timeout (as Fedora does) just to preempt failures + # on slower arches. + meson_src_test --no-suite syntax-check --timeout-multiplier 10 +} + +src_install() { + meson_src_install + + # Depending on configuration option, libvirt will create some bogus + # directoreis. They are either not used, or libvirtd is able to create + # them on demand, so let's remove them. + # + # Note, we are using -f here so that rm does not fail or warn if the + # directory is nonexistent. + rm -rf "${D}"/etc/sysconfig + rm -rf "${D}"/var + rm -rf "${D}"/run + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf + + newinitd "${S}/libvirtd.init" libvirtd + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd + + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests + + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +pkg_postinst() { + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die + fi + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + tmpfiles_process libvirtd.conf + readme.gentoo_print_elog +} diff --git a/app-emulation/libvirt/libvirt-9.9.0-r1.ebuild b/app-emulation/libvirt/libvirt-9.9.0-r1.ebuild deleted file mode 100644 index 8f39ada3c36b..000000000000 --- a/app-emulation/libvirt/libvirt-9.9.0-r1.ebuild +++ /dev/null @@ -1,366 +0,0 @@ -# Copyright 1999-2024 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -# Packages which get releases together: -# app-emacs/nxml-libvirt-schemas -# dev-python/libvirt-python -# dev-perl/Sys-Virt -# app-emulation/libvirt -# Please bump them together! - -PYTHON_COMPAT=( python3_{10..12} ) -VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc -inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig - -if [[ ${PV} = *9999* ]]; then - inherit git-r3 - EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" - EGIT_BRANCH="master" -else - SRC_URI="https://libvirt.org/sources/${P}.tar.xz - verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" - KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" -fi - -DESCRIPTION="C toolkit to manipulate virtual machines" -HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" -LICENSE="LGPL-2.1" -SLOT="0/${PV}" -IUSE=" - apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs - iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz - parted pcap policykit +qemu rbd sasl selinux test +udev virtiofsd - virtualbox +virt-network wireshark-plugins xen zfs -" -RESTRICT="!test? ( test )" - -REQUIRED_USE=" - firewalld? ( virt-network ) - libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) - lxc? ( caps libvirtd ) - openvz? ( libvirtd ) - qemu? ( libvirtd ) - virt-network? ( libvirtd ) - virtualbox? ( libvirtd ) - xen? ( libvirtd )" - -BDEPEND=" - app-text/xhtml1 - dev-lang/perl - dev-libs/libxslt - dev-perl/XML-XPath - dev-python/docutils - virtual/pkgconfig - net-libs/rpcsvc-proto - bash-completion? ( >=app-shells/bash-completion-2.0 ) - verify-sig? ( sec-keys/openpgp-keys-libvirt )" - -# gettext.sh command is used by the libvirt command wrappers, and it's -# non-optional, so put it into RDEPEND. -# We can use both libnl:1.1 and libnl:3, but if you have both installed, the -# package will use 3 by default. Since we don't have slot pinning in an API, -# we must go with the most recent. -RDEPEND=" - acct-user/qemu - app-misc/scrub - >=dev-libs/glib-2.56.0 - dev-libs/libgcrypt - dev-libs/libnl:3 - >=dev-libs/libxml2-2.9.1 - >=net-analyzer/openbsd-netcat-1.105-r1 - >=net-libs/gnutls-3.2.0:= - net-libs/libtirpc:= - >=net-misc/curl-7.18.0 - sys-apps/dbus - sys-apps/dmidecode - sys-devel/gettext - >=sys-libs/readline-7.0:= - virtual/acl - apparmor? ( sys-libs/libapparmor ) - audit? ( sys-process/audit ) - caps? ( sys-libs/libcap-ng ) - dtrace? ( dev-debug/systemtap ) - firewalld? ( >=net-firewall/firewalld-0.6.3 ) - fuse? ( sys-fs/fuse:= ) - glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) - iscsi? ( >=sys-block/open-iscsi-1.18.0 ) - iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) - libssh? ( >=net-libs/libssh-0.8.1:= ) - libssh2? ( >=net-libs/libssh2-1.3 ) - lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) - lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) - nfs? ( net-fs/nfs-utils ) - numa? ( - >sys-process/numactl-2.0.2 - sys-process/numad - ) - parted? ( - >=sys-block/parted-1.8[device-mapper] - sys-fs/lvm2[lvm] - ) - pcap? ( >=net-libs/libpcap-1.8.0 ) - policykit? ( - acct-group/libvirt - >=sys-auth/polkit-0.9 - ) - qemu? ( - >=app-emulation/qemu-4.2 - app-crypt/swtpm - >=dev-libs/yajl-2.0.3:= - ) - rbd? ( sys-cluster/ceph ) - sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) - selinux? ( >=sys-libs/libselinux-2.0.85 ) - virt-network? ( - net-dns/dnsmasq[dhcp,ipv6(+),script] - net-firewall/ebtables - >=net-firewall/iptables-1.4.10[ipv6(+)] - net-misc/radvd - sys-apps/iproute2[-minimal] - ) - virtiofsd? ( app-emulation/virtiofsd ) - wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) - xen? ( - >=app-emulation/xen-4.9.0 - app-emulation/xen-tools:= - ) - udev? ( - virtual/libudev:= - >=x11-libs/libpciaccess-0.10.9 - ) - zfs? ( sys-fs/zfs ) - kernel_linux? ( sys-apps/util-linux )" -DEPEND=" - ${BDEPEND} - ${RDEPEND} - ${PYTHON_DEPS} -" -# The 'circular' dependency on dev-python/libvirt-python is because of -# virt-qemu-qmp-proxy. -PDEPEND=" - qemu? ( dev-python/libvirt-python ) -" - -PATCHES=( - "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch - "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch - "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch - "${FILESDIR}"/${PN}-9.10.0-virxml-include-libxml-xmlsave.h-for-xmlIndentTreeOut.patch - "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch -) - -pkg_setup() { - # Check kernel configuration: - CONFIG_CHECK="" - use fuse && CONFIG_CHECK+=" - ~FUSE_FS" - - use lvm && CONFIG_CHECK+=" - ~BLK_DEV_DM - ~DM_MULTIPATH - ~DM_SNAPSHOT" - - use lxc && CONFIG_CHECK+=" - ~BLK_CGROUP - ~CGROUP_CPUACCT - ~CGROUP_DEVICE - ~CGROUP_FREEZER - ~CGROUP_NET_PRIO - ~CGROUP_PERF - ~CGROUPS - ~CGROUP_SCHED - ~CPUSETS - ~IPC_NS - ~MACVLAN - ~NAMESPACES - ~NET_CLS_CGROUP - ~NET_NS - ~PID_NS - ~POSIX_MQUEUE - ~SECURITYFS - ~USER_NS - ~UTS_NS - ~VETH - ~!GRKERNSEC_CHROOT_MOUNT - ~!GRKERNSEC_CHROOT_DOUBLE - ~!GRKERNSEC_CHROOT_PIVOT - ~!GRKERNSEC_CHROOT_CHMOD - ~!GRKERNSEC_CHROOT_CAPS" - - kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" - ~DEVPTS_MULTIPLE_INSTANCES" - - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_MARK_T - ~BRIDGE_NF_EBTABLES - ~NETFILTER_ADVANCED - ~NETFILTER_XT_CONNMARK - ~NETFILTER_XT_MARK - ~NETFILTER_XT_TARGET_CHECKSUM - ~IP_NF_FILTER - ~IP_NF_MANGLE - ~IP_NF_NAT - ~IP6_NF_FILTER - ~IP6_NF_MANGLE - ~IP6_NF_NAT" - - # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 - if use virt-network ; then - if kernel_is -lt 5 2 ; then - CONFIG_CHECK+=" - ~IP_NF_TARGET_MASQUERADE" - else - CONFIG_CHECK+=" - ~NETFILTER_XT_TARGET_MASQUERADE" - fi - fi - - # Bandwidth Limiting Support - use virt-network && CONFIG_CHECK+=" - ~BRIDGE_EBT_T_NAT - ~IP_NF_TARGET_REJECT - ~NET_ACT_POLICE - ~NET_CLS_FW - ~NET_CLS_U32 - ~NET_SCH_HTB - ~NET_SCH_INGRESS - ~NET_SCH_SFQ" - - ERROR_USER_NS="Optional depending on LXC configuration." - - if [[ -n ${CONFIG_CHECK} ]]; then - linux-info_pkg_setup - fi - - python-any-r1_pkg_setup -} - -src_prepare() { - touch "${S}/.mailmap" || die - - default - python_fix_shebang . - - # Skip fragile tests which relies on pristine environment - # (Breaks because of sandbox environment variables) - # bug #802876 - sed -i -e "/commandtest/d" tests/meson.build || die - - # Tweak the init script: - cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die - sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ - -i "${S}/libvirtd.init" || die "sed failed" -} - -src_configure() { - local emesonargs=( - $(meson_feature apparmor) - $(meson_feature apparmor apparmor_profiles) - $(meson_feature audit) - $(meson_feature caps capng) - $(meson_feature dtrace) - $(meson_feature firewalld) - $(meson_feature fuse) - $(meson_feature glusterfs) - $(meson_feature glusterfs storage_gluster) - $(meson_feature iscsi storage_iscsi) - $(meson_feature iscsi-direct storage_iscsi_direct) - $(meson_feature libvirtd driver_libvirtd) - $(meson_feature libssh) - $(meson_feature libssh2) - $(meson_feature lvm storage_lvm) - $(meson_feature lvm storage_mpath) - $(meson_feature lxc driver_lxc) - $(meson_feature nls) - $(meson_feature numa numactl) - $(meson_feature numa numad) - $(meson_feature openvz driver_openvz) - $(meson_feature parted storage_disk) - $(meson_feature pcap libpcap) - $(meson_feature policykit polkit) - $(meson_feature qemu driver_qemu) - $(meson_feature qemu yajl) - $(meson_feature rbd storage_rbd) - $(meson_feature sasl) - $(meson_feature selinux) - $(meson_feature test tests) - $(meson_feature udev) - $(meson_feature virt-network driver_network) - $(meson_feature virtualbox driver_vbox) - $(meson_feature wireshark-plugins wireshark_dissector) - $(meson_feature xen driver_libxl) - $(meson_feature zfs storage_zfs) - - -Dnetcf=disabled - -Dsanlock=disabled - -Dopenwsman=disabled - - -Ddriver_esx=enabled - -Dinit_script=systemd - -Dqemu_user=$(usex caps qemu root) - -Dqemu_group=$(usex caps qemu root) - -Ddriver_remote=enabled - -Dstorage_fs=enabled - -Ddriver_vmware=enabled - - --localstatedir="${EPREFIX}/var" - -Dinitconfdir="${EPREFIX}/etc/systemd" - -Drunstatedir="${EPREFIX}/run" - -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" - ) - - meson_src_configure -} - -src_test() { - export VIR_TEST_DEBUG=1 - # Don't run the syntax check tests, they're fragile and not relevant - # to us downstream anyway. - # We also crank up the timeout (as Fedora does) just to preempt failures - # on slower arches. - meson_src_test --no-suite syntax-check --timeout-multiplier 10 -} - -src_install() { - meson_src_install - - # Depending on configuration option, libvirt will create some bogus - # directoreis. They are either not used, or libvirtd is able to create - # them on demand, so let's remove them. - # - # Note, we are using -f here so that rm does not fail or warn if the - # directory is nonexistent. - rm -rf "${D}"/etc/sysconfig - rm -rf "${D}"/var - rm -rf "${D}"/run - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - - newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf - - newinitd "${S}/libvirtd.init" libvirtd - newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests - newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd - newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd - - newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd - newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests - - DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") - DISABLE_AUTOFORMATTING=true - readme.gentoo_create_doc -} - -pkg_postinst() { - if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then - touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die - fi - - use libvirtd || return 0 - # From here, only libvirtd-related instructions, be warned! - tmpfiles_process libvirtd.conf - readme.gentoo_print_elog -} diff --git a/app-emulation/libvirt/libvirt-9.9.0-r2.ebuild b/app-emulation/libvirt/libvirt-9.9.0-r2.ebuild new file mode 100644 index 000000000000..684c0dc7afe2 --- /dev/null +++ b/app-emulation/libvirt/libvirt-9.9.0-r2.ebuild @@ -0,0 +1,367 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# Packages which get releases together: +# app-emacs/nxml-libvirt-schemas +# dev-python/libvirt-python +# dev-perl/Sys-Virt +# app-emulation/libvirt +# Please bump them together! + +PYTHON_COMPAT=( python3_{10..12} ) +VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/libvirt.org.asc +inherit meson linux-info python-any-r1 readme.gentoo-r1 tmpfiles verify-sig + +if [[ ${PV} = *9999* ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/libvirt/libvirt.git" + EGIT_BRANCH="master" +else + SRC_URI="https://libvirt.org/sources/${P}.tar.xz + verify-sig? ( https://libvirt.org/sources/${P}.tar.xz.asc )" + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86" +fi + +DESCRIPTION="C toolkit to manipulate virtual machines" +HOMEPAGE="https://www.libvirt.org/ https://gitlab.com/libvirt/libvirt/" +LICENSE="LGPL-2.1" +SLOT="0/${PV}" +IUSE=" + apparmor audit bash-completion +caps dtrace firewalld fuse glusterfs + iscsi iscsi-direct +libvirtd lvm libssh libssh2 lxc nfs nls numa openvz + parted pcap policykit +qemu rbd sasl selinux test +udev virtiofsd + virtualbox +virt-network wireshark-plugins xen zfs +" +RESTRICT="!test? ( test )" + +REQUIRED_USE=" + firewalld? ( virt-network ) + libvirtd? ( || ( lxc openvz qemu virtualbox xen ) ) + lxc? ( caps libvirtd ) + openvz? ( libvirtd ) + qemu? ( libvirtd ) + virt-network? ( libvirtd ) + virtualbox? ( libvirtd ) + xen? ( libvirtd )" + +BDEPEND=" + app-text/xhtml1 + dev-lang/perl + dev-libs/libxslt + dev-perl/XML-XPath + dev-python/docutils + virtual/pkgconfig + net-libs/rpcsvc-proto + bash-completion? ( >=app-shells/bash-completion-2.0 ) + verify-sig? ( sec-keys/openpgp-keys-libvirt )" + +# gettext.sh command is used by the libvirt command wrappers, and it's +# non-optional, so put it into RDEPEND. +# We can use both libnl:1.1 and libnl:3, but if you have both installed, the +# package will use 3 by default. Since we don't have slot pinning in an API, +# we must go with the most recent. +RDEPEND=" + acct-user/qemu + app-misc/scrub + >=dev-libs/glib-2.56.0 + dev-libs/libgcrypt + dev-libs/libnl:3 + >=dev-libs/libxml2-2.9.1 + >=net-analyzer/openbsd-netcat-1.105-r1 + >=net-libs/gnutls-3.2.0:= + net-libs/libtirpc:= + >=net-misc/curl-7.18.0 + sys-apps/dbus + sys-apps/dmidecode + sys-devel/gettext + >=sys-libs/readline-7.0:= + virtual/acl + apparmor? ( sys-libs/libapparmor ) + audit? ( sys-process/audit ) + caps? ( sys-libs/libcap-ng ) + dtrace? ( dev-debug/systemtap ) + firewalld? ( >=net-firewall/firewalld-0.6.3 ) + fuse? ( sys-fs/fuse:= ) + glusterfs? ( >=sys-cluster/glusterfs-3.4.1 ) + iscsi? ( >=sys-block/open-iscsi-1.18.0 ) + iscsi-direct? ( >=net-libs/libiscsi-1.18.0 ) + libssh? ( >=net-libs/libssh-0.8.1:= ) + libssh2? ( >=net-libs/libssh2-1.3 ) + lvm? ( >=sys-fs/lvm2-2.02.48-r2[lvm] ) + lxc? ( !sys-apps/systemd[cgroup-hybrid(-)] ) + nfs? ( net-fs/nfs-utils ) + numa? ( + >sys-process/numactl-2.0.2 + sys-process/numad + ) + parted? ( + >=sys-block/parted-1.8[device-mapper] + sys-fs/lvm2[lvm] + ) + pcap? ( >=net-libs/libpcap-1.8.0 ) + policykit? ( + acct-group/libvirt + >=sys-auth/polkit-0.9 + ) + qemu? ( + >=app-emulation/qemu-4.2 + app-crypt/swtpm + >=dev-libs/yajl-2.0.3:= + ) + rbd? ( sys-cluster/ceph ) + sasl? ( >=dev-libs/cyrus-sasl-2.1.26 ) + selinux? ( >=sys-libs/libselinux-2.0.85 ) + virt-network? ( + net-dns/dnsmasq[dhcp,ipv6(+),script] + net-firewall/ebtables + >=net-firewall/iptables-1.4.10[ipv6(+)] + net-misc/radvd + sys-apps/iproute2[-minimal] + ) + virtiofsd? ( app-emulation/virtiofsd ) + wireshark-plugins? ( >=net-analyzer/wireshark-2.6.0:= ) + xen? ( + >=app-emulation/xen-4.9.0 + app-emulation/xen-tools:= + ) + udev? ( + virtual/libudev:= + >=x11-libs/libpciaccess-0.10.9 + ) + zfs? ( sys-fs/zfs ) + kernel_linux? ( sys-apps/util-linux )" +DEPEND=" + ${BDEPEND} + ${RDEPEND} + ${PYTHON_DEPS} +" +# The 'circular' dependency on dev-python/libvirt-python is because of +# virt-qemu-qmp-proxy. +PDEPEND=" + qemu? ( dev-python/libvirt-python ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-9.4.0-fix_paths_in_libvirt-guests_sh.patch + "${FILESDIR}"/${PN}-9.9.0-do-not-use-sysconfig.patch + "${FILESDIR}"/${PN}-9.6.0-fix-paths-for-apparmor.patch + "${FILESDIR}"/${PN}-9.10.0-virxml-include-libxml-xmlsave.h-for-xmlIndentTreeOut.patch + "${FILESDIR}"/${PN}-10.1.0-Fix-off-by-one-error-in-udevListInterfacesByStatus.patch + "${FILESDIR}"/${PN}-10.2.0-remote-check-for-negative-array-lengths-before-alloc.patch +) + +pkg_setup() { + # Check kernel configuration: + CONFIG_CHECK="" + use fuse && CONFIG_CHECK+=" + ~FUSE_FS" + + use lvm && CONFIG_CHECK+=" + ~BLK_DEV_DM + ~DM_MULTIPATH + ~DM_SNAPSHOT" + + use lxc && CONFIG_CHECK+=" + ~BLK_CGROUP + ~CGROUP_CPUACCT + ~CGROUP_DEVICE + ~CGROUP_FREEZER + ~CGROUP_NET_PRIO + ~CGROUP_PERF + ~CGROUPS + ~CGROUP_SCHED + ~CPUSETS + ~IPC_NS + ~MACVLAN + ~NAMESPACES + ~NET_CLS_CGROUP + ~NET_NS + ~PID_NS + ~POSIX_MQUEUE + ~SECURITYFS + ~USER_NS + ~UTS_NS + ~VETH + ~!GRKERNSEC_CHROOT_MOUNT + ~!GRKERNSEC_CHROOT_DOUBLE + ~!GRKERNSEC_CHROOT_PIVOT + ~!GRKERNSEC_CHROOT_CHMOD + ~!GRKERNSEC_CHROOT_CAPS" + + kernel_is lt 4 7 && use lxc && CONFIG_CHECK+=" + ~DEVPTS_MULTIPLE_INSTANCES" + + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_MARK_T + ~BRIDGE_NF_EBTABLES + ~NETFILTER_ADVANCED + ~NETFILTER_XT_CONNMARK + ~NETFILTER_XT_MARK + ~NETFILTER_XT_TARGET_CHECKSUM + ~IP_NF_FILTER + ~IP_NF_MANGLE + ~IP_NF_NAT + ~IP6_NF_FILTER + ~IP6_NF_MANGLE + ~IP6_NF_NAT" + + # This was renamed in kernel commit v5.2-rc1~133^2~174^2~6 + if use virt-network ; then + if kernel_is -lt 5 2 ; then + CONFIG_CHECK+=" + ~IP_NF_TARGET_MASQUERADE" + else + CONFIG_CHECK+=" + ~NETFILTER_XT_TARGET_MASQUERADE" + fi + fi + + # Bandwidth Limiting Support + use virt-network && CONFIG_CHECK+=" + ~BRIDGE_EBT_T_NAT + ~IP_NF_TARGET_REJECT + ~NET_ACT_POLICE + ~NET_CLS_FW + ~NET_CLS_U32 + ~NET_SCH_HTB + ~NET_SCH_INGRESS + ~NET_SCH_SFQ" + + ERROR_USER_NS="Optional depending on LXC configuration." + + if [[ -n ${CONFIG_CHECK} ]]; then + linux-info_pkg_setup + fi + + python-any-r1_pkg_setup +} + +src_prepare() { + touch "${S}/.mailmap" || die + + default + python_fix_shebang . + + # Skip fragile tests which relies on pristine environment + # (Breaks because of sandbox environment variables) + # bug #802876 + sed -i -e "/commandtest/d" tests/meson.build || die + + # Tweak the init script: + cp "${FILESDIR}/libvirtd.init-r19" "${S}/libvirtd.init" || die + sed -e "s/USE_FLAG_FIREWALLD/$(usex firewalld 'need firewalld' '')/" \ + -i "${S}/libvirtd.init" || die "sed failed" +} + +src_configure() { + local emesonargs=( + $(meson_feature apparmor) + $(meson_feature apparmor apparmor_profiles) + $(meson_feature audit) + $(meson_feature caps capng) + $(meson_feature dtrace) + $(meson_feature firewalld) + $(meson_feature fuse) + $(meson_feature glusterfs) + $(meson_feature glusterfs storage_gluster) + $(meson_feature iscsi storage_iscsi) + $(meson_feature iscsi-direct storage_iscsi_direct) + $(meson_feature libvirtd driver_libvirtd) + $(meson_feature libssh) + $(meson_feature libssh2) + $(meson_feature lvm storage_lvm) + $(meson_feature lvm storage_mpath) + $(meson_feature lxc driver_lxc) + $(meson_feature nls) + $(meson_feature numa numactl) + $(meson_feature numa numad) + $(meson_feature openvz driver_openvz) + $(meson_feature parted storage_disk) + $(meson_feature pcap libpcap) + $(meson_feature policykit polkit) + $(meson_feature qemu driver_qemu) + $(meson_feature qemu yajl) + $(meson_feature rbd storage_rbd) + $(meson_feature sasl) + $(meson_feature selinux) + $(meson_feature test tests) + $(meson_feature udev) + $(meson_feature virt-network driver_network) + $(meson_feature virtualbox driver_vbox) + $(meson_feature wireshark-plugins wireshark_dissector) + $(meson_feature xen driver_libxl) + $(meson_feature zfs storage_zfs) + + -Dnetcf=disabled + -Dsanlock=disabled + -Dopenwsman=disabled + + -Ddriver_esx=enabled + -Dinit_script=systemd + -Dqemu_user=$(usex caps qemu root) + -Dqemu_group=$(usex caps qemu root) + -Ddriver_remote=enabled + -Dstorage_fs=enabled + -Ddriver_vmware=enabled + + --localstatedir="${EPREFIX}/var" + -Dinitconfdir="${EPREFIX}/etc/systemd" + -Drunstatedir="${EPREFIX}/run" + -Ddocdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + meson_src_configure +} + +src_test() { + export VIR_TEST_DEBUG=1 + # Don't run the syntax check tests, they're fragile and not relevant + # to us downstream anyway. + # We also crank up the timeout (as Fedora does) just to preempt failures + # on slower arches. + meson_src_test --no-suite syntax-check --timeout-multiplier 10 +} + +src_install() { + meson_src_install + + # Depending on configuration option, libvirt will create some bogus + # directoreis. They are either not used, or libvirtd is able to create + # them on demand, so let's remove them. + # + # Note, we are using -f here so that rm does not fail or warn if the + # directory is nonexistent. + rm -rf "${D}"/etc/sysconfig + rm -rf "${D}"/var + rm -rf "${D}"/run + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + + newtmpfiles "${FILESDIR}"/libvirtd.tmpfiles.conf libvirtd.conf + + newinitd "${S}/libvirtd.init" libvirtd + newinitd "${FILESDIR}/libvirt-guests.init-r4" libvirt-guests + newinitd "${FILESDIR}/virtlockd.init-r2" virtlockd + newinitd "${FILESDIR}/virtlogd.init-r2" virtlogd + + newconfd "${FILESDIR}/libvirtd.confd-r5" libvirtd + newconfd "${FILESDIR}/libvirt-guests.confd" libvirt-guests + + DOC_CONTENTS=$(<"${FILESDIR}/README.gentoo-r3") + DISABLE_AUTOFORMATTING=true + readme.gentoo_create_doc +} + +pkg_postinst() { + if [[ -e "${ROOT}"/etc/libvirt/qemu/networks/default.xml ]]; then + touch "${ROOT}"/etc/libvirt/qemu/networks/default.xml || die + fi + + use libvirtd || return 0 + # From here, only libvirtd-related instructions, be warned! + tmpfiles_process libvirtd.conf + readme.gentoo_print_elog +} -- cgit v1.2.3-65-gdbad