Blob Blame History Raw
%ifarch %{ocaml_native_compiler}
# The only source file for this package consists of a single "include" line.
# It exports some private functions from the library in ocaml-base.  Although
# debuginfo is generated, it is tagged with the file names from ocaml-base,
# rather than the single 1-line source file in this project.  That leads to
# this error:
# error: Empty %%files file /builddir/build/BUILD/fieldslib-0.13.0/debugsourcefiles.list
# Do not try to gather debug sources to workaround the problem.
%undefine _debugsource_packages
%global debug_package %{nil}

%global srcname fieldslib

Name:           ocaml-%{srcname}
Version:        0.13.0
Release:        2%{?dist}
Summary:        OCaml record fields as first class values

License:        MIT
URL:  {srcname}
Source0:        %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz

BuildRequires:  ocaml >= 4.04.2
BuildRequires:  (ocaml-base-devel >= 0.13 and ocaml-base-devel < 0.14)
BuildRequires:  ocaml-dune >= 1.5.1
BuildRequires:  ocaml-odoc

This package contains an OCaml syntax extension to define first class
values representing record fields, to get and set record fields, iterate
and fold over all fields of a record and create new record values.

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

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

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

dune build %{?_smp_mflags}
dune build %{?_smp_mflags} @doc

dune install --destdir=%{buildroot}

# We do not want the dune markers
find _build/default/_doc/_html -name .dune-keep -delete

# 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

%ifarch %{ocaml_native_compiler}
# Add missing executable bits
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+

%dir %{_libdir}/ocaml/%{srcname}/
%ifarch %{ocaml_native_compiler}

%files devel
%doc _build/default/_doc/_html/*
%ifarch %{ocaml_native_compiler}

* Fri Jun  5 2020 Jerry James <> - 0.13.0-2
- Drop
- Use boolean dependencies to more fully reflect upstream version dependencies

* Thu May  7 2020 Jerry James <> - 0.13.0-1
- Initial RPM