spec: Add support for building the zfs storage driver

Where it can be supported in Fedora, the driver is built and made
available as a subpackage.

Signed-off-by: Neal Gompa <ngompa13@gmail.com>
This commit is contained in:
Neal Gompa 2017-07-17 11:32:46 -04:00 committed by Cole Robinson
parent 99eac2668c
commit 9af764e86a

View File

@ -71,6 +71,13 @@
%define with_storage_gluster 0%{!?_without_storage_gluster:1}
%define with_numactl 0%{!?_without_numactl:1}
# F25+ has zfs-fuse
%if 0%{?fedora} >= 25
%define with_storage_zfs 0%{!?_without_storage_zfs:1}
%else
%define with_storage_zfs 0
%endif
# A few optional bits off by default, we enable later
%define with_fuse 0%{!?_without_fuse:0}
%define with_cgconfig 0%{!?_without_cgconfig:0}
@ -115,6 +122,12 @@
%endif
%endif
# zfs-fuse is not available on some architectures
%ifarch s390 s390x aarch64
%define with_storage_zfs 0
%endif
# RHEL doesn't ship OpenVZ, VBox, UML, PowerHypervisor,
# VMware, libxenserver (xenapi), libxenlight (Xen 4.1 and newer),
# or HyperV.
@ -373,6 +386,12 @@ BuildRequires: glusterfs-devel >= 3.4.1
%if %{with_storage_sheepdog}
BuildRequires: sheepdog
%endif
%if %{with_storage_zfs}
# Support any conforming implementation of zfs. On stock Fedora
# this is zfs-fuse, but could be zfsonlinux upstream RPMs
BuildRequires: /sbin/zfs
BuildRequires: /sbin/zpool
%endif
%if %{with_numactl}
# For QEMU/LXC numa info
BuildRequires: numactl-devel
@ -705,6 +724,21 @@ sheepdog volumes using.
%endif
%if %{with_storage_zfs}
%package daemon-driver-storage-zfs
Summary: Storage driver plugin for ZFS
Group: Development/Libraries
Requires: libvirt-daemon-driver-storage-core = %{version}-%{release}
# Support any conforming implementation of zfs
Requires: /sbin/zfs
Requires: /sbin/zpool
%description daemon-driver-storage-zfs
The storage driver backend adding implementation of the storage APIs for
ZFS volumes.
%endif
%package daemon-driver-storage
Summary: Storage driver plugin including all backends for the libvirtd daemon
Group: Development/Libraries
@ -723,6 +757,9 @@ Requires: libvirt-daemon-driver-storage-rbd = %{version}-%{release}
%if %{with_storage_sheepdog}
Requires: libvirt-daemon-driver-storage-sheepdog = %{version}-%{release}
%endif
%if %{with_storage_zfs}
Requires: libvirt-daemon-driver-storage-zfs = %{version}-%{release}
%endif
%description daemon-driver-storage
The storage driver plugin for the libvirtd daemon, providing
@ -1180,6 +1217,12 @@ rm -rf .git
%define arg_storage_gluster --without-storage-gluster
%endif
%if %{with_storage_zfs}
%define arg_storage_zfs --with-storage-zfs
%else
%define arg_storage_zfs --without-storage-zfs
%endif
%if %{with_numactl}
%define arg_numactl --with-numactl
%else
@ -1288,7 +1331,7 @@ rm -f po/stamp-po
%{?arg_storage_rbd} \
%{?arg_storage_sheepdog} \
%{?arg_storage_gluster} \
--without-storage-zfs \
%{?arg_storage_zfs} \
--without-storage-vstorage \
%{?arg_numactl} \
%{?arg_numad} \
@ -1851,6 +1894,11 @@ exit 0
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_sheepdog.so
%endif
%if %{with_storage_zfs}
%files daemon-driver-storage-zfs
%{_libdir}/%{name}/storage-backend/libvirt_storage_backend_zfs.so
%endif
%if %{with_qemu}
%files daemon-driver-qemu
%dir %attr(0700, root, root) %{_sysconfdir}/libvirt/qemu/