Version 1.16.1, built with ocaml-zarith 1.11.

- New project and source URLs.
- Dune is now used to build.
- Add -doc subpackage.
This commit is contained in:
Jerry James 2020-11-16 17:55:10 -07:00
parent 6a9520deda
commit 77eeed0e10
3 changed files with 83 additions and 44 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ cryptokit-1.3.tar.gz
/cryptokit-1.6.tar.gz /cryptokit-1.6.tar.gz
/cryptokit-1.9.tar.gz /cryptokit-1.9.tar.gz
/cryptokit-1.11.tar.gz /cryptokit-1.11.tar.gz
/cryptokit-1.16.1.tar.gz

View File

@ -1,22 +1,21 @@
%global opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %global srcname cryptokit
Name: ocaml-cryptokit Name: ocaml-%{srcname}
Version: 1.11 Version: 1.16.1
Release: 30%{?dist} Release: 1%{?dist}
Summary: OCaml library of cryptographic and hash functions Summary: OCaml library of cryptographic and hash functions
License: LGPLv2 with exceptions License: LGPLv2 with exceptions
URL: http://forge.ocamlcore.org/projects/cryptokit/ %global upver %(tr -d . <<< %{version})
Source0: https://forge.ocamlcore.org/frs/download.php/1618/cryptokit-1.11.tar.gz
URL: https://github.com/xavierleroy/cryptokit/
Source0: %{url}/archive/release%{upver}/%{srcname}-%{version}.tar.gz
BuildRequires: ocaml BuildRequires: ocaml >= 4.03.0
BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-dune-devel >= 2.0
BuildRequires: ocaml-ocamlbuild BuildRequires: ocaml-odoc
BuildRequires: ocaml-zarith-devel BuildRequires: ocaml-zarith-devel >= 1.4
BuildRequires: ocaml-findlib-devel
BuildRequires: zlib-devel BuildRequires: zlib-devel
BuildRequires: chrpath
%description %description
@ -25,12 +24,13 @@ cryptographic primitives that can be used to implement cryptographic
protocols in security-sensitive applications. The primitives provided protocols in security-sensitive applications. The primitives provided
include: include:
* Symmetric-key cryptography: AES, DES, Triple-DES, ARCfour, in ECB, * Symmetric-key cryptography: AES, Chacha20, DES, Triple-DES, Blowfish,
CBC, CFB and OFB modes. ARCfour, in ECB, CBC, CFB OFB and counter modes.
* Public-key cryptography: RSA encryption and signature; Diffie-Hellman * Public-key cryptography: RSA encryption and signature; Diffie-Hellman
key agreement. key agreement.
* Hash functions and MACs: SHA-1, SHA-256, RIPEMD-160, MD5, and MACs * Hash functions and MACs: SHA-3, SHA-2, BLAKE2b, RIPEMD-160, and MACs
based on AES and DES. based on AES and DES. (SHA-1 and MD5, despite being broken, are also
provided for historical value.)
* Random number generation. * Random number generation.
* Encodings and compression: base 64, hexadecimal, Zlib compression. * Encodings and compression: base 64, hexadecimal, Zlib compression.
@ -44,7 +44,7 @@ transformations over character streams.
%package devel %package devel
Summary: Development files for %{name} Summary: Development files for %{name}
Requires: %{name} = %{version}-%{release} Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel %description devel
@ -52,55 +52,93 @@ The %{name}-devel package contains libraries and signature files for
developing applications that use %{name}. developing applications that use %{name}.
%package doc
Summary: Interface documentation for %{name}
BuildArch: noarch
%description doc
The %{name}-doc package contains interface documentation for
%{name}.
%prep %prep
%setup -q -n cryptokit-%{version} %autosetup -n %{srcname}-release%{upver}
%build %build
./configure --destdir $RPM_BUILD_ROOT # On x86 and x86_64, the configure script finds support for the -maes flag in
# Some sort of circular dependency, so sometimes the first make fails. # the compiler, and uses it to compile src/aesni.{c,h}. This is okay because
# Just run make twice. # use of the compiled code is conditional. The function aesni_check_available()
make ||: # is called first, which checks the CPUID to verify that the instructions exist
make # on the CPU. Therefore, older CPUs can still run the compiled code.
dune build %{?_smp_mflags} @install
dune build %{?_smp_mflags} @doc
chrpath --delete _build/src/dllcryptokit_stubs.so # Relink the stublibs with Fedora flags
cd _build/default/src
ocamlmklib -g -ldopt "%build_ldflags" -o cryptokit_stubs \
$(ar t libcryptokit_stubs.a)
cd -
%check %check
# This opens /dev/random but never reads from it. # This opens /dev/random but never reads from it.
make test dune runtest
%install %install
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/ocaml dune install --destdir=%{buildroot}
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/ocaml/stublibs
export DESTDIR=$RPM_BUILD_ROOT # We install the documentation with the doc macro
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT/%{_libdir}/ocaml rm -fr %{buildroot}%{_prefix}/doc
make install
# We do not want the ml files
find %{buildroot}%{_libdir}/ocaml -name \*.ml -delete
%ifarch %{ocaml_native_compiler}
# Add missing executable bits
find %{buildroot}%{_libdir}/ocaml -name \*.cmxs -exec chmod a+x {} \+
%endif
%files %files
%doc LICENSE.txt %license LICENSE
%{_libdir}/ocaml/cryptokit %dir %{_libdir}/ocaml/%{srcname}/
%if %opt %{_libdir}/ocaml/%{srcname}/*.cma
%exclude %{_libdir}/ocaml/cryptokit/*.a %{_libdir}/ocaml/%{srcname}/*.cmi
%exclude %{_libdir}/ocaml/cryptokit/*.cmxa %ifarch %{ocaml_native_compiler}
#%exclude %{_libdir}/ocaml/cryptokit/*.cmx %{_libdir}/ocaml/%{srcname}/*.cmxs
%endif %endif
%exclude %{_libdir}/ocaml/cryptokit/*.mli
%{_libdir}/ocaml/stublibs/*.so* %{_libdir}/ocaml/stublibs/*.so*
%files devel %files devel
%doc README.txt LICENSE.txt Changes %doc README.md Changes
%if %opt %{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/cryptokit/*.a %{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/cryptokit/*.cmxa %{_libdir}/ocaml/%{srcname}/opam
#%{_libdir}/ocaml/cryptokit/*.cmx %ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*.a
%{_libdir}/ocaml/%{srcname}/*.cmx
%{_libdir}/ocaml/%{srcname}/*.cmxa
%endif %endif
%{_libdir}/ocaml/cryptokit/*.mli %{_libdir}/ocaml/%{srcname}/*.cmt
%{_libdir}/ocaml/%{srcname}/*.cmti
%{_libdir}/ocaml/%{srcname}/*.mli
%files doc
%doc _build/default/_doc/*
%changelog %changelog
* Mon Nov 16 2020 Jerry James <loganjerry@gmail.com> - 1.16.1-1
- Version 1.16.1, built with ocaml-zarith 1.11
- New project and source URLs
- Dune is now used to build
- Add -doc subpackage
* Fri Sep 25 2020 Jerry James <loganjerry@gmail.com> - 1.11-30 * Fri Sep 25 2020 Jerry James <loganjerry@gmail.com> - 1.11-30
- Rebuild for ocaml-zarith 1.10 - Rebuild for ocaml-zarith 1.10

View File

@ -1 +1 @@
931f8240ad30d9930d0f584f2921de69 cryptokit-1.11.tar.gz SHA512 (cryptokit-1.16.1.tar.gz) = 28913a7c35ae951a4c464287acc511ee1bdc9d03b5928e2243c5ae5cbb8b10afe8e84d7a73ba6478ed62657d01fdb6f02472739255c33de3671c4130b659da52