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} %global debug_package %{nil}
%endif %endif
# Documentation adds a circular dependency, so by
# default we build without.
%bcond_with doc
%global srcname ppx-here %global srcname ppx-here
%global upname 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 >= 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
%if %{with doc}
BuildRequires: ocaml-odoc BuildRequires: ocaml-odoc
%endif
BuildRequires: ocaml-ppxlib-devel >= 0.11.0 BuildRequires: ocaml-ppxlib-devel >= 0.11.0
%description %description
@ -38,13 +44,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
@ -84,7 +94,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}
@ -105,6 +117,7 @@ dune runtest
%changelog %changelog
* Mon Mar 1 17:37:09 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8 * Mon Mar 1 17:37:09 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.14.0-8
- OCaml 4.12.0 build - OCaml 4.12.0 build
- Make the 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