Blame ocaml-bisect-ppx.spec

7b2e5ac
# The latest release, 1.4.1, is incompatible with ocaml 4.09 and the latest
7b2e5ac
# version of ocaml-migrate-parsetree.  Furthermore, the license has changed in
7b2e5ac
# git.  Until the next release, we check out from git.
7b2e5ac
%global gittag   b2661bf40d9c53f5adef382423faa00c3d59cf65
7b2e5ac
%global shorttag %(cut -b -7 <<< %{gittag})
7b2e5ac
%global gitdate  20200106
7b2e5ac
7b2e5ac
%ifnarch %{ocaml_native_compiler}
7b2e5ac
%global debug_package %{nil}
7b2e5ac
%endif
7b2e5ac
7b2e5ac
%global srcname bisect-ppx
7b2e5ac
%global upname  bisect_ppx
7b2e5ac
26dc712
# Running the tests requires ocaml-ounit, which introduces a circular
26dc712
# dependency (also involving ocaml-lwt).  By disabling the tests we
26dc712
# can break this cycle.
26dc712
%bcond_with tests
26dc712
7b2e5ac
Name:           ocaml-%{srcname}
7b2e5ac
Version:        1.4.1
14bdfb8
Release:        4.%{gitdate}.%{shorttag}%{?dist}.1
7b2e5ac
Summary:        Code coverage for OCaml and Reason
7b2e5ac
7b2e5ac
License:        MIT
7b2e5ac
URL:            http://aantron.github.io/bisect_ppx/
7b2e5ac
Source0:        https://github.com/aantron/%{upname}/archive/%{gittag}/%{upname}-%{shorttag}.tar.gz
7b2e5ac
7b2e5ac
BuildRequires:  git-core
7b2e5ac
BuildRequires:  ocaml >= 4.02.0
7b2e5ac
BuildRequires:  ocaml-cmdliner-devel >= 1.0.0
7b2e5ac
BuildRequires:  ocaml-dune
7b2e5ac
BuildRequires:  ocaml-findlib
7b2e5ac
BuildRequires:  ocaml-migrate-parsetree-devel >= 1.4.0
7b2e5ac
BuildRequires:  ocaml-ocamldoc
26dc712
%if %{with tests}
7b2e5ac
BuildRequires:  ocaml-ounit-devel
26dc712
%endif
7b2e5ac
BuildRequires:  ocaml-ppx-derivers-devel
7b2e5ac
BuildRequires:  ocaml-ppx-tools-versioned-devel >= 5.2.3
7b2e5ac
BuildRequires:  ocaml-result-devel
7b2e5ac
7b2e5ac
%description
7b2e5ac
Bisect_ppx is a code coverage tool for OCaml.  It helps you test
7b2e5ac
thoroughly by showing which parts of your code are *not* tested.  It is
7b2e5ac
a small preprocessor that inserts instrumentation at places in your
7b2e5ac
code, such as if-then-else and match expressions.  After you run tests,
7b2e5ac
Bisect_ppx gives a nice HTML report showing which places were visited
7b2e5ac
and which were missed.
7b2e5ac
7b2e5ac
Usage is simple - add package bisect_ppx when building tests, run your
7b2e5ac
tests, then run the Bisect_ppx report tool on the generated visitation
7b2e5ac
files.
7b2e5ac
7b2e5ac
%package        devel
7b2e5ac
Summary:        Development files for %{name}
7b2e5ac
Requires:       %{name}%{?_isa} = %{version}-%{release}
7b2e5ac
Requires:       ocaml-migrate-parsetree-devel%{?_isa}
7b2e5ac
Requires:       ocaml-ppx-derivers-devel%{?_isa}
7b2e5ac
Requires:       ocaml-ppx-tools-versioned-devel%{?_isa}
7b2e5ac
7b2e5ac
%description    devel
7b2e5ac
The %{name}-devel package contains libraries and signature files for
7b2e5ac
developing applications that use %{name}.
7b2e5ac
7b2e5ac
%prep
7b2e5ac
%autosetup -n %{upname}-%{gittag}
7b2e5ac
7b2e5ac
%build
63a9061
dune build %{?_smp_mflags}
7b2e5ac
7b2e5ac
# The dune rule for building documentation requires odoc.  However, odoc
7b2e5ac
# transitively depends on this package, so we build documentation manually.
7b2e5ac
mkdir html
7b2e5ac
ocamldoc -html -d html \
7b2e5ac
  -I _build/default/src/report/.report.eobjs/byte \
7b2e5ac
  -I +ppx_tools_versioned \
7b2e5ac
  _build/default/src/common/*.mli \
7b2e5ac
  _build/default/src/runtime/native/*.mli \
7b2e5ac
  _build/default/src/ppx/{exclude,exclusions,instrument}.mli \
7b2e5ac
  _build/default/src/report/*.mli
7b2e5ac
7b2e5ac
%install
7b2e5ac
dune install --destdir=%{buildroot}
7b2e5ac
7b2e5ac
# Install the man page
7b2e5ac
mkdir -p %{buildroot}%{_mandir}/man1
7b2e5ac
_build/install/default/bin/bisect-ppx-report --help groff > \
7b2e5ac
  %{buildroot}%{_mandir}/man1/bisect-ppx-report.1
7b2e5ac
7b2e5ac
# We install the documentation with the doc macro
7b2e5ac
rm -fr %{buildroot}%{_prefix}/doc
7b2e5ac
7b2e5ac
%ifarch %{ocaml_native_compiler}
7b2e5ac
# Add missing executable bits
7b2e5ac
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+
7b2e5ac
%endif
7b2e5ac
26dc712
%if %{with tests}
7b2e5ac
%check
7b2e5ac
make test
26dc712
%endif
7b2e5ac
7b2e5ac
%files
7b2e5ac
%doc doc/advanced.md doc/CHANGES README.md
7b2e5ac
%license LICENSE.md
7b2e5ac
%{_bindir}/bisect-ppx-report
7b2e5ac
%{_mandir}/man1/bisect-ppx-report.1*
7b2e5ac
%dir %{_libdir}/ocaml/%{upname}/
7b2e5ac
%dir %{_libdir}/ocaml/%{upname}/common/
7b2e5ac
%dir %{_libdir}/ocaml/%{upname}/runtime/
7b2e5ac
%{_libdir}/ocaml/%{upname}/META
7b2e5ac
%{_libdir}/ocaml/%{upname}/ppx.exe
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}.cma
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}*.cmi
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cma
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmi
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect.cma
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect*.cmi
7b2e5ac
%ifarch %{ocaml_native_compiler}
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}.cmxs
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmxs
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect.cmxs
7b2e5ac
%endif
7b2e5ac
7b2e5ac
%files devel
7b2e5ac
%doc html
7b2e5ac
%{_libdir}/ocaml/%{upname}/dune-package
7b2e5ac
%{_libdir}/ocaml/%{upname}/opam
7b2e5ac
%ifarch %{ocaml_native_compiler}
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}.a
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}*.cmx
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}.cmxa
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.a
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmx
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmxa
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect.a
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect*.cmx
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect.cmxa
7b2e5ac
%endif
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}*.cmt
7b2e5ac
%{_libdir}/ocaml/%{upname}/%{upname}*.cmti
7b2e5ac
%{_libdir}/ocaml/%{upname}/*.ml
7b2e5ac
%{_libdir}/ocaml/%{upname}/*.mli
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmt
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.cmti
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.ml
7b2e5ac
%{_libdir}/ocaml/%{upname}/common/bisect_common.mli
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect*.cmt
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/bisect*.cmti
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/*.ml
7b2e5ac
%{_libdir}/ocaml/%{upname}/runtime/*.mli
7b2e5ac
7b2e5ac
%changelog
14bdfb8
* Fri Feb 28 2020 Richard W.M. Jones <rjones@redhat.com> - 1.4.1-4.20200106.b2661bf.1
14bdfb8
- OCaml 4.10.0 final (Fedora 32).
14bdfb8
a80b62e
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 1.4.1-4.20200106.b2661bf
a80b62e
- OCaml 4.10.0 final.
26dc712
- Disable the tests to avoid circular dependency.
a80b62e
25609a2
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-3.20200106.b2661bf
25609a2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
25609a2
3c72cee
* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 1.4.1-2.20200106.b2661bf
3c72cee
- OCaml 4.10.0+beta1 rebuild.
3c72cee
7b2e5ac
* Wed Jan  8 2020 Jerry James <loganjerry@gmail.com> - 1.4.1-1.20200106.b2661bf
7b2e5ac
- Initial RPM