3 %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
5 # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
6 %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9
7 %undefine with_ocaml_opt
11 Summary: Zarith: arbitrary-precision integers
12 Summary(pl.UTF-8): Zarith - liczby całkowite dowolnej precyzji
16 License: LGPL v2 with linking exception
17 Group: Applications/Math
18 #Source0Download: https://github.com/ocaml/Zarith/releases
19 Source0: https://github.com/ocaml/Zarith/archive/release-%{version}/Zarith-%{version}.tar.gz
20 # Source0-md5: bf368f3d9e20b6b446d54681afc05a04
21 URL: http://github.com/ocaml/Zarith
23 BuildRequires: gmp-devel
24 BuildRequires: ocaml >= 3.12.1
25 BuildRequires: ocaml-findlib
26 BuildRequires: perl-base
27 %requires_eq ocaml-runtime
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
31 The Zarith library implements arithmetic and logical operations over
32 arbitrary-precision integers. It uses GMP to efficiently implement
33 arithmetic over big integers. Small integers are represented as Caml
34 unboxed integers, for speed and space economy.
36 %description -l pl.UTF-8
37 Biblioteka Zarith implementuje operacje arytmetyczne i logiczne na
38 liczbach całkowitych dowolnej precyzji. Wykorzystuje gmp do wydajnej
39 arytmetyki na dużych liczbach całkowitych. Małe liczby całkowite są
40 reprezentowane jako nieograniczone liczby całkowite Camla, aby zyskać
41 na szybkości i rozmiarze.
44 Summary: Zarith library development files
45 Summary(pl.UTF-8): Pliki programistyczne biblioteki Zarith
46 Group: Development/Libraries
47 Requires: %{name} = %{version}-%{release}
51 This package contains files needed to develop OCaml programs using
54 %description devel -l pl.UTF-8
55 Ten pakiet zawiera pliki potrzebne do tworzenia programów w OCamlu
56 przy użyciu biblioteki Zarith.
59 %setup -q -n Zarith-release-%{version}
63 CFLAGS="%{rpmcflags}" \
65 -installdir $RPM_BUILD_ROOT%{_libdir}/ocaml \
71 rm -rf $RPM_BUILD_ROOT
72 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
73 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
76 DESTDIR=$RPM_BUILD_ROOT
78 # move to dir pld ocamlfind looks
79 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
80 %{__mv} $OCAMLFIND_DESTDIR/%{module}/META \
81 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
82 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
83 directory="+%{module}"
86 # not required with system package manager
87 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so.owner
90 rm -rf $RPM_BUILD_ROOT
93 %defattr(644,root,root,755)
94 %doc Changes LICENSE README.md
95 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllzarith.so
96 %dir %{_libdir}/ocaml/%{module}
98 %attr(755,root,root) %{_libdir}/ocaml/%{module}/zarith.cmxs
100 %{_libdir}/ocaml/site-lib/%{module}
103 %defattr(644,root,root,755)
104 %{_libdir}/ocaml/%{module}/*.cm[axi]
105 %{_libdir}/ocaml/%{module}/*.mli
106 %{_libdir}/ocaml/%{module}/*.cmti
107 %{_libdir}/ocaml/%{module}/libzarith.a
108 %{_libdir}/ocaml/%{module}/zarith.h
109 %if %{with ocaml_opt}
110 %{_libdir}/ocaml/%{module}/zarith.a
111 %{_libdir}/ocaml/%{module}/zarith.cmxa