Make ocaml-odoc dependency conditional.

This commit is contained in:
Richard W.M. Jones 2021-03-01 17:53:12 +00:00
parent 0f064810a8
commit 2a45252a24

View File

@ -2,6 +2,10 @@
%global debug_package %{nil} %global debug_package %{nil}
%endif %endif
# Documentation adds a circular dependency, so by
# default we build without.
%bcond_with doc
%global srcname ppx-enumerate %global srcname ppx-enumerate
%global upname ppx_enumerate %global upname ppx_enumerate
@ -18,7 +22,9 @@ BuildRequires: ocaml >= 4.04.2
BuildRequires: ocaml-base-devel >= 0.14 BuildRequires: ocaml-base-devel >= 0.14
BuildRequires: ocaml-dune >= 2.0.0 BuildRequires: ocaml-dune >= 2.0.0
BuildRequires: ocaml-ppxlib-devel >= 0.11.0 BuildRequires: ocaml-ppxlib-devel >= 0.11.0
%if %{with doc}
BuildRequires: ocaml-odoc BuildRequires: ocaml-odoc
%endif
%description %description
Ppx_enumerate is a ppx rewriter which generates a definition for the Ppx_enumerate is a ppx rewriter which generates a definition for the
@ -39,13 +45,17 @@ files for developing applications that use %{name}.
%build %build
dune build %{?_smp_mflags} dune build %{?_smp_mflags}
%if %{with doc}
dune build %{?_smp_mflags} @doc dune build %{?_smp_mflags} @doc
%endif
%install %install
dune install --destdir=%{buildroot} dune install --destdir=%{buildroot}
%if %{with doc}
# We do not want the dune markers # We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete find _build/default/_doc/_html -name .dune-keep -delete
%endif
# We do not want the ml files # We do not want the ml files
find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
@ -77,7 +87,9 @@ dune runtest
%endif %endif
%files devel %files devel
%if %{with doc}
%doc _build/default/_doc/_html/* %doc _build/default/_doc/_html/*
%endif
%{_libdir}/ocaml/%{upname}/dune-package %{_libdir}/ocaml/%{upname}/dune-package
%{_libdir}/ocaml/%{upname}/opam %{_libdir}/ocaml/%{upname}/opam
%ifarch %{ocaml_native_compiler} %ifarch %{ocaml_native_compiler}
@ -96,6 +108,7 @@ dune runtest
%changelog %changelog
* Mon Mar 1 17:34:16 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8 * Mon Mar 1 17:34:16 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8
- OCaml 4.12.0 build - OCaml 4.12.0 build
- Make ocaml-odoc dependency conditional.
* Sat Feb 20 2021 Jerry James <loganjerry@gmail.com> - 0.14.0-7 * Sat Feb 20 2021 Jerry James <loganjerry@gmail.com> - 0.14.0-7
- Rebuild for ocaml-base 0.14.1 - Rebuild for ocaml-base 0.14.1