Make the ocaml-odoc dependency conditional.

This commit is contained in:
Richard W.M. Jones 2021-03-01 17:56:23 +00:00
parent 493f6aa97d
commit e0bfa8f79d

View File

@ -2,6 +2,10 @@
%global debug_package %{nil}
%endif
# Documentation adds a circular dependency, so by
# default we build without.
%bcond_with doc
%global srcname ppx-here
%global upname ppx_here
@ -17,7 +21,9 @@ Source0: %{url}/archive/v%{version}/%{upname}-%{version}.tar.gz
BuildRequires: ocaml >= 4.04.2
BuildRequires: ocaml-base-devel >= 0.14
BuildRequires: ocaml-dune >= 2.0.0
%if %{with doc}
BuildRequires: ocaml-odoc
%endif
BuildRequires: ocaml-ppxlib-devel >= 0.11.0
%description
@ -38,13 +44,17 @@ files for developing applications that use %{name}.
%build
dune build %{?_smp_mflags}
%if %{with doc}
dune build %{?_smp_mflags} @doc
%endif
%install
dune install --destdir=%{buildroot}
%if %{with doc}
# We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete
%endif
# We do not want the ml files
find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
@ -84,7 +94,9 @@ dune runtest
%endif
%files devel
%if %{with doc}
%doc _build/default/_doc/_html/*
%endif
%{_libdir}/ocaml/%{upname}/dune-package
%{_libdir}/ocaml/%{upname}/opam
%ifarch %{ocaml_native_compiler}
@ -105,6 +117,7 @@ dune runtest
%changelog
* Mon Mar 1 17:37:09 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8
- OCaml 4.12.0 build
- Make the ocaml-odoc dependency conditional.
* Sat Feb 20 2021 Jerry James <loganjerry@gmail.com> - 0.14.0-7
- Rebuild for ocaml-base 0.14.1