spec: isolate the client-qemu using macro

Signed-off-by: mayunlong <mayunlong6@huawei.com>
This commit is contained in:
MaYunlong 2024-03-27 08:26:19 +08:00
parent b06fd98c80
commit eeedca1878
2 changed files with 79 additions and 0 deletions

View File

@ -35,6 +35,7 @@
%define with_lxc 0%{!?_without_lxc:0} %define with_lxc 0%{!?_without_lxc:0}
%define with_libxl 0%{!?_without_libxl:0} %define with_libxl 0%{!?_without_libxl:0}
%define with_vbox 0%{!?_without_vbox:0} %define with_vbox 0%{!?_without_vbox:0}
%define with_client_qemu 0%{!?_without_client_qemu:0}
%ifarch %{arches_qemu_kvm} %ifarch %{arches_qemu_kvm}
%define with_qemu_kvm %{with_qemu} %define with_qemu_kvm %{with_qemu}
@ -279,6 +280,7 @@ URL: https://libvirt.org/
%endif %endif
Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
Patch0000: nodedev-delete-mdev.patch Patch0000: nodedev-delete-mdev.patch
Patch0001: meson.build-isolate-the-client-qemu-using-macros.patch
Requires: libvirt-daemon = %{version}-%{release} Requires: libvirt-daemon = %{version}-%{release}
Requires: libvirt-daemon-config-network = %{version}-%{release} Requires: libvirt-daemon-config-network = %{version}-%{release}
@ -291,8 +293,10 @@ Requires: libvirt-daemon-driver-lxc = %{version}-%{release}
%endif %endif
%if %{with_qemu} %if %{with_qemu}
Requires: libvirt-daemon-driver-qemu = %{version}-%{release} Requires: libvirt-daemon-driver-qemu = %{version}-%{release}
%if %{with_client_qemu}
Requires: libvirt-client-qemu = %{version}-%{release} Requires: libvirt-client-qemu = %{version}-%{release}
%endif %endif
%endif
# We had UML driver, but we've removed it. # We had UML driver, but we've removed it.
Obsoletes: libvirt-daemon-driver-uml <= 5.0.0 Obsoletes: libvirt-daemon-driver-uml <= 5.0.0
Obsoletes: libvirt-daemon-uml <= 5.0.0 Obsoletes: libvirt-daemon-uml <= 5.0.0
@ -1020,6 +1024,7 @@ Obsoletes: libvirt-bash-completion < 7.3.0
The client binaries needed to access the virtualization The client binaries needed to access the virtualization
capabilities of recent versions of Linux (and other OSes). capabilities of recent versions of Linux (and other OSes).
%if %{with_client_qemu}
%package client-qemu %package client-qemu
Summary: Additional client side utilities for QEMU Summary: Additional client side utilities for QEMU
Requires: libvirt-libs = %{version}-%{release} Requires: libvirt-libs = %{version}-%{release}
@ -1030,6 +1035,7 @@ Requires: python3-lxml
%description client-qemu %description client-qemu
The additional client binaries are used to interact The additional client binaries are used to interact
with some QEMU specific features of libvirt. with some QEMU specific features of libvirt.
%endif
%package libs %package libs
Summary: Client side libraries Summary: Client side libraries
@ -1484,6 +1490,12 @@ rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/libvirtd_lxc.aug
rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug rm -f $RPM_BUILD_ROOT%{_datadir}/augeas/lenses/tests/test_libvirtd_lxc.aug
%endif %endif
%if ! %{with_client_qemu}
rm -rf $RPM_BUILD_ROOT%{_mandir}/man1/virt-qemu-qmp-proxy.1*
rm -rf $RPM_BUILD_ROOT%{_mandir}/man1/virt-qemu-sev-validate.1*
rm -rf $RPM_BUILD_ROOT%{_bindir}/virt-qemu-qmp-proxy
rm -rf $RPM_BUILD_ROOT%{_bindir}/virt-qemu-sev-validate
%endif
%if ! %{with_qemu} %if ! %{with_qemu}
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/libvirt/qemu.conf
rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/libvirtd.qemu
@ -2363,11 +2375,13 @@ exit 0
%{_datadir}/bash-completion/completions/virsh %{_datadir}/bash-completion/completions/virsh
%if %{with_qemu} %if %{with_qemu}
%if %{with_client_qemu}
%files client-qemu %files client-qemu
%{_mandir}/man1/virt-qemu-qmp-proxy.1* %{_mandir}/man1/virt-qemu-qmp-proxy.1*
%{_mandir}/man1/virt-qemu-sev-validate.1* %{_mandir}/man1/virt-qemu-sev-validate.1*
%{_bindir}/virt-qemu-qmp-proxy %{_bindir}/virt-qemu-qmp-proxy
%{_bindir}/virt-qemu-sev-validate %{_bindir}/virt-qemu-sev-validate
%endif
%endif %endif
%files libs -f %{name}.lang %files libs -f %{name}.lang
@ -2564,6 +2578,7 @@ exit 0
* Wed Mar 27 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-2 * Wed Mar 27 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-2
- nodedev: delete mdev - nodedev: delete mdev
- spec: fix some switch in spec - spec: fix some switch in spec
- spec: isolate the client-qemu using macros
* Thu Feb 29 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-1 * Thu Feb 29 2024 mayunlong <mayunlong6@huawei.com> - 9.10.0-1
- Update to 9.10.0 release, Initial package for openEuler. - Update to 9.10.0 release, Initial package for openEuler.

View File

@ -0,0 +1,64 @@
From 00e273149d7584750df88be94ce7f53beea26f6d Mon Sep 17 00:00:00 2001
From: MaYunlong <mayunlong6@huawei.com>
Date: Wed, 27 Mar 2024 07:56:14 +0800
Subject: [PATCH] meson.build: isolate the client-qemu using macros
---
docs/manpages/meson.build | 4 ++--
meson.build | 1 +
tools/meson.build | 4 ++--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
index bdc1701..38ee547 100644
--- a/docs/manpages/meson.build
+++ b/docs/manpages/meson.build
@@ -18,9 +18,9 @@ docs_man_files = [
{ 'name': 'virt-pki-query-dn', 'section': '1', 'install': true },
{ 'name': 'virt-pki-validate', 'section': '1', 'install': true },
{ 'name': 'virt-qemu-run', 'section': '1', 'install': conf.has('WITH_QEMU') },
- { 'name': 'virt-qemu-qmp-proxy', 'section': '1', 'install': conf.has('WITH_QEMU') },
+ { 'name': 'virt-qemu-qmp-proxy', 'section': '1', 'install': conf.has('WITH_CLIENT_QEMU') },
{ 'name': 'virt-xml-validate', 'section': '1', 'install': true },
- { 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has('WITH_QEMU') },
+ { 'name': 'virt-qemu-sev-validate', 'section': '1', 'install': conf.has('WITH_CLIENT_QEMU') },
{ 'name': 'libvirt-guests', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
{ 'name': 'libvirtd', 'section': '8', 'install': conf.has('WITH_LIBVIRTD') },
diff --git a/meson.build b/meson.build
index 611cc58..2a7fa8c 100644
--- a/meson.build
+++ b/meson.build
@@ -1637,6 +1637,7 @@ if not get_option('driver_qemu').disabled()
if use_qemu
conf.set('WITH_QEMU', 1)
+ conf.set('WITH_CLIENT_QEMU', 0)
qemu_moddir = get_option('qemu_moddir')
if qemu_moddir == ''
qemu_moddir = libdir / 'qemu'
diff --git a/tools/meson.build b/tools/meson.build
index c72f760..9a5bbd6 100644
--- a/tools/meson.build
+++ b/tools/meson.build
@@ -301,7 +301,7 @@ if conf.has('WITH_SANLOCK')
)
endif
-if conf.has('WITH_QEMU')
+if conf.has('WITH_CLIENT_QEMU')
install_data('virt-qemu-sev-validate',
install_dir: bindir)
endif
@@ -327,7 +327,7 @@ if conf.has('WITH_LIBVIRTD')
endif
endif
-if conf.has('WITH_QEMU')
+if conf.has('WITH_CLIENT_QEMU')
install_data('virt-qemu-qmp-proxy',
install_dir: bindir)
endif
--
2.33.0