]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
spec: Add option to control building monolithic libvirtd
authorJim Fehlig <jfehlig@suse.com>
Mon, 20 Apr 2026 22:08:41 +0000 (16:08 -0600)
committerJim Fehlig <jfehlig@suse.com>
Mon, 6 Jul 2026 17:40:07 +0000 (11:40 -0600)
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
libvirt.spec.in

index f7f683e1c573851dfc6c2a61ff1d83e6522ead95..72fc08f9e725ead157e48f044f356ec0612f5406 100644 (file)
 %define arches_numad            %{arches_x86} %{power64} aarch64
 %define arches_ch               x86_64 aarch64
 
-# The hypervisor drivers that run in libvirtd
+# The monolithic libvirtd
+%define with_libvirtd      0%{!?_without_libvirtd:1}
+
+# The hypervisor drivers that run in monolithic libvirtd, or a modular daemon
 %define with_lxc           0%{!?_without_lxc:1}
 %define with_libxl         0%{!?_without_libxl:1}
 %define with_vbox          0%{!?_without_vbox:1}
@@ -303,7 +306,11 @@ URL: https://libvirt.org/
 %endif
 Source: https://download.libvirt.org/%{?mainturl}libvirt-%{version}.tar.xz
 
+%if %{with_libvirtd}
 Requires: libvirt-daemon = %{version}-%{release}
+%else
+Obsoletes: libvirt-daemon < %(version)-%(release)
+%endif
 Requires: libvirt-daemon-config-network = %{version}-%{release}
 Requires: libvirt-daemon-config-nwfilter = %{version}-%{release}
 %if %{with_libxl}
@@ -1180,6 +1187,12 @@ echo "This RPM requires either Fedora >= %{min_fedora} or RHEL >= %{min_rhel}"
 exit 1
 %endif
 
+%if %{with_libvirtd}
+    %define arg_libvirtd -Dlibvirtd=enabled
+%else
+    %define arg_libvirtd -Dlibvirtd=disabled
+%endif
+
 %if %{with_qemu}
     %define arg_qemu -Ddriver_qemu=enabled
 %else
@@ -1363,6 +1376,7 @@ export SOURCE_DATE_EPOCH=$(stat --printf='%Y' %{_specdir}/libvirt.spec)
            -Dsasl=enabled \
            -Dpolkit=enabled \
            -Ddriver_libvirtd=enabled \
+           %{?arg_libvirtd} \
            -Ddriver_remote=enabled \
            -Ddriver_test=enabled \
            %{?arg_esx} \
@@ -2074,6 +2088,7 @@ exit 0
 %doc AUTHORS.rst NEWS.rst README.rst
 %doc libvirt-docs/*
 
+    %if %{with_libvirtd}
 %files daemon
 %{_unitdir}/libvirtd.service
 %{_unitdir}/libvirtd.socket
@@ -2090,6 +2105,7 @@ exit 0
 %{_datadir}/augeas/lenses/tests/test_libvirtd.aug
 %attr(0755, root, root) %{_sbindir}/libvirtd
 %{_mandir}/man8/libvirtd.8*
+    %endif
 
 %files daemon-common
 %{_unitdir}/virt-guest-shutdown.target