Make -doc subpackage optional, disabled for now.

This commit is contained in:
Richard W.M. Jones 2020-02-26 17:24:10 +00:00
parent 36cfffaa29
commit 6cd4b4d36e
1 changed files with 16 additions and 2 deletions

View File

@ -4,9 +4,14 @@
%global srcname ounit
# -doc subpackage requires ocaml-odoc which has rather a lot of
# dependencies. This flag allows the non-essential subpackage to be
# enabled.
%bcond_with doc
Name: ocaml-%{srcname}
Version: 2.2.2
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Unit test framework for OCaml
License: MIT
@ -23,7 +28,9 @@ BuildRequires: ocaml-findlib
BuildRequires: ocaml-lwt-devel
BuildRequires: ocaml-mmap-devel
BuildRequires: ocaml-ocplib-endian-devel
%if %{with doc}
BuildRequires: ocaml-odoc
%endif
BuildRequires: ocaml-result-devel
# The ounit name is now just an alias for ounit2
@ -86,7 +93,9 @@ Documentation for %{name}.
%build
dune build %{?_smp_mflags}
%if %{with doc}
dune build %{?_smp_mflags} @doc
%endif
%check
@ -96,8 +105,10 @@ dune runtest
%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 install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc
@ -177,16 +188,19 @@ find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+
%{_libdir}/ocaml/%{srcname}2-lwt/oUnitLwt.ml
%if %{with doc}
%files doc
%doc _build/default/_doc/_html/
%doc _build/default/_doc/_mlds/
%doc _build/default/_doc/_odoc/
%license LICENSE.txt
%endif
%changelog
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 2.2.2-2
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 2.2.2-3
- OCaml 4.10.0 final.
- Make -doc subpackage optional, disabled for now.
* Fri Feb 7 2020 Jerry James <loganjerry@gmail.com> - 2.2.2-1
- New upstream version 2.2.2