Blob Blame History Raw
%global debug_package %{nil}

Name:           ocamlmod
Version:        0.0.9
Release:        5%{?dist}
Summary:        Generate OCaml modules from source files

License:        LGPLv2+ with exceptions
URL:            https://forge.ocamlcore.org/projects/ocamlmod/
Source0:        https://github.com/gildor478/ocamlmod/archive/%{version}/%{name}-%{version}.tar.gz

# Use a setup.ml generated by `oasis setup`,
# such that the package doesn't depend on oasis,
# to avoid circular dependency.
# Also set CompiledObject to "best" (RHBZ#1600596).
Patch0:         ocamlmod-setupml.patch

BuildRequires:  ocaml
BuildRequires:  ocaml-ocamlbuild
BuildRequires:  ocaml-findlib
BuildRequires:  ocaml-ounit
BuildRequires:  help2man

%description
ocamlmod allows to create OCaml modules from source files.


%prep
%setup -q -n %{name}-%{version}
%patch0 -p1


%build
ocaml setup.ml -configure \
    --destdir $RPM_BUILD_ROOT \
    --prefix %{_prefix} \
    --enable-tests
ocaml setup.ml -build


%install
ocaml setup.ml -install

# generate manpage
mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1/
help2man $RPM_BUILD_ROOT%{_bindir}/ocamlmod \
    --output $RPM_BUILD_ROOT%{_mandir}/man1/ocamlmod.1 \
    --name "Generate OCaml modules from source files" \
    --version-string %{version} \
    --no-info

%check
ocaml setup.ml -test

# check that ocamlmod is compiled as native executable if possible
%ifarch %{ocaml_native_compiler}
file $RPM_BUILD_ROOT%{_bindir}/ocamlmod | grep -vq "script executable"
%endif

%files
%doc README.txt
%{_bindir}/ocamlmod
%{_mandir}/man1/ocamlmod.1*


%changelog
* Mon Apr 29 2019 Richard W.M. Jones <rjones@redhat.com> - 0.0.9-5
- OCaml 4.08.0 (beta 3) rebuild.

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Fri Jul 13 2018 Andy Li <andy@onthewings.net> - 0.0.9-3
- Update ocamlmod-setupml.patch with _oasis CompiledObject set to "best" (RHBZ#1600596).

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.9-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Fri Nov 10 2017 Andy Li <andy@onthewings.net> - 0.0.9-1
- Initial RPM release.