From 850ba00ef04dc3c9efc75d1d16518c724d79263b Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jan 14 2020 04:04:19 +0000 Subject: Initial import. --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d22a43f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/fmt-*.tar.gz diff --git a/ocaml-fmt-stdlib-shims.patch b/ocaml-fmt-stdlib-shims.patch new file mode 100644 index 0000000..c2eb65a --- /dev/null +++ b/ocaml-fmt-stdlib-shims.patch @@ -0,0 +1,30 @@ +--- a/opam ++++ b/opam +@@ -12,9 +12,7 @@ depends: [ + "ocamlfind" {build} + "ocamlbuild" {build} + "topkg" {build & >= "0.9.0"} +- # Can be removed once ocaml >= 4.07 + "seq" +- "stdlib-shims" + ] + depopts: [ "base-unix" "cmdliner" ] + conflicts: [ "cmdliner" {< "0.9.8"} ] +--- a/pkg/META ++++ b/pkg/META +@@ -1,6 +1,6 @@ + description = "OCaml Format pretty-printer combinators" + version = "%%VERSION_NUM%%" +-requires = "seq stdlib-shims" ++requires = "seq" + archive(byte) = "fmt.cma" + archive(native) = "fmt.cmxa" + plugin(byte) = "fmt.cma" +--- a/_tags ++++ b/_tags +@@ -1,4 +1,4 @@ +-true : bin_annot, safe_string, package(seq), package(stdlib-shims) ++true : bin_annot, safe_string, package(seq) + <_b0> : -traverse + : include + : package(unix) diff --git a/ocaml-fmt.rpmlintrc b/ocaml-fmt.rpmlintrc new file mode 100644 index 0000000..41516e9 --- /dev/null +++ b/ocaml-fmt.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 .* (cli|cmdliner|combinators|formatters|tty)') diff --git a/ocaml-fmt.spec b/ocaml-fmt.spec new file mode 100644 index 0000000..5bb99f5 --- /dev/null +++ b/ocaml-fmt.spec @@ -0,0 +1,107 @@ +%ifnarch %{ocaml_native_compiler} +%global debug_package %{nil} +%endif + +%global srcname fmt + +Name: ocaml-%{srcname} +Version: 0.8.8 +Release: 1%{?dist} +Summary: OCaml Format pretty-printer combinators + +License: ISC +URL: https://erratique.ch/software/fmt +Source0: https://github.com/dbuenzli/fmt/archive/v%{version}/%{srcname}-%{version}.tar.gz +# We neither need nor want the stdlib-shims package in Fedora. It is a forward +# compatibility package for older OCaml installations. Patch it out instead. +# Upstream does not want this patch until stdlib-shims is obsolete. +Patch0: %{name}-stdlib-shims.patch + +BuildRequires: ocaml >= 4.05.0 +BuildRequires: ocaml-cmdliner-devel >= 0.9.8 +BuildRequires: ocaml-findlib +BuildRequires: ocaml-ocamlbuild +BuildRequires: ocaml-ocamldoc +BuildRequires: ocaml-seq-devel +BuildRequires: ocaml-topkg-devel >= 0.9.0 + +%description +Fmt exposes combinators to devise `Format` pretty-printing functions. + +Fmt depends only on the OCaml standard library. The optional Fmt_tty +library that enables setting up formatters for terminal color output +depends on the Unix library. The optional Fmt_cli library that provides +command line support for Fmt depends on Cmdliner. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: ocaml-seq-devel%{?_isa} + +%description devel +The %{name}-devel package contains libraries and signature files for +developing applications that use %{name}. + +%prep +%autosetup -n %{srcname}-%{version} -p1 + +# 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,%%%%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 --with-base-unix true --with-cmdliner true + +# Build the documentation +mkdir html +ocamldoc -html -d html -I +cmdliner -I _build/src _build/src/*.mli + +%install +# Install the library +mkdir -p %{buildroot}%{_libdir}/ocaml/fmt +cp -p _build/{opam,pkg/META} %{buildroot}%{_libdir}/ocaml/fmt +%ifarch %{ocaml_native_compiler} +cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \ + %{buildroot}%{_libdir}/ocaml/fmt +%else +cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{_libdir}/ocaml/fmt +%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 +* Thu Jan 9 2020 Jerry James - 0.8.8-1 +- Initial RPM diff --git a/sources b/sources new file mode 100644 index 0000000..e76a589 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (fmt-0.8.8.tar.gz) = 3a39ac4f368e4de7c1059e088d8470651073c56f5ba83ba3bc328eb2be7ef0461b138fbaf1f25a13b8d8988920be4b90e968ce251e1a72db4f9cf99668fa2f3d