diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a2bc9c5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/astring-*.tar.gz diff --git a/ocaml-astring.rpmlintrc b/ocaml-astring.rpmlintrc new file mode 100644 index 0000000..79f0f00 --- /dev/null +++ b/ocaml-astring.rpmlintrc @@ -0,0 +1,5 @@ +# 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 .* (minimality|newfound|substrings)') diff --git a/ocaml-astring.spec b/ocaml-astring.spec new file mode 100644 index 0000000..f971308 --- /dev/null +++ b/ocaml-astring.spec @@ -0,0 +1,106 @@ +%ifnarch %{ocaml_native_compiler} +%global debug_package %{nil} +%endif + +%global srcname astring + +Name: ocaml-%{srcname} +Version: 0.8.3 +Release: 1%{?dist} +Summary: Alternative String module for OCaml + +License: ISC +URL: https://erratique.ch/software/astring +Source0: https://github.com/dbuenzli/astring/archive/v%{version}/%{srcname}-%{version}.tar.gz + +BuildRequires: ocaml >= 4.01.0 +BuildRequires: ocaml-findlib +BuildRequires: ocaml-ocamlbuild +BuildRequires: ocaml-ocamldoc +BuildRequires: ocaml-topkg-devel + +%description +Astring exposes an alternative `String` module for OCaml. This module +tries to balance minimality and expressiveness for basic, index-free, +string processing and provides types and functions for substrings, +string sets and string maps. + +Remaining compatible with the OCaml `String` module is a non-goal. The +`String` module exposed by Astring has exception safe functions, +removes deprecated and rarely used functions, alters some signatures +and names, adds a few missing functions and fully exploits OCaml's +newfound string immutability. + +%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} -p0 + +# Topkg does watermark replacements only if run inside a git checkout. Github +# tarballs do not come with a .git directory. Therefore, we do the watermark +# replacement manually. +for fil in $(find . -type f); do + sed -e 's,%%%%NAME%%%%,%{srcname},' \ + -e 's,%%%%PKG_HOMEPAGE%%%%,%{url},' \ + -e 's,%%%%VERSION%%%%,v%{version},' \ + -e 's,%%%%VERSION_NUM%%%%,%{version},' \ + -i.orig $fil + touch -r $fil.orig $fil + rm $fil.orig +done + +%build +# Build the library and the tests +ocaml pkg/pkg.ml build --tests true + +# Build the documentation +mkdir html +ocamldoc -html -d html -I +compiler-libs -I _build/src \ + -css-style doc/style.css _build/src/astring.mli + +%install +# Install the library +mkdir -p %{buildroot}%{_libdir}/ocaml/astring +cp -p _build/{opam,pkg/META} %{buildroot}%{_libdir}/ocaml/astring +%ifarch %{ocaml_native_compiler} +cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \ + %{buildroot}%{_libdir}/ocaml/astring +%else +cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{_libdir}/ocaml/astring +%endif + +%check +ocaml pkg/pkg.ml test + +%files +%doc CHANGES.md README.md +%license LICENSE.md +%dir %{_libdir}/ocaml/%{srcname}/ +%{_libdir}/ocaml/%{srcname}/META +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cma +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmi +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxs +%endif + +%files devel +%doc html/* +%{_libdir}/ocaml/%{srcname}/opam +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/%{srcname}*.a +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmx +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmxa +%endif +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmt +%{_libdir}/ocaml/%{srcname}/%{srcname}*.cmti +%{_libdir}/ocaml/%{srcname}/%{srcname}*.mli + +%changelog +* Wed Jan 8 2020 Jerry James - 0.8.3-1 +- Initial RPM diff --git a/sources b/sources new file mode 100644 index 0000000..d415d2a --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (astring-0.8.3.tar.gz) = d54a99b00ddc5e1aec8b69c7bef1238991b27a4563c5c8556c931520fdcd7101134752f76e9b3e7a955088329150f07516ba465b9e75a262be88c1e1d845a675