From 03d2e8821a1392407ce30a6c48d6a5b5bea98106 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 25 Mar 2020 09:00:08 -0600 Subject: [PATCH] Initial import. --- .gitignore | 1 + ocaml-mlmpfr.spec | 102 ++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 104 insertions(+) create mode 100644 .gitignore create mode 100644 ocaml-mlmpfr.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7529779 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/mlmpfr*.tar.gz diff --git a/ocaml-mlmpfr.spec b/ocaml-mlmpfr.spec new file mode 100644 index 0000000..239d0ed --- /dev/null +++ b/ocaml-mlmpfr.spec @@ -0,0 +1,102 @@ +%global srcname mlmpfr + +Name: ocaml-%{srcname} +Version: 4.0.2 +Release: 1%{?dist} +Summary: OCaml bindings for MPFR + +License: LGPLv3 +URL: https://github.com/thvnx/%{srcname} +Source0: %{url}/archive/%{srcname}.%{version}-dune.tar.gz + +BuildRequires: ocaml >= 4.04 +BuildRequires: ocaml-dune >= 1.11.0 +BuildRequires: ocaml-odoc +BuildRequires: pkgconfig(mpfr) + +%description +This library provides OCaml bindings for MPFR. + +%package devel +Summary: Development files for %{name} +Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: mpfr-devel%{?_isa} + +%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}-%{srcname}.%{version}-dune + +%build +dune build %{?_smp_mflags} +dune build %{?_smp_mflags} @doc + +# Relink the stublibs with $RPM_LD_FLAGS. +cd _build/default/src +ocamlmklib -g -ldopt "$RPM_LD_FLAGS" $(pkgconf --libs mpfr) \ + -o mlmpfr_stubs $(ar t libmlmpfr_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 README.md +%license LICENSE +%dir %{_libdir}/ocaml/%{srcname}/ +%{_libdir}/ocaml/%{srcname}/META +%{_libdir}/ocaml/%{srcname}/mpfr.cmi +%{_libdir}/ocaml/%{srcname}/%{srcname}.cma +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/%{srcname}.cmxs +%endif +%{_libdir}/ocaml/stublibs/dll%{srcname}_stubs.so + +%files devel +%{_libdir}/ocaml/%{srcname}/dune-package +%{_libdir}/ocaml/%{srcname}/opam +%ifarch %{ocaml_native_compiler} +%{_libdir}/ocaml/%{srcname}/lib%{srcname}_stubs.a +%{_libdir}/ocaml/%{srcname}/%{srcname}.a +%{_libdir}/ocaml/%{srcname}/%{srcname}.cmxa +%{_libdir}/ocaml/%{srcname}/mpfr.cmx +%endif +%{_libdir}/ocaml/%{srcname}/mpfr.cmt +%{_libdir}/ocaml/%{srcname}/mpfr.cmti +%{_libdir}/ocaml/%{srcname}/mpfr.mli + +%files doc +%doc _build/default/_doc/_html/ +%doc _build/default/_doc/_mlds/ +%doc _build/default/_doc/_odoc/ +%license LICENSE + +%changelog +* Mon Mar 23 2020 Jerry James - 4.0.2-1 +- Initial RPM diff --git a/sources b/sources new file mode 100644 index 0000000..e0ccd3d --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (mlmpfr.4.0.2-dune.tar.gz) = ac11e67975a16c43d9f9b753bc0988c838a11aa2de6d9c3ebe2d2c30ef76867023835dcf24b572368d437c6dc734b57a2dff00f915dc437696289e1315292ed3