diff --git a/libnbd.spec b/libnbd.spec index 8eb2356..4a68479 100644 --- a/libnbd.spec +++ b/libnbd.spec @@ -1,3 +1,8 @@ +# i686 no longer has any kind of OCaml compiler, not even ocamlc. +%ifnarch %{ix86} +%global have_ocaml 1 +%endif + # If we should verify tarball signature with GPGv2. %global verify_tarball_signature 1 @@ -55,7 +60,7 @@ BuildRequires: ubdsrv-devel >= 1.0-3.rc6 # For the Python 3 bindings. BuildRequires: python3-devel -%ifnarch %{ix86} +%if 0%{?have_ocaml} # For the OCaml bindings. BuildRequires: ocaml BuildRequires: ocaml-findlib-devel @@ -95,7 +100,7 @@ BuildRequires: nbdkit-sh-plugin BuildRequires: nbdkit-sparse-random-plugin %endif -%ifnarch %{ix86} +%if 0%{?have_ocaml} # The OCaml runtime system does not provide this symbol %global __ocaml_requires_opts -x Stdlib__Callback %endif @@ -131,7 +136,7 @@ Requires: %{name}%{?_isa} = %{version}-%{release} This package contains development headers for %{name}. -%ifnarch %{ix86} +%if 0%{?have_ocaml} %package -n ocaml-%{name} Summary: OCaml language bindings for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} @@ -221,7 +226,7 @@ autoreconf -i --with-tls-priority=@LIBNBD,SYSTEM \ PYTHON=%{__python3} \ --enable-python \ -%ifnarch %{ix86} +%if 0%{?have_ocaml} --enable-ocaml \ %else --disable-ocaml \ @@ -242,7 +247,7 @@ find $RPM_BUILD_ROOT -name '*.la' -delete # Delete the golang man page since we're not distributing the bindings. rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-golang.3* -%ifarch %{ix86} +%if !0%{?have_ocaml} # Delete the OCaml man page on i686. rm $RPM_BUILD_ROOT%{_mandir}/man3/libnbd-ocaml.3* %endif @@ -313,7 +318,7 @@ make %{?_smp_mflags} check || { %{_mandir}/man3/nbd_*.3* -%ifnarch %{ix86} +%if 0%{?have_ocaml} %files -n ocaml-%{name} %dir %{_libdir}/ocaml/nbd %{_libdir}/ocaml/nbd/META