]> xenbits.xensource.com Git - libvirt.git/commitdiff
spec: Enable the iscsi-direct storage driver conditionally
authorAndrea Bolognani <abologna@redhat.com>
Tue, 14 Aug 2018 12:31:35 +0000 (14:31 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 14 Aug 2018 13:01:40 +0000 (15:01 +0200)
Most distributions we build RPMs on don't ship a
recent enough version of libiscsi, so we can't enable
the driver unconditionally. Add an explicit dependency
on the runtime package while at it.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
libvirt.spec.in

index 63834767ddc45e02e5c447adf60f786eaf7b0f04..883c8a49e71d6493c3e9ca07fc230772d1a28f0a 100644 (file)
     %define with_storage_zfs      0
 %endif
 
+# We need a recent enough libiscsi (>= 1.18.0)
+%if 0%{?fedora} >= 28 || 0%{?rhel} > 7
+    %define with_storage_iscsi_direct 0%{!?_without_storage_iscsi_direct:1}
+%else
+    %define with_storage_iscsi_direct 0
+%endif
+
 # A few optional bits off by default, we enable later
 %define with_fuse          0%{!?_without_fuse:0}
 %define with_sanlock       0%{!?_without_sanlock:0}
@@ -319,8 +326,10 @@ BuildRequires: /usr/bin/qemu-img
 BuildRequires: lvm2
 # For pool type=iscsi
 BuildRequires: iscsi-initiator-utils
+%if %{with_storage_iscsi_direct}
 # For pool type=iscsi-direct
 BuildRequires: libiscsi-devel
+%endif
 # For disk driver
 BuildRequires: parted-devel
 # For Multipath support
@@ -593,14 +602,17 @@ The storage driver backend adding implementation of the storage APIs for iscsi
 volumes using the host iscsi stack.
 
 
+%if %{with_storage_iscsi_direct}
 %package daemon-driver-storage-iscsi-direct
 Summary: Storage driver plugin for iscsi-direct
 Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
 Requires: libvirt-libs = %{version}-%{release}
+Requires: libiscsi
 
 %description daemon-driver-storage-iscsi-direct
 The storage driver backend adding implementation of the storage APIs for iscsi
 volumes using libiscsi direct connection.
+%endif
 
 
 %package daemon-driver-storage-mpath
@@ -679,8 +691,10 @@ Requires: libvirt-daemon-driver-storage-disk = %{version}-%{release}
 Requires: libvirt-daemon-driver-storage-logical = %{version}-%{release}
 Requires: libvirt-daemon-driver-storage-scsi = %{version}-%{release}
 Requires: libvirt-daemon-driver-storage-iscsi = %{version}-%{release}
-Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
 Requires: libvirt-daemon-driver-storage-mpath = %{version}-%{release}
+%if %{with_storage_iscsi_direct}
+Requires: libvirt-daemon-driver-storage-iscsi-direct = %{version}-%{release}
+%endif
 %if %{with_storage_gluster}
 Requires: libvirt-daemon-driver-storage-gluster = %{version}-%{release}
 %endif
@@ -1134,6 +1148,12 @@ exit 1
     %define arg_wireshark --without-wireshark-dissector
 %endif
 
+%if %{with_storage_iscsi_direct}
+    %define arg_storage_iscsi_direct --with-storage-iscsi-direct
+%else
+    %define arg_storage_iscsi_direct --without-storage-iscsi-direct
+%endif
+
 %define when  %(date +"%%F-%%T")
 %define where %(hostname)
 %define who   %{?packager}%{!?packager:Unknown}
@@ -1185,7 +1205,7 @@ rm -f po/stamp-po
            --with-storage-fs \
            --with-storage-lvm \
            --with-storage-iscsi \
-           --with-storage-iscsi-direct \
+           %{?arg_storage_iscsi_direct} \
            --with-storage-scsi \
            --with-storage-disk \
            --with-storage-mpath \
@@ -1651,8 +1671,10 @@ exit 0
 %files daemon-driver-storage-iscsi
 %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi.so
 
+%if %{with_storage_iscsi_direct}
 %files daemon-driver-storage-iscsi-direct
 %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_iscsi-direct.so
+%endif
 
 %files daemon-driver-storage-mpath
 %{_libdir}/%{name}/storage-backend/libvirt_storage_backend_mpath.so