Blob Blame History Raw
# This package doesn't seem to want to make debuginfo either. :(
%global debug_package %{nil}

Name:           ocaml-opam-file-format
Version:        2.0.0
Release:        3%{?dist}
Summary:        Parser and printer for the opam file syntax

%global libname %(echo %{name} | sed -e 's/^ocaml-//')

# This is apparently a standard "OCaml exception" and is detailed
# in the license file. That wasn't included in the repo, but I filed
# a ticket (https://github.com/ocaml/opam-file-format/issues/5)
# and now it is, so I've added the commit that added license as a patch.
License:        LGPLv2 with exceptions
URL:            https://github.com/ocaml/opam-file-format/
Source0:        https://github.com/ocaml/%{libname}/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  ocaml

%description
Parser and printer for the opam file syntax.

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

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

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

# Generate debuginfo, or try to.
sed 's/ocamlc/ocamlc -g/g' -i src/Makefile
sed 's/ocamlopt/ocamlopt -g/g' -i src/Makefile

%build
make byte %{?_smp_mflags}
%ifarch %{ocaml_native_compiler}
make native %{?_smp_mflags}
%endif

%install
make install LIBDIR=%{_libdir}/ocaml DESTDIR=%{buildroot}

# The mli files don't seem to get installed by the makefile.
# This is suboptimal.
cp -a src/*.mli %{buildroot}%{_libdir}/ocaml/%{libname}/

%files
# There is no documentation.
%license LICENSE
%{_libdir}/ocaml/%{libname}
%ifarch %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/%{libname}/*.a
%exclude %{_libdir}/ocaml/%{libname}/*.cmxa
%exclude %{_libdir}/ocaml/%{libname}/*.cmx
%endif
%exclude %{_libdir}/ocaml/%{libname}/*.mli

%files devel
%license LICENSE
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{libname}/*.a
%{_libdir}/ocaml/%{libname}/*.cmxa
%{_libdir}/ocaml/%{libname}/*.cmx
%endif
%{_libdir}/ocaml/*/*.mli

%changelog
* Wed Jul 31 2019 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-3
- OCaml 4.08.1 (rc2) rebuild.

* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Thu Jul 18 2019 Ben Rosser <rosser.bjr@gmail.com> - 2.0.0-1
- Updated to latest upstream release (rhbz#1720584).

* Thu Jun 27 2019 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.11.beta3
- OCaml 4.08.0 (final) rebuild.

* Mon Apr 29 2019 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.10.beta3
- OCaml 4.08.0 (beta 3) rebuild.

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

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-0.8.beta3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Jul 11 2018 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.7.beta3
- OCaml 4.07.0 (final) rebuild.

* Wed Jun 20 2018 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.6.beta3
- OCaml 4.07.0-rc1 rebuild.

* Thu Apr 26 2018 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.5.beta3
- OCaml 4.07.0-beta2 rebuild.

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

* Sat Dec 02 2017 Richard W.M. Jones <rjones@redhat.com> - 2.0.0-0.3.beta3
- OCaml 4.06.0 rebuild.

* Tue Aug 15 2017 Ben Rosser <rosser.bjr@gmail.com> 2.0.0-0.2.beta3
- Modernize ocaml packaging, use macro for testing native compiler.
- Remove manual invocation of ocaml dependency generator.
- Add -g to ocamlc, ocamlopt invocations, but this still doesn't make debuginfo.
- Use global instead of define for libname macro.

* Tue Aug  1 2017 Ben Rosser <rosser.bjr@gmail.com> 2.0.0-0.1.beta3
- Initial package.