Allow building without nbd, rbd or rados

Building with `--without=nbd` (or similar for rbd, rados)
will disable the nbd, rbd or rados engines respectively.
This commit is contained in:
Amit Shah 2022-09-07 14:29:21 -05:00 committed by Eric Sandeen
parent beba725cbc
commit c6e3dd59ea
1 changed files with 33 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: fio
Version: 3.32
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Multithreaded IO generation tool
License: GPLv2
@ -9,13 +9,18 @@ Source0: http://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2
Source1: https://brick.kernel.dk/snaps/%{name}-%{version}.tar.bz2.asc
Source2: https://git.kernel.org/pub/scm/docs/kernel/pgpkeys.git/plain/keys/F7D358FB2971E0A6.asc
%bcond nbd 1
%bcond rbd 1
%bcond rados 1
BuildRequires: gcc
BuildRequires: gnupg2
BuildRequires: libaio-devel
BuildRequires: zlib-devel
BuildRequires: python3-devel
%if %{with nbd}
BuildRequires: libnbd-devel
%endif
BuildRequires: libcurl-devel
BuildRequires: openssl-devel
%ifarch x86_64 ppc64le
@ -24,8 +29,10 @@ BuildRequires: libpmemblk-devel
%endif
%ifnarch %{arm} %{ix86} ppc64le
%if %{with rbd}
BuildRequires: librbd1-devel
%endif
%endif
%ifnarch %{arm}
BuildRequires: numactl-devel
@ -42,16 +49,22 @@ BuildRequires: make
# or if the dependencies are too onerous.
Recommends: %{name}-engine-libaio
Recommends: %{name}-engine-http
%if %{with nbd}
Recommends: %{name}-engine-nbd
%endif
%ifarch x86-64 ppc64le
Recommends: %{name}-engine-dev-dax
Recommends: %{name}-engine-pmemblk
Recommends: %{name}-engine-libpmem
%endif
%ifnarch %{arm} %{ix86} ppc64le
%if %{with rados}
Recommends: %{name}-engine-rados
%endif
%if %{with rbd}
Recommends: %{name}-engine-rbd
%endif
%endif
%ifnarch %{arm}
Recommends: %{name}-engine-rdma
%endif
@ -78,12 +91,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description engine-http
HTTP engine for %{name}.
%if %{with nbd}
%package engine-nbd
Summary: Network Block Device engine for %{name}.
Requires: %{name}%{?_isa} = %{version}-%{release}
%description engine-nbd
Network Block Device (NBD) engine for %{name}.
%endif
%ifarch x86_64 ppc64le
%package engine-dev-dax
@ -119,13 +134,16 @@ on a persistent memory device through the PMDK libpmem library.
%endif
%ifnarch %{arm} %{ix86} ppc64le
%if %{with rados}
%package engine-rados
Summary: Rados engine for %{name}.
Requires: %{name}%{?_isa} = %{version}-%{release}
%description engine-rados
Rados engine for %{name}.
%endif
%if %{with rbd}
%package engine-rbd
Summary: Rados Block Device engine for %{name}.
Requires: %{name}%{?_isa} = %{version}-%{release}
@ -133,6 +151,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release}
%description engine-rbd
Rados Block Device (RBD) engine for %{name}.
%endif
%endif
%ifnarch %{arm}
%package engine-rdma
@ -158,7 +177,11 @@ pathfix.py -i %{__python3} -pn \
sed -e 's,/usr/local/lib/,%{_libdir}/,g' -i os/os-linux.h
%build
%if %{with nbd}
./configure --disable-optimizations --enable-libnbd --dynamic-libengines
%else
./configure --disable-optimizations --dynamic-libengines
%endif
EXTFLAGS="$RPM_OPT_FLAGS" LDFLAGS="$RPM_LD_FLAGS" make V=1 %{?_smp_mflags}
%install
@ -190,8 +213,10 @@ make install prefix=%{_prefix} mandir=%{_mandir} libdir=%{_libdir}/fio DESTDIR=$
%{_libdir}/fio/fio-libpmem.so
%endif
%if %{with nbd}
%files engine-nbd
%{_libdir}/fio/fio-nbd.so
%endif
%ifarch x86_64 ppc64le
%files engine-pmemblk
@ -199,12 +224,16 @@ make install prefix=%{_prefix} mandir=%{_mandir} libdir=%{_libdir}/fio DESTDIR=$
%endif
%ifnarch %{arm} %{ix86} ppc64le
%if %{with rados}
%files engine-rados
%{_libdir}/fio/fio-rados.so
%endif
%if %{with rbd}
%files engine-rbd
%{_libdir}/fio/fio-rbd.so
%endif
%endif
%ifnarch %{arm}
%files engine-rdma
@ -212,6 +241,9 @@ make install prefix=%{_prefix} mandir=%{_mandir} libdir=%{_libdir}/fio DESTDIR=$
%endif
%changelog
* Wed Sep 07 2022 Amit Shah <amitshah@fedoraproject.org> - 3.32-2
- Allow building without nbd, rbd, rados support
* Wed Sep 07 2022 Davide Cavalca <dcavalca@fedoraproject.org> - 3.32-1
- New upstream version (RHBZ#2033897)