]>
Commit | Line | Data |
---|---|---|
2581d7f6 JR |
1 | # |
2 | # Conditional build: | |
67c93bbb JR |
3 | %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built) |
4 | ||
5 | # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it | |
7f4ec68f | 6 | %ifnarch %{ix86} %{x8664} %{arm} aarch64 ppc sparc sparcv9 |
67c93bbb JR |
7 | %undefine with_ocaml_opt |
8 | %endif | |
2581d7f6 | 9 | |
62d25049 | 10 | %define module zarith |
2581d7f6 | 11 | Summary: Zarith: arbitrary-precision integers |
7f4ec68f | 12 | Summary(pl.UTF-8): Zarith - liczby całkowite dowolnej precyzji |
62d25049 | 13 | Name: ocaml-zarith |
7f4ec68f | 14 | Version: 1.9.1 |
e0f0490e | 15 | Release: 1 |
7f4ec68f | 16 | License: LGPL v2 with linking exception |
2581d7f6 | 17 | Group: Applications/Math |
7f4ec68f JB |
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 | URL: http://github.com/ocaml/Zarith | |
2581d7f6 JR |
22 | BuildRequires: bash |
23 | BuildRequires: gmp-devel | |
7f4ec68f JB |
24 | BuildRequires: ocaml >= 3.12.1 |
25 | BuildRequires: ocaml-findlib | |
26 | BuildRequires: perl-base | |
2581d7f6 JR |
27 | %requires_eq ocaml-runtime |
28 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
29 | ||
30 | %description | |
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. | |
35 | ||
7f4ec68f JB |
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. | |
42 | ||
2581d7f6 JR |
43 | %package devel |
44 | Summary: Zarith library development files | |
7f4ec68f | 45 | Summary(pl.UTF-8): Pliki programistyczne biblioteki Zarith |
2581d7f6 JR |
46 | Group: Development/Libraries |
47 | Requires: %{name} = %{version}-%{release} | |
48 | %requires_eq ocaml | |
49 | ||
50 | %description devel | |
51 | This package contains files needed to develop OCaml programs using | |
7f4ec68f JB |
52 | Zarith library. |
53 | ||
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. | |
2581d7f6 JR |
57 | |
58 | %prep | |
7f4ec68f | 59 | %setup -q -n Zarith-release-%{version} |
2581d7f6 JR |
60 | |
61 | %build | |
62 | CFLAGS="%{rpmcflags}" \ | |
63 | ./configure \ | |
7f4ec68f | 64 | -installdir $RPM_BUILD_ROOT%{_libdir}/ocaml \ |
2581d7f6 JR |
65 | -gmp |
66 | ||
7f4ec68f | 67 | %{__make} -j1 |
2581d7f6 JR |
68 | |
69 | %install | |
70 | rm -rf $RPM_BUILD_ROOT | |
71 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
72 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
73 | ||
74 | %{__make} install \ | |
75 | DESTDIR=$RPM_BUILD_ROOT | |
76 | ||
77 | # move to dir pld ocamlfind looks | |
62d25049 | 78 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} |
7f4ec68f | 79 | %{__mv} $OCAMLFIND_DESTDIR/%{module}/META \ |
62d25049 JR |
80 | $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} |
81 | cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META | |
82 | directory="+%{module}" | |
2581d7f6 JR |
83 | EOF |
84 | ||
7f4ec68f JB |
85 | # not required with system package manager |
86 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so.owner | |
87 | ||
2581d7f6 JR |
88 | %clean |
89 | rm -rf $RPM_BUILD_ROOT | |
90 | ||
91 | %files | |
92 | %defattr(644,root,root,755) | |
7f4ec68f JB |
93 | %doc Changes LICENSE README.md |
94 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllzarith.so | |
62d25049 | 95 | %dir %{_libdir}/ocaml/%{module} |
67c93bbb | 96 | %if %{with ocaml_opt} |
7f4ec68f | 97 | %attr(755,root,root) %{_libdir}/ocaml/%{module}/zarith.cmxs |
67c93bbb | 98 | %endif |
62d25049 | 99 | %{_libdir}/ocaml/site-lib/%{module} |
2581d7f6 JR |
100 | |
101 | %files devel | |
102 | %defattr(644,root,root,755) | |
62d25049 JR |
103 | %{_libdir}/ocaml/%{module}/*.cm[axi] |
104 | %{_libdir}/ocaml/%{module}/*.mli | |
7f4ec68f | 105 | %{_libdir}/ocaml/%{module}/*.cmti |
67c93bbb | 106 | %{_libdir}/ocaml/%{module}/libzarith.a |
7f4ec68f | 107 | %{_libdir}/ocaml/%{module}/zarith.h |
67c93bbb JR |
108 | %if %{with ocaml_opt} |
109 | %{_libdir}/ocaml/%{module}/zarith.a | |
7f4ec68f | 110 | %{_libdir}/ocaml/%{module}/zarith.cmxa |
2581d7f6 | 111 | %endif |