spec: Enable the iscsi-direct storage driver conditionally

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>
This commit is contained in:
Andrea Bolognani 2018-08-14 14:31:35 +02:00
parent 27bb9c944d
commit fe5b35c6b2

View File

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