Make the -doc subpackage conditional.

This commit is contained in:
Richard W.M. Jones 2021-03-01 13:55:05 +00:00
parent 231cc0ac80
commit 9262ec1087
1 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,7 @@
# Documentation adds a circular dependency, so by
# default we build without.
%bcond_with doc
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
@ -15,7 +19,9 @@ Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildRequires: ocaml >= 4.04.1
BuildRequires: ocaml-dune >= 1.5.1
%if %{with doc}
BuildRequires: ocaml-odoc
%endif
%description
This package exposes the OCaml compiler libraries repackaged under
@ -30,25 +36,31 @@ The %{name}-devel package contains libraries and
signature files for developing applications that use
%{name}.
%if %{with doc}
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation for %{name}.
%endif
%prep
%autosetup -n %{srcname}-%{version}
%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
@ -87,15 +99,18 @@ find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+
%endif
%{_libdir}/ocaml/%{srcname}/*/*.cmt
%if %{with doc}
%files doc
%doc _build/default/_doc/_html/
%doc _build/default/_doc/_mlds/
%doc _build/default/_doc/_odoc/
%license LICENSE.md
%endif
%changelog
* Mon Mar 1 12:17:33 GMT 2021 Richard W.M. Jones <rjones@redhat.com> - 0.12.3-3
- OCaml 4.12.0 build
- Make the -doc subpackage conditional.
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild