Blame ocaml-odoc.spec

c147e33
%ifnarch %{ocaml_native_compiler}
c147e33
%global debug_package %{nil}
c147e33
%endif
c147e33
c147e33
%global srcname odoc
c147e33
c147e33
Name:           ocaml-%{srcname}
267f0f5
Version:        1.5.0
6e882c3
Release:        2%{?dist}.1
c147e33
Summary:        Documentation compiler for OCaml and Reason
c147e33
c147e33
License:        MIT
c147e33
URL:            https://github.com/ocaml/odoc
c147e33
Source0:        %{url}/archive/%{version}/%{srcname}-%{version}.tar.gz
c147e33
c147e33
BuildRequires:  ocaml >= 4.02.0
c147e33
BuildRequires:  ocaml-alcotest-devel >= 0.8.3
c147e33
BuildRequires:  ocaml-astring-devel
c147e33
BuildRequires:  ocaml-bisect-ppx-devel >= 1.3.0
267f0f5
BuildRequires:  ocaml-cmdliner-devel
c147e33
BuildRequires:  ocaml-cppo
c147e33
BuildRequires:  ocaml-dune
c147e33
BuildRequires:  ocaml-findlib
c147e33
BuildRequires:  ocaml-fpath-devel
c147e33
BuildRequires:  ocaml-markup-devel >= 0.8.0
c147e33
BuildRequires:  ocaml-result-devel
c147e33
BuildRequires:  ocaml-sexplib-devel
c147e33
BuildRequires:  ocaml-tyxml-devel >= 4.3.0
c147e33
BuildRequires:  ocaml-uuidm-devel
c147e33
BuildRequires:  tidy
c147e33
c147e33
%description
c147e33
This package contains odoc, a documentation generator for OCaml.  It
c147e33
reads doc comments, delimited with `(** ... *)`, and outputs HTML.  Text
c147e33
inside doc comments is marked up in ocamldoc syntax.
c147e33
c147e33
Odoc's main advantage over ocamldoc is an accurate cross-referencer,
c147e33
which handles the complexity of the OCaml module system.  Odoc also
c147e33
offers a good opportunity to improve HTML output compared to ocamldoc,
c147e33
but this is very much a work in progress.
c147e33
c147e33
%package        devel
c147e33
Summary:        Development files for %{name}
c147e33
Requires:       %{name}%{?_isa} = %{version}-%{release}
9cf2e7f
Requires:       ocaml-astring-devel%{?_isa}
9cf2e7f
Requires:       ocaml-fpath-devel%{?_isa}
c147e33
Requires:       ocaml-result-devel%{?_isa}
c147e33
Requires:       ocaml-tyxml-devel%{?_isa}
c147e33
c147e33
%description    devel
c147e33
The %{name}-devel package contains libraries and signature files for
c147e33
developing applications that use %{name}.
c147e33
c147e33
%package        doc
c147e33
Summary:        Documentation for %{name}
c147e33
BuildArch:      noarch
c147e33
c147e33
%description    doc
c147e33
Documentation for %{name}.
c147e33
c147e33
%prep
18240f7
%autosetup -n %{srcname}-%{version} -p1
c147e33
c147e33
# The opam file has not been updated since the great renumbering.
c147e33
sed -i 's/113\.33\.00/0.13.0/' odoc.opam
c147e33
9b31be6
# Replace version markers
9b31be6
for fil in src/html/tree.ml $(find test -name index.html -o -name mld.html); do
9b31be6
  sed -i.orig 's,%%%%VERSION%%%%,%{version},' $fil
9b31be6
  touch -r $fil.orig $fil
9b31be6
  rm $fil.orig
9b31be6
done
9b31be6
c147e33
%build
9cf2e7f
dune build %{?_smp_mflags}
9cf2e7f
dune build %{?_smp_mflags} @doc
c147e33
c147e33
%install
c147e33
dune install --destdir=%{buildroot}
c147e33
c147e33
# We do not want the test files
c147e33
rm -fr %{buildroot}%{_libdir}/ocaml/dune_odoc_test
c147e33
c147e33
# We do not want the dune markers
c147e33
find _build/default/_doc/_html -name .dune-keep -delete
c147e33
c147e33
# We install the documentation with the doc macro
c147e33
rm -fr %{buildroot}%{_prefix}/doc
c147e33
c147e33
%ifarch %{ocaml_native_compiler}
c147e33
# Add missing executable bits
c147e33
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod 0755 {} \+
c147e33
%endif
c147e33
c147e33
# Install the man page
c147e33
mkdir -p %{buildroot}%{_mandir}/man1
c147e33
_build/install/default/bin/odoc --help groff > %{buildroot}%{_mandir}/man1/odoc.1
c147e33
c147e33
%check
c147e33
dune runtest
c147e33
c147e33
%files
c147e33
%doc CHANGES.md README.md
c147e33
%license LICENSE.md
c147e33
%{_bindir}/odoc
c147e33
%{_datadir}/odoc/
c147e33
%{_mandir}/man1/odoc.1*
c147e33
%dir %{_libdir}/ocaml/%{srcname}/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/compat/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/html/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/loader/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/model/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/odoc/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/parser/
c147e33
%dir %{_libdir}/ocaml/%{srcname}/xref/
c147e33
%{_libdir}/ocaml/%{srcname}/META
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cma
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmi
c147e33
%ifarch %{ocaml_native_compiler}
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmxs
c147e33
%endif
c147e33
c147e33
%files devel
c147e33
%{_libdir}/ocaml/%{srcname}/dune-package
c147e33
%{_libdir}/ocaml/%{srcname}/opam
c147e33
%ifarch %{ocaml_native_compiler}
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.a
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmx
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmxa
c147e33
%endif
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmt
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.cmti
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.ml
c147e33
%{_libdir}/ocaml/%{srcname}/*/*.mli
c147e33
c147e33
%files doc
c147e33
%doc _build/default/_doc/_html/*
c147e33
%license LICENSE.md
c147e33
c147e33
%changelog
6e882c3
* Fri Feb 28 2020 Richard W.M. Jones <rjones@redhat.com> - 1.5.0-2.1
6e882c3
- OCaml 4.10.0 final (Fedora 32).
6e882c3
894ace4
* Wed Feb 26 2020 Richard W.M. Jones <rjones@redhat.com> - 1.5.0-2
894ace4
- OCaml 4.10.0 final.
894ace4
267f0f5
* Fri Feb  7 2020 Jerry James <loganjerry@gmail.com> - 1.5.0-1
267f0f5
- Version 1.5.0
267f0f5
- Drop all patches
267f0f5
18240f7
* Sat Feb  1 2020 Jerry James <loganjerry@gmail.com> - 1.4.2-3
18240f7
- Add 3 patches for OCaml 4.10 compatibility
18240f7
6c70770
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.2-3
6c70770
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
6c70770
9cf2e7f
* Thu Jan 16 2020 Jerry James <loganjerry@gmail.com> - 1.4.2-2
9cf2e7f
- Remove some BRs needed only for transitive dependencies
9cf2e7f
- Add ocaml-astring-devel and ocaml-fpath-devel Rs to -devel
9cf2e7f
- Build in parallel
9cf2e7f
c147e33
* Fri Jan 10 2020 Jerry James <loganjerry@gmail.com> - 1.4.2-1
c147e33
- Initial RPM