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: af41b7534a4c91a8f774f04e307c1c66
21 Patch0: %{name}-x32.patch
22 URL: http://github.com/ocaml/Zarith
24 BuildRequires: gmp-devel
25 BuildRequires: ocaml >= 3.12.1
26 BuildRequires: ocaml-findlib
27 BuildRequires: perl-base
28 %requires_eq ocaml-runtime
29 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 The Zarith library implements arithmetic and logical operations over
33 arbitrary-precision integers. It uses GMP to efficiently implement
34 arithmetic over big integers. Small integers are represented as Caml
35 unboxed integers, for speed and space economy.
37 %description -l pl.UTF-8
38 Biblioteka Zarith implementuje operacje arytmetyczne i logiczne na
39 liczbach całkowitych dowolnej precyzji. Wykorzystuje gmp do wydajnej
40 arytmetyki na dużych liczbach całkowitych. Małe liczby całkowite są
41 reprezentowane jako nieograniczone liczby całkowite Camla, aby zyskać
42 na szybkości i rozmiarze.
45 Summary: Zarith library development files
46 Summary(pl.UTF-8): Pliki programistyczne biblioteki Zarith
47 Group: Development/Libraries
48 Requires: %{name} = %{version}-%{release}
52 This package contains files needed to develop OCaml programs using
55 %description devel -l pl.UTF-8
56 Ten pakiet zawiera pliki potrzebne do tworzenia programów w OCamlu
57 przy użyciu biblioteki Zarith.
60 %setup -q -n Zarith-release-%{version}
65 CFLAGS="%{rpmcflags}" \
67 -host %{_target_platform} \
68 -installdir $RPM_BUILD_ROOT%{_libdir}/ocaml \
74 rm -rf $RPM_BUILD_ROOT
75 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
76 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
79 DESTDIR=$RPM_BUILD_ROOT
81 # move to dir pld ocamlfind looks
82 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
83 %{__mv} $OCAMLFIND_DESTDIR/%{module}/META \
84 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
85 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
86 directory="+%{module}"
89 # not required with system package manager
90 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so.owner
93 rm -rf $RPM_BUILD_ROOT
96 %defattr(644,root,root,755)
97 %doc Changes LICENSE README.md
98 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllzarith.so
99 %dir %{_libdir}/ocaml/%{module}
100 %if %{with ocaml_opt}
101 %attr(755,root,root) %{_libdir}/ocaml/%{module}/zarith.cmxs
103 %{_libdir}/ocaml/site-lib/%{module}
106 %defattr(644,root,root,755)
107 %{_libdir}/ocaml/%{module}/*.cm[axi]
108 %{_libdir}/ocaml/%{module}/*.mli
109 %{_libdir}/ocaml/%{module}/*.cmti
110 %{_libdir}/ocaml/%{module}/libzarith.a
111 %{_libdir}/ocaml/%{module}/zarith.h
112 %if %{with ocaml_opt}
113 %{_libdir}/ocaml/%{module}/zarith.a
114 %{_libdir}/ocaml/%{module}/zarith.cmxa