From a179f11f407f6a0131d2c70c276d3950d57bc0e1 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Apr 16 2020 20:56:15 +0000 Subject: Version 2.3.1. Add conditional for building documentation with odoc. --- diff --git a/ocaml-bisect-ppx.spec b/ocaml-bisect-ppx.spec index ed1f6a5..45e90fb 100644 --- a/ocaml-bisect-ppx.spec +++ b/ocaml-bisect-ppx.spec @@ -1,10 +1,3 @@ -# The latest release, 1.4.1, is incompatible with ocaml 4.09 and the latest -# version of ocaml-migrate-parsetree. Furthermore, the license has changed in -# git. Until the next release, we check out from git. -%global gittag b2661bf40d9c53f5adef382423faa00c3d59cf65 -%global shorttag %(cut -b -7 <<< %{gittag}) -%global gitdate 20200106 - %ifnarch %{ocaml_native_compiler} %global debug_package %{nil} %endif @@ -17,28 +10,34 @@ # can break this cycle. %bcond_with tests +# Building the documentation requires ocaml-odoc, which depends transitively +# on this package. +%bcond_with odoc + Name: ocaml-%{srcname} -Version: 1.4.1 -Release: 5.%{gitdate}.%{shorttag}%{?dist} +Version: 2.3.1 +Release: 1%{?dist} Summary: Code coverage for OCaml and Reason License: MIT URL: http://aantron.github.io/bisect_ppx/ -Source0: https://github.com/aantron/%{upname}/archive/%{gittag}/%{upname}-%{shorttag}.tar.gz +Source0: https://github.com/aantron/%{upname}/archive/%{version}/%{upname}-%{version}.tar.gz BuildRequires: git-core BuildRequires: ocaml >= 4.02.0 BuildRequires: ocaml-cmdliner-devel >= 1.0.0 BuildRequires: ocaml-dune BuildRequires: ocaml-findlib -BuildRequires: ocaml-migrate-parsetree-devel >= 1.4.0 +BuildRequires: ocaml-migrate-parsetree-devel >= 1.5.0 +%if %{with odoc} +BuildRequires: ocaml-odoc +%else BuildRequires: ocaml-ocamldoc +%endif %if %{with tests} BuildRequires: ocaml-ounit-devel %endif -BuildRequires: ocaml-ppx-derivers-devel -BuildRequires: ocaml-ppx-tools-versioned-devel >= 5.2.3 -BuildRequires: ocaml-result-devel +BuildRequires: ocaml-ppx-tools-versioned-devel >= 5.3.0 %description Bisect_ppx is a code coverage tool for OCaml. It helps you test @@ -55,22 +54,28 @@ files. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} -Requires: ocaml-migrate-parsetree-devel%{?_isa} -Requires: ocaml-ppx-derivers-devel%{?_isa} Requires: ocaml-ppx-tools-versioned-devel%{?_isa} %description devel The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. +%package doc +Summary: Documentation for %{name} +BuildArch: noarch + +%description doc +Documentation for %{name}. + %prep -%autosetup -n %{upname}-%{gittag} +%autosetup -n %{upname}-%{version} %build dune build %{?_smp_mflags} -# The dune rule for building documentation requires odoc. However, odoc -# transitively depends on this package, so we build documentation manually. +%if %{with odoc} +dune build %{?_smp_mflags} @doc +%else mkdir html ocamldoc -html -d html \ -I _build/default/src/report/.report.eobjs/byte \ @@ -79,6 +84,7 @@ ocamldoc -html -d html \ _build/default/src/runtime/native/*.mli \ _build/default/src/ppx/{exclude,exclusions,instrument}.mli \ _build/default/src/report/*.mli +%endif %install dune install --destdir=%{buildroot} @@ -91,6 +97,9 @@ _build/install/default/bin/bisect-ppx-report --help groff > \ # We install the documentation with the doc macro rm -fr %{buildroot}%{_prefix}/doc +# We do not want the ml files +find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete + %ifarch %{ocaml_native_compiler} # Add missing executable bits find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+ @@ -124,7 +133,6 @@ make test %endif %files devel -%doc html %{_libdir}/ocaml/%{upname}/dune-package %{_libdir}/ocaml/%{upname}/opam %ifarch %{ocaml_native_compiler} @@ -140,18 +148,29 @@ make test %endif %{_libdir}/ocaml/%{upname}/%{upname}*.cmt %{_libdir}/ocaml/%{upname}/%{upname}*.cmti -%{_libdir}/ocaml/%{upname}/*.ml %{_libdir}/ocaml/%{upname}/*.mli %{_libdir}/ocaml/%{upname}/common/bisect_common.cmt %{_libdir}/ocaml/%{upname}/common/bisect_common.cmti -%{_libdir}/ocaml/%{upname}/common/bisect_common.ml %{_libdir}/ocaml/%{upname}/common/bisect_common.mli %{_libdir}/ocaml/%{upname}/runtime/bisect*.cmt %{_libdir}/ocaml/%{upname}/runtime/bisect*.cmti -%{_libdir}/ocaml/%{upname}/runtime/*.ml %{_libdir}/ocaml/%{upname}/runtime/*.mli +%files doc +%if %{with odoc} +%doc _build/default/_doc/_html/ +%doc _build/default/_doc/_mlds/ +%doc _build/default/_doc/_odoc/ +%else +%doc html +%endif +%license LICENSE.md + %changelog +* Thu Apr 16 2020 Jerry James - 2.3.1-1 +- Version 2.3.1 +- Add conditional for building documentation with odoc + * Fri Apr 03 2020 Richard W.M. Jones - 1.4.1-5.20200106.b2661bf - Update all OCaml dependencies for RPM 4.16. diff --git a/sources b/sources index e5f343a..b151db0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bisect_ppx-b2661bf.tar.gz) = 9366fa1a516c6b232ff3071b5bd9cb652dda88e09d2cad1c76893d4ce51155041ae260420801f81c2aa6179dab8b94e70b7011ddfe50047fce57b425c1edd7bc +SHA512 (bisect_ppx-2.3.1.tar.gz) = 690bec043510c32fee586624308eb7243f2a5d1e020e86c2a5302bf0297efd1a4fed3811756d0c32423286e865f64dbc2a7639d4bfb3c35b43afdcb24c0f2de5