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

View File

@ -4,9 +4,14 @@
%global srcname ounit %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} Name: ocaml-%{srcname}
Version: 2.2.2 Version: 2.2.2
Release: 2%{?dist} Release: 3%{?dist}
Summary: Unit test framework for OCaml Summary: Unit test framework for OCaml
License: MIT License: MIT
@ -23,7 +28,9 @@ BuildRequires: ocaml-findlib
BuildRequires: ocaml-lwt-devel BuildRequires: ocaml-lwt-devel
BuildRequires: ocaml-mmap-devel BuildRequires: ocaml-mmap-devel
BuildRequires: ocaml-ocplib-endian-devel BuildRequires: ocaml-ocplib-endian-devel
%if %{with doc}
BuildRequires: ocaml-odoc BuildRequires: ocaml-odoc
%endif
BuildRequires: ocaml-result-devel BuildRequires: ocaml-result-devel
# The ounit name is now just an alias for ounit2 # The ounit name is now just an alias for ounit2
@ -86,7 +93,9 @@ Documentation for %{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
%check %check
@ -96,8 +105,10 @@ dune runtest
%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 install the documentation with the doc macro # We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc 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 %{_libdir}/ocaml/%{srcname}2-lwt/oUnitLwt.ml
%if %{with doc}
%files doc %files doc
%doc _build/default/_doc/_html/ %doc _build/default/_doc/_html/
%doc _build/default/_doc/_mlds/ %doc _build/default/_doc/_mlds/
%doc _build/default/_doc/_odoc/ %doc _build/default/_doc/_odoc/
%license LICENSE.txt %license LICENSE.txt
%endif
%changelog %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. - 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 * Fri Feb 7 2020 Jerry James <loganjerry@gmail.com> - 2.2.2-1
- New upstream version 2.2.2 - New upstream version 2.2.2