Initial import.

This commit is contained in:
Jerry James 2020-02-13 08:14:48 -07:00
parent 16ca2e2b50
commit 989ad25225
4 changed files with 122 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/stdint-*.tbz

8
ocaml-stdint.rpmlintrc Normal file
View File

@ -0,0 +1,8 @@
# THIS FILE IS FOR WHITELISTING RPMLINT ERRORS AND WARNINGS IN TASKOTRON
# https://fedoraproject.org/wiki/Taskotron/Tasks/dist.rpmlint#Whitelisting_errors
# The dictionary is missing some technical terms
addFilter(r'W: spelling-error .* (endian|nativeint)')
# Documentation is in the -doc subpackage
addFilter(r'ocaml-stdint-devel\.[^:]+: W: no-documentation')

112
ocaml-stdint.spec Normal file
View File

@ -0,0 +1,112 @@
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname stdint
Name: ocaml-%{srcname}
Version: 0.6.0
Release: 1%{?dist}
Summary: Various signed and unsigned integers for OCaml
License: MIT
URL: https://github.com/andrenth/%{name}
Source0: %{url}/releases/download/%{version}/%{srcname}-%{version}.tbz
BuildRequires: ocaml >= 4.07
BuildRequires: ocaml-dune >= 1.11
BuildRequires: ocaml-odoc
%description
The stdint library provides signed and unsigned integer types of various
fixed widths: 8, 16, 24, 32, 40, 48, 56, 64 and 128 bits.
This interface is similar to Int32 and Int64 from the base library but
provides more functions and constants like arithmetic and bit-wise
operations, constants like maximum and minimum values, infix operators
converting to and from every other integer type (including int, float and
nativeint), parsing from and conversion to readable strings (binary,
octal, decimal, hexadecimal), and conversion to and from buffers in both
big endian and little endian byte order.
%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}.
%package doc
Summary: Documentation for %{name}
BuildArch: noarch
%description doc
Documentation for %{name}.
%prep
%autosetup -n %{srcname}-%{version}
%build
dune build %{?_smp_mflags}
dune build %{?_smp_mflags} @doc
# Relink the stublib with RPM_LD_FLAGS
cd _build/default/lib
ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o stdint_stubs $(ar t libstdint_stubs.a)
cd -
%install
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 {} \+
%endif
%check
dune runtest
%files
%doc CHANGES.md README.md
%license LICENSE
%dir %{_libdir}/ocaml/%{srcname}/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/*.cma
%{_libdir}/ocaml/%{srcname}/*.cmi
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*.cmxs
%endif
%{_libdir}/ocaml/stublibs/dllstdint_stubs.so
%files devel
%{_libdir}/ocaml/%{srcname}/dune-package
%{_libdir}/ocaml/%{srcname}/opam
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*.a
%{_libdir}/ocaml/%{srcname}/*.cmx
%{_libdir}/ocaml/%{srcname}/*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/*.cmt
%{_libdir}/ocaml/%{srcname}/*.cmti
%{_libdir}/ocaml/%{srcname}/*.mli
%{_libdir}/ocaml/%{srcname}/*.h
%files doc
%doc _build/default/_doc/_html/
%doc _build/default/_doc/_mlds/
%doc _build/default/_doc/_odoc/
%license LICENSE
%changelog
* Thu Feb 6 2020 Jerry James <loganjerry@gmail.com> - 0.6.0-1
- Initial RPM

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (stdint-0.6.0.tbz) = 00d1f864d0f353c4922c4c743df209893e3558a7cee9a1e7e51be5da691657ad5f1d22acf8bee583573c08166f8b2705632fd955e100dd0dea8be4e9d2fbcc48