Name: ocaml-sha
Version: 1.12
Release: 13%{?dist}
Summary: Binding to the SHA cryptographic functions
License: ISC
URL: https://github.com/djs55/ocaml-sha/
Source0: https://github.com/djs55/ocaml-sha/archive/v%{version}/%{name}-%{version}.tar.gz
# All upstream patches since 1.12. In particular moves to dune.
Patch1: 0001-Inline-c.c-files-into-the-headers-declare-functions-.patch
Patch2: 0002-Port-to-dune.patch
Patch3: 0003-Fix-Windows-compilation.patch
Patch4: 0004-Update-to-dune-2-generate-OPAM-file.patch
Patch5: 0005-opam-fix-lint-by-filling-in-synopsis-and-description.patch
# Move to ounit2.
Patch6: ocaml-sha-1.12-ounit2.patch
BuildRequires: ocaml
BuildRequires: ocaml-dune
BuildRequires: opam-installer
BuildRequires: ocaml-findlib
BuildRequires: ocaml-ounit-devel
%description
A binding for SHA interface code in OCaml. Offering the same interface than
the MD5 digest included in the OCaml standard library.
It's currently providing SHA1, SHA256 and SHA512 hash functions.
%package devel
Summary: Development files for %{name}
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The %{name}-devel package contains libraries and signature
files for developing applications that use %{name}.
%prep
%autosetup -n %{name}-%{version} -p1
%build
dune build @install --profile release
%install
mkdir -p %{buildroot}%{_libdir}/ocaml
dune install --destdir=%{buildroot}
# These files will be installed using doc and license directives.
rm -r %{buildroot}%{_prefix}/doc
# Makes *.cmxs executable such that they will be stripped.
find %{buildroot} -name '*.cmxs' -exec chmod 0755 {} \;
%check
dune runtest --profile release
%files
%doc README CHANGES.md
%license LICENSE.md
%{_libdir}/ocaml/*
%ifarch %{ocaml_native_compiler}
%exclude %{_libdir}/ocaml/*/*.a
%exclude %{_libdir}/ocaml/*/*.cmxa
%exclude %{_libdir}/ocaml/*/*.cmx
%endif
%exclude %{_libdir}/ocaml/*/*.mli
%files devel
%doc README CHANGES.md
%license LICENSE.md
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/*/*.a
%{_libdir}/ocaml/*/*.cmxa
%{_libdir}/ocaml/*/*.cmx
%endif
%{_libdir}/ocaml/*/*.mli
%changelog
* Wed Apr 22 2020 Richard W.M. Jones <rjones@redhat.com> - 1.12-13
- OCaml 4.11.0 pre-release attempt 2
* Sat Apr 04 2020 Richard W.M. Jones <rjones@redhat.com> - 1.12-12
- Bump release and rebuild.
* Sat Apr 04 2020 Richard W.M. Jones <rjones@redhat.com> - 1.12-11
- Update all OCaml dependencies for RPM 4.16.
* Thu Feb 27 2020 Richard W.M. Jones <rjones@redhat.com> - 1.12-10
- OCaml 4.10.0 final.
- Include all upstream patches since 1.12 was released.
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Wed Dec 18 2019 Andy Li <andy@onthewings.net> - 1.12-7
- Rebuild against latest ocaml package.
* Fri Nov 01 2019 Andy Li <andy@onthewings.net> - 1.12-6
- Rebuild against latest ocaml package.
* Sat Jul 27 2019 Andy Li <andy@onthewings.net> - 1.12-5
- Update build system and commands from jbuilder to dune.
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Tue Mar 27 2018 Andy Li <andy@onthewings.net> - 1.12-1
- Initial RPM release.