Replace %{rhel} tests with more general %{have_ublk} macro
Also force ./configure --enable-ublk or --disable-ublk option.
This commit is contained in:
parent
64f4694063
commit
378ef997e0
25
libnbd.spec
25
libnbd.spec
@ -3,6 +3,11 @@
|
|||||||
%global have_ocaml 1
|
%global have_ocaml 1
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
# No ublk in RHEL 9.
|
||||||
|
%if !0%{?rhel}
|
||||||
|
%global have_ublk 1
|
||||||
|
%endif
|
||||||
|
|
||||||
# If we should verify tarball signature with GPGv2.
|
# If we should verify tarball signature with GPGv2.
|
||||||
%global verify_tarball_signature 1
|
%global verify_tarball_signature 1
|
||||||
|
|
||||||
@ -51,7 +56,7 @@ BuildRequires: libxml2-devel
|
|||||||
# For nbdfuse.
|
# For nbdfuse.
|
||||||
BuildRequires: fuse3, fuse3-devel
|
BuildRequires: fuse3, fuse3-devel
|
||||||
|
|
||||||
%if !0%{?rhel}
|
%if 0%{?have_ublk}
|
||||||
# For nbdublk
|
# For nbdublk
|
||||||
BuildRequires: liburing-devel >= 2.2
|
BuildRequires: liburing-devel >= 2.2
|
||||||
BuildRequires: ubdsrv-devel >= 1.0-3.rc6
|
BuildRequires: ubdsrv-devel >= 1.0-3.rc6
|
||||||
@ -182,7 +187,7 @@ Recommends: fuse3
|
|||||||
This package contains FUSE support for %{name}.
|
This package contains FUSE support for %{name}.
|
||||||
|
|
||||||
|
|
||||||
%if !0%{?rhel}
|
%if 0%{?have_ublk}
|
||||||
%package -n nbdublk
|
%package -n nbdublk
|
||||||
Summary: Userspace NBD block device
|
Summary: Userspace NBD block device
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
@ -233,7 +238,13 @@ autoreconf -i
|
|||||||
%endif
|
%endif
|
||||||
--enable-fuse \
|
--enable-fuse \
|
||||||
--disable-golang \
|
--disable-golang \
|
||||||
--disable-rust
|
--disable-rust \
|
||||||
|
%if 0%{?have_ublk}
|
||||||
|
--enable-ublk \
|
||||||
|
%else
|
||||||
|
--disable-ublk \
|
||||||
|
%endif
|
||||||
|
%{nil}
|
||||||
|
|
||||||
make %{?_smp_mflags}
|
make %{?_smp_mflags}
|
||||||
|
|
||||||
@ -252,7 +263,9 @@ rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3*
|
|||||||
rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-ocaml.3*
|
rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-ocaml.3*
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if 0%{?rhel}
|
# Remove this section in libnbd >= 1.20, since upstream was fixed to
|
||||||
|
# not install nbdublk completion if nbdublk was not built.
|
||||||
|
%if !0%{?have_ublk}
|
||||||
# Delete nbdublk on RHEL.
|
# Delete nbdublk on RHEL.
|
||||||
rm $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/nbdublk
|
rm $RPM_BUILD_ROOT%{_datadir}/bash-completion/completions/nbdublk
|
||||||
%endif
|
%endif
|
||||||
@ -357,7 +370,7 @@ make %{?_smp_mflags} check || {
|
|||||||
%{_mandir}/man1/nbdfuse.1*
|
%{_mandir}/man1/nbdfuse.1*
|
||||||
|
|
||||||
|
|
||||||
%if !0%{?rhel}
|
%if 0%{?have_ublk}
|
||||||
%files -n nbdublk
|
%files -n nbdublk
|
||||||
%{_bindir}/nbdublk
|
%{_bindir}/nbdublk
|
||||||
%{_mandir}/man1/nbdublk.1*
|
%{_mandir}/man1/nbdublk.1*
|
||||||
@ -371,7 +384,7 @@ make %{?_smp_mflags} check || {
|
|||||||
%{_datadir}/bash-completion/completions/nbdfuse
|
%{_datadir}/bash-completion/completions/nbdfuse
|
||||||
%{_datadir}/bash-completion/completions/nbdinfo
|
%{_datadir}/bash-completion/completions/nbdinfo
|
||||||
%{_datadir}/bash-completion/completions/nbdsh
|
%{_datadir}/bash-completion/completions/nbdsh
|
||||||
%if !0%{?rhel}
|
%if 0%{?have_ublk}
|
||||||
%{_datadir}/bash-completion/completions/nbdublk
|
%{_datadir}/bash-completion/completions/nbdublk
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user