Sophie

Sophie

distrib > Mageia > 9 > armv7hl > media > core-release-src > by-pkgid > cf7374d6837c34afc886e4e36ca7d972 > files > 1

ocaml-odoc-parser-2.0.0-1.mga9.src.rpm

%undefine _package_note_flags
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif

%global srcname odoc-parser

# Break a circular dependency by not building documentation
%bcond_with doc

Name:           ocaml-%{srcname}
Version:        2.0.0
Release:        %mkrel 1
Summary:        Parser for OCaml documentation comments
Group:          Development/OCaml

License:        ISC
URL:            https://ocaml-doc.github.io/odoc-parser/
Source0:        https://github.com/ocaml-doc/%{srcname}/releases/download/%{version}/%{srcname}-%{version}.tbz

BuildRequires:  ocaml >= 4.02.0
BuildRequires:  ocaml-astring-devel
BuildRequires:  ocaml-dune >= 2.8
BuildRequires:  ocaml-ppx_expect-devel
BuildRequires:  ocaml-camlp-streams-devel
BuildRequires:  ocaml-result-devel
BuildRequires:  ocaml-sexplib0-devel

%if %{with doc}
BuildRequires:  ocaml-odoc
%endif

%description
Odoc-parser is a parser for odoc markup, which is an extension of the
original markup language parsed by ocamldoc.

OCaml code can contain specially formatted comments that are used to
document the interfaces of modules.  These comments are delimited by
`(**` and `*)`.  This parser is intended to be used to parse the
contents of these comments.

%package        devel
Summary:        Development files for %{name}
Requires:       %{name}%{?_isa} = %{version}-%{release}
Requires:       ocaml-astring-devel%{?_isa}
Requires:       ocaml-result-devel%{?_isa}

%description    devel
The %{name}-devel package contains libraries and signature
files for developing applications that use %{name}.

%prep
%autosetup -n %{srcname}-%{version} -p1

%build
dune build %{?_smp_mflags} --release @install

%if %{with doc}
dune build %{?_smp_mflags} @doc
cd _build/default/doc
odoc html -o . -I . odoc_parser.odoc
odoc html -o . -I . page-index.odoc
odoc html -o . -I . page-contributing.odoc
odoc support-files -o odoc-parser
cd -
%endif

%install
dune install --destdir=%{buildroot}

%if %{with doc}
# We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete
%endif

# We do not want the ml files
find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete

# We install the documentation with the doc macro
rm -fr %{buildroot}%{_prefix}/doc

%check
dune runtest --release

%files
%doc CHANGES.md README.md
%license LICENSE.md
%dir %{_libdir}/ocaml/%{srcname}/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/*.cma
%{_libdir}/ocaml/%{srcname}/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*.cmxs
%endif

%files         devel
%if %{with doc}
%doc _build/default/_doc/*
%endif
%{_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}/*.mli


%changelog
* Mon Oct 10 2022 pterjan <pterjan> 2.0.0-1.mga9
+ Revision: 1896141
- Add missing BuildRequires
- Update to 2.0.0

* Fri May 20 2022 pterjan <pterjan> 1.0.0-1.mga9
+ Revision: 1859493
- imported package ocaml-odoc-parser