From f1a8154baea1b7f522eb21dbfe9102c58b9eeea1 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 1 Mar 2021 14:47:39 +0000 Subject: [PATCH] Make the -doc subpackage conditional. --- ocaml-ppx-tools.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ocaml-ppx-tools.spec b/ocaml-ppx-tools.spec index 6412064..b8d011a 100644 --- a/ocaml-ppx-tools.spec +++ b/ocaml-ppx-tools.spec @@ -2,6 +2,10 @@ %global debug_package %{nil} %endif +# Documentation adds a circular dependency, so by +# default we build without. +%bcond_with doc + %global srcname ppx-tools %global upname ppx_tools @@ -17,7 +21,9 @@ Source0: %{url}/archive/%{version}/%{upname}-%{version}.tar.gz BuildRequires: ocaml >= 4.08.0 BuildRequires: ocaml-cppo BuildRequires: ocaml-dune >= 1.6 +%if %{with doc} BuildRequires: ocaml-odoc +%endif %description Tools for authors of syntactic tools (such as ppx rewriters). @@ -30,25 +36,31 @@ Requires: %{name}%{?_isa} = %{version}-%{release} 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 %{upname}-%{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 @@ -101,15 +113,18 @@ dune runtest %{_libdir}/ocaml/%{upname}/*.mli %{_libdir}/ocaml/%{upname}/*/*.cmt +%if %{with doc} %files doc %doc _build/default/_doc/_html/ %doc _build/default/_doc/_mlds/ %doc _build/default/_doc/_odoc/ %license LICENSE +%endif %changelog * Mon Mar 1 12:17:35 GMT 2021 Richard W.M. Jones - 6.3-4 - OCaml 4.12.0 build +- Make the -doc subpackage conditional. * Sat Feb 20 2021 Jerry James - 6.3-3 - Bump and rebuild