[libvirt PATCH 2/2] rpm: tell meson whether to use libssh or libssh2 explicitly

Daniel P. Berrangé berrange at redhat.com
Wed Oct 28 12:30:37 UTC 2020

The %meson macro sets "--auto-features=enabled", thus any feature in the
RPM which has a "with_XXX" condition, needs to explicitly pass a
"-DXXX=state" arg to %meson to override the auto features setting.

The with_libssh and with_libssh2 conditions were not exposed to meson,
so if either was set disabled, then meson would fail the build if the
-devel packages were not found.

Signed-off-by: Daniel P. Berrangé <berrange at redhat.com>
 libvirt.spec.in | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/libvirt.spec.in b/libvirt.spec.in
index 47fb53c681..8faa8c656f 100644
--- a/libvirt.spec.in
+++ b/libvirt.spec.in
@@ -1109,6 +1109,18 @@ exit 1
     %define arg_storage_iscsi_direct -Dstorage_iscsi_direct=disabled
+%if %{with_libssh}
+    %define arg_libssh -Dlibssh=enabled
+    %define arg_libssh -Dlibssh=disabled
+%if %{with_libssh2}
+    %define arg_libssh2 -Dlibssh2=enabled
+    %define arg_libssh2 -Dlibssh2=disabled
 %define when  %(date +"%%F-%%T")
 %define where %(hostname)
 %define who   %{?packager}%{!?packager:Unknown}

More information about the libvir-list mailing list