Use new OCaml macros.

Add temporary workaround for a failing test.
This commit is contained in:
Jerry James 2022-07-20 19:50:37 -06:00
parent b46d556ee4
commit 77bd7b49c5

View File

@ -4,18 +4,16 @@
%global debug_package %{nil}
%endif
%global srcname odoc
Name: ocaml-%{srcname}
Name: ocaml-odoc
Version: 2.1.0
Release: 2%{?dist}
Summary: Documentation compiler for OCaml and Reason
License: ISC
URL: https://github.com/ocaml/odoc
Source0: %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
Source0: %{url}/archive/%{version}/odoc-%{version}.tar.gz
BuildRequires: jq-devel
BuildRequires: jq
BuildRequires: ocaml >= 4.02.0
BuildRequires: ocaml-astring-devel
BuildRequires: ocaml-bisect-ppx-devel > 2.5.0
@ -65,72 +63,40 @@ BuildArch: noarch
Documentation for %{name}.
%prep
%autosetup -n %{srcname}-%{version} -p1
%autosetup -n odoc-%{version} -p1
# Temporary workaround for failing test. Remove this on next version upgrade.
sed -i '/Dune_odoc_test__/d' test/integration/simple_dune_project.t/run.t
%build
dune build %{?_smp_mflags} --verbose --release
dune build %{?_smp_mflags} --release @doc
%dune_build @default @doc
%install
dune install --destdir=%{buildroot}
# We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete
# We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc
%dune_install
# Install the man page
mkdir -p %{buildroot}%{_mandir}/man1
_build/install/default/bin/odoc --help groff > %{buildroot}%{_mandir}/man1/odoc.1
%check
dune runtest --release
%dune_check
%files
%files -f .ofiles
%doc CHANGES.md README.md
%license LICENSE.md
%{_bindir}/odoc
%{_datadir}/odoc/
%{_mandir}/man1/odoc.1*
%dir %{_libdir}/ocaml/%{srcname}/
%dir %{_libdir}/ocaml/%{srcname}/document/
%dir %{_libdir}/ocaml/%{srcname}/examples/
%dir %{_libdir}/ocaml/%{srcname}/html/
%dir %{_libdir}/ocaml/%{srcname}/latex/
%dir %{_libdir}/ocaml/%{srcname}/loader/
%dir %{_libdir}/ocaml/%{srcname}/manpage/
%dir %{_libdir}/ocaml/%{srcname}/model/
%dir %{_libdir}/ocaml/%{srcname}/model_desc/
%dir %{_libdir}/ocaml/%{srcname}/ocamlary/
%dir %{_libdir}/ocaml/%{srcname}/odoc/
%dir %{_libdir}/ocaml/%{srcname}/xref2/
%dir %{_libdir}/ocaml/%{srcname}/xref_test/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/*/*.cma
%{_libdir}/ocaml/%{srcname}/*/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*/*.cmxs
%endif
%files devel
%{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*/*.a
%{_libdir}/ocaml/%{srcname}/*/*.cmx
%{_libdir}/ocaml/%{srcname}/*/*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/*/*.cmt
%{_libdir}/ocaml/%{srcname}/*/*.cmti
%{_libdir}/ocaml/%{srcname}/*/*.ml
%{_libdir}/ocaml/%{srcname}/*/*.mli
%files devel -f .ofiles-devel
%files doc
%doc _build/default/_doc/_html/*
%license LICENSE.md
%changelog
* Thu Jul 21 2022 Jerry James <loganjerry@gmail.com> - 2.1.0-2
- Use new OCaml macros
- Add temporary workaround for a failing test
* Sun Jun 19 2022 Richard W.M. Jones <rjones@redhat.com> - 2.1.0-2
- OCaml 4.14.0 rebuild