From fb3c564a4568a2194db4aaaff83dd4de9dc6e073 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Mon, 13 Jan 2020 21:06:43 -0700 Subject: [PATCH] Initial import. --- .gitignore | 1 + ocaml-uuidm.spec | 102 +++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 104 insertions(+) create mode 100644 .gitignore create mode 100644 ocaml-uuidm.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cd8ed6c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/uuidm-*.tar.gz diff --git a/ocaml-uuidm.spec b/ocaml-uuidm.spec new file mode 100644 index 0000000..dc7f263 --- /dev/null +++ b/ocaml-uuidm.spec @@ -0,0 +1,102 @@ +%ifnarch %{ocaml_native_compiler} +%global debug_package %{nil} +%endif + +%global srcname uuidm + +Name: ocaml-%{srcname} +Version: 0.9.7 +Release: 1%{?dist} +Summary: Universally unique identifiers (UUIDs) for OCaml + +License: ISC +URL: https://erratique.ch/software/uuidm +Source0: https://github.com/dbuenzli/uuidm/archive/v%{version}/%{srcname}-%{version}.tar.gz + +BuildRequires: ocaml >= 4.03.0 +BuildRequires: ocaml-cmdliner-devel +BuildRequires: ocaml-findlib +BuildRequires: ocaml-ocamlbuild +BuildRequires: ocaml-ocamldoc +BuildRequires: ocaml-topkg-devel + +%description +Uuidm is an OCaml module implementing 128 bit universally unique +identifiers, versions 3, 5 (named based with MD5, SHA-1 hashing) and 4 +(random based); see RFC 4122: http://tools.ietf.org/html/rfc4122. + +%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} + +# The META file mistakenly uses the wrong version tag +sed -i 's/VERSION/VERSION_NUM/' pkg/META + +# 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 --with-cmdliner true + +# Build the documentation +mkdir html +ocamldoc -html -d html -I _build/src _build/src/uuidm.mli + +%install +# Install the library +mkdir -p %{buildroot}%{_libdir}/ocaml/uuidm +cp -p _build/{opam,pkg/META} %{buildroot}%{_libdir}/ocaml/uuidm +%ifarch %{ocaml_native_compiler} +cp -a _build/src/*.{a,cma,cmi,cmt,cmti,cmx,cmxa,cmxs,mli} \ + %{buildroot}%{_libdir}/ocaml/uuidm +%else +cp -a _build/src/*.{cma,cmi,cmt,cmti,mli} %{buildroot}%{_libdir}/ocaml/uuidm +%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.9.7-1 +- Initial RPM diff --git a/sources b/sources new file mode 100644 index 0000000..cba6b96 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (uuidm-0.9.7.tar.gz) = 7048e467bbd9eefd19ca057caadcc8f634d4eae7642665a84df88f726df3fb849085613d75a485272b0d0e19c9041c560a8c864e780dbed29ff68e3cfa8ba3d4