ocaml-alcotest/ocaml-alcotest.spec

116 lines
3.7 KiB
RPMSpec
Raw Normal View History

2020-01-14 15:03:35 +00:00
# BOOTSTRAP NOTE: We currently build only the base alcotest package. We cannot
# yet build the async and lwt subpackages, because of missing dependencies.
# Some of those dependencies require the base alcotest package, either directly
# or indirectly. Therefore, we will only be able to build the other two in
# non-bootstrap mode.
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname alcotest
Name: ocaml-%{srcname}
2020-01-14 19:19:00 +00:00
Version: 1.0.0
2020-01-19 21:12:35 +00:00
Release: 2%{?dist}
2020-01-14 15:03:35 +00:00
Summary: Lightweight and colorful test framework for OCaml
License: ISC
URL: https://github.com/mirage/alcotest
Source0: %{url}/releases/download/%{version}/%{srcname}-%{version}.tbz
2020-01-14 19:19:00 +00:00
# We neither need nor want the stdlib-shims package in Fedora. It is a forward
# compatibility package for older OCaml installations. Patch it out instead.
# Upstream does not want this patch until stdlib-shims is obsolete.
Patch0: %{name}-stdlib-shims.patch
2020-01-14 15:03:35 +00:00
2020-01-14 19:19:00 +00:00
BuildRequires: ocaml >= 4.03.0
2020-01-14 15:03:35 +00:00
BuildRequires: ocaml-astring-devel
BuildRequires: ocaml-cmdliner-devel
BuildRequires: ocaml-dune >= 1.1.0
BuildRequires: ocaml-findlib
BuildRequires: ocaml-fmt-devel >= 0.8.0
2020-01-14 19:19:00 +00:00
BuildRequires: ocaml-re-devel
2020-01-14 15:03:35 +00:00
BuildRequires: ocaml-uuidm-devel
%description
Alcotest is a lightweight and colorful test framework.
Alcotest exposes a simple interface to perform unit tests, including a
simple `TESTABLE` module type, a `check` function to assert test
predicates, and a `run` function to perform a list of `unit -> unit`
test callbacks.
Alcotest provides quiet and colorful output where only faulty runs are
fully displayed at the end of the run (with the full logs ready to
inspect), with a simple (yet expressive) query language to select the
tests to run.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
Requires: ocaml-cmdliner-devel%{?_isa}
Requires: ocaml-fmt-devel%{?_isa}
2020-01-14 19:19:00 +00:00
Requires: ocaml-re-devel%{?_isa}
2020-01-14 15:03:35 +00:00
%description devel
The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}.
%prep
2020-01-14 19:19:00 +00:00
%autosetup -n %{srcname}-%{version} -p1
2020-01-14 15:03:35 +00:00
%build
# For non-bootstrap builds, omit the "-p alcotest", and also run:
2020-01-16 18:35:17 +00:00
# dune build %{?_smp_mflags} @doc
2020-01-14 15:03:35 +00:00
# to generate the documentation.
2020-01-16 18:35:17 +00:00
dune build %{?_smp_mflags} -p alcotest
2020-01-14 15:03:35 +00:00
%install
# For non-bootstrap builds, omit the "alcotest" on the end.
dune install --destdir=%{buildroot} alcotest
# We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc
%ifarch %{ocaml_native_compiler}
# Add missing executable bits
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+
%endif
%check
dune runtest -p alcotest
%files
%doc CHANGES.md README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/%{srcname}/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cma
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxs
%endif
%files devel
%{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/%{srcname}*.a
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmx
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmt
%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmti
2020-01-14 19:19:00 +00:00
%{_libdir}/ocaml/%{srcname}/*.ml
%{_libdir}/ocaml/%{srcname}/*.mli
2020-01-14 15:03:35 +00:00
%changelog
2020-01-19 21:12:35 +00:00
* Sun Jan 19 2020 Richard W.M. Jones <rjones@redhat.com> - 1.0.0-2
- OCaml 4.10.0+beta1 rebuild.
2020-01-14 19:19:00 +00:00
* Tue Jan 14 2020 Jerry James <loganjerry@gmail.com> - 1.0.0-1
- Version 1.0.0
2020-01-14 15:03:35 +00:00
* Thu Jan 9 2020 Jerry James <loganjerry@gmail.com> - 0.8.5-1
- Initial RPM