Initial import.

This commit is contained in:
Jerry James 2020-01-08 09:12:17 -07:00
parent 73fb99e605
commit c2c60b15a3
4 changed files with 135 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/base-*.tar.gz

11
ocaml-base.rpmlintrc Normal file
View File

@ -0,0 +1,11 @@
# 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 .* performant')
# Documentation is in the main package
addFilter(r'ocaml-base-devel\.[^:]+: W: no-documentation')
# The stub library does not need any C library symbols
addFilter(r'E: shared-lib-without-dependency-information .*stubs\.so')

122
ocaml-base.spec Normal file
View File

@ -0,0 +1,122 @@
# TESTING NOTE: The ppx_jane module is needed to run the tests. However,
# ppx_jane transitively requires this module. Therefore, we cannot run the
# tests at all until we are able to add ppx_jane to Fedora, and even then we
# will only be able to run the tests in non-bootstrap mode.
%ifnarch %{ocaml_native_compiler}
%global debug_package %{nil}
%endif
%global srcname base
Name: ocaml-%{srcname}
Version: 0.13.0
Release: 1%{?dist}
Summary: Jane Street standard library for OCaml
License: MIT
URL: https://github.com/janestreet/%{srcname}
Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz
BuildRequires: ocaml >= 4.04.2
BuildRequires: ocaml-dune-devel >= 1.5.1
BuildRequires: ocaml-findlib
BuildRequires: ocaml-sexplib0-devel >= 0.13
%description
Base is a standard library for OCaml. It provides a standard set of
general purpose modules that are well-tested, performant, and
fully-portable across any environment that can run OCaml code. Unlike
other standard library projects, Base is meant to be used as a wholesale
replacement of the standard library distributed with the OCaml compiler.
In particular it makes different choices and doesn't re-export features
that are not fully portable such as I/O, which are left to other
libraries.
%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 %{srcname}-%{version}
%build
dune build
# TODO: Once odoc is available, BR it and run this to generate documentation:
# dune build @doc
# Dune passes RPM_LD_FLAGS to ocamlmklib without -ldopt, resulting in "Unknown
# option" warnings from ocamlmklib and a library that has not been linked with
# the correct flags. We can't add -ldopt ourselves, since that breaks
# compilation of the cmxs files. This seems to be a weakness of dune; linker
# flags and libraries to be linked with have to be specified together, and
# nothing takes care of separating them and adding ldopt as necessary. We
# relink manually to address the problem.
pushd _build/default/src
ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o base_stubs *.o
cd ../hash_types/src
ocamlmklib -g -ldopt "$RPM_LD_FLAGS" -o base_internalhash_types_stubs *.o
popd
%install
dune install --destdir=%{buildroot}
# 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
%files
%doc CHANGES.md CONTRIBUTING.md README.org ROADMAP.md
%license LICENSE.md
%dir %{_libdir}/ocaml/%{srcname}/
%dir %{_libdir}/ocaml/%{srcname}/base_internalhash_types/
%dir %{_libdir}/ocaml/%{srcname}/caml/
%dir %{_libdir}/ocaml/%{srcname}/md5/
%dir %{_libdir}/ocaml/%{srcname}/shadow_stdlib/
%{_libdir}/ocaml/%{srcname}/META
%{_libdir}/ocaml/%{srcname}/*.cma
%{_libdir}/ocaml/%{srcname}/*.cmi
%{_libdir}/ocaml/%{srcname}/*.js
%{_libdir}/ocaml/%{srcname}/*/*.cma
%{_libdir}/ocaml/%{srcname}/*/*.cmi
%{_libdir}/ocaml/%{srcname}/*/*.js
%ifarch %{ocaml_native_compiler}
%{_libdir}/ocaml/%{srcname}/*.cmxs
%{_libdir}/ocaml/%{srcname}/*/*.cmxs
%endif
%{_libdir}/ocaml/stublibs/dllbase_stubs.so
%{_libdir}/ocaml/stublibs/dllbase_internalhash_types_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
%{_libdir}/ocaml/%{srcname}/*/*.a
%{_libdir}/ocaml/%{srcname}/*/*.cmx
%{_libdir}/ocaml/%{srcname}/*/*.cmxa
%endif
%{_libdir}/ocaml/%{srcname}/*.cmt
%{_libdir}/ocaml/%{srcname}/*.cmti
%{_libdir}/ocaml/%{srcname}/*.ml
%{_libdir}/ocaml/%{srcname}/*.mli
%{_libdir}/ocaml/%{srcname}/*/*.cmt
%{_libdir}/ocaml/%{srcname}/*/*.cmti
%{_libdir}/ocaml/%{srcname}/*/*.h
%{_libdir}/ocaml/%{srcname}/*/*.ml
%{_libdir}/ocaml/%{srcname}/*/*.mli
%changelog
* Thu Jan 2 2020 Jerry James <loganjerry@gmail.com> - 0.13.0-1
- Initial RPM

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (base-0.13.0.tar.gz) = f753057ed5bda069c5ab535ad98e7277c8326923000dc9f164602973861fb00340d1976d48777f193bc8c0d5bd56a6c47d5b760d4833244047bff1304083e4e8