]>
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 |
41878b55 | 15 | Release: 2 |
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 | |
41878b55 | 21 | Patch0: %{name}-x32.patch |
7f4ec68f | 22 | URL: http://github.com/ocaml/Zarith |
2581d7f6 JR |
23 | BuildRequires: bash |
24 | BuildRequires: gmp-devel | |
7f4ec68f JB |
25 | BuildRequires: ocaml >= 3.12.1 |
26 | BuildRequires: ocaml-findlib | |
27 | BuildRequires: perl-base | |
2581d7f6 JR |
28 | %requires_eq ocaml-runtime |
29 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
30 | ||
31 | %description | |
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. | |
36 | ||
7f4ec68f JB |
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. | |
43 | ||
2581d7f6 JR |
44 | %package devel |
45 | Summary: Zarith library development files | |
7f4ec68f | 46 | Summary(pl.UTF-8): Pliki programistyczne biblioteki Zarith |
2581d7f6 JR |
47 | Group: Development/Libraries |
48 | Requires: %{name} = %{version}-%{release} | |
49 | %requires_eq ocaml | |
50 | ||
51 | %description devel | |
52 | This package contains files needed to develop OCaml programs using | |
7f4ec68f JB |
53 | Zarith library. |
54 | ||
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. | |
2581d7f6 JR |
58 | |
59 | %prep | |
7f4ec68f | 60 | %setup -q -n Zarith-release-%{version} |
41878b55 | 61 | %patch0 -p1 |
2581d7f6 JR |
62 | |
63 | %build | |
41878b55 | 64 | CC="%{__cc}" \ |
2581d7f6 JR |
65 | CFLAGS="%{rpmcflags}" \ |
66 | ./configure \ | |
41878b55 | 67 | -host %{_target_platform} \ |
7f4ec68f | 68 | -installdir $RPM_BUILD_ROOT%{_libdir}/ocaml \ |
2581d7f6 JR |
69 | -gmp |
70 | ||
7f4ec68f | 71 | %{__make} -j1 |
2581d7f6 JR |
72 | |
73 | %install | |
74 | rm -rf $RPM_BUILD_ROOT | |
75 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
76 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
77 | ||
78 | %{__make} install \ | |
79 | DESTDIR=$RPM_BUILD_ROOT | |
80 | ||
81 | # move to dir pld ocamlfind looks | |
62d25049 | 82 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} |
7f4ec68f | 83 | %{__mv} $OCAMLFIND_DESTDIR/%{module}/META \ |
62d25049 JR |
84 | $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} |
85 | cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META | |
86 | directory="+%{module}" | |
2581d7f6 JR |
87 | EOF |
88 | ||
7f4ec68f JB |
89 | # not required with system package manager |
90 | %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so.owner | |
91 | ||
2581d7f6 JR |
92 | %clean |
93 | rm -rf $RPM_BUILD_ROOT | |
94 | ||
95 | %files | |
96 | %defattr(644,root,root,755) | |
7f4ec68f JB |
97 | %doc Changes LICENSE README.md |
98 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllzarith.so | |
62d25049 | 99 | %dir %{_libdir}/ocaml/%{module} |
67c93bbb | 100 | %if %{with ocaml_opt} |
7f4ec68f | 101 | %attr(755,root,root) %{_libdir}/ocaml/%{module}/zarith.cmxs |
67c93bbb | 102 | %endif |
62d25049 | 103 | %{_libdir}/ocaml/site-lib/%{module} |
2581d7f6 JR |
104 | |
105 | %files devel | |
106 | %defattr(644,root,root,755) | |
62d25049 JR |
107 | %{_libdir}/ocaml/%{module}/*.cm[axi] |
108 | %{_libdir}/ocaml/%{module}/*.mli | |
7f4ec68f | 109 | %{_libdir}/ocaml/%{module}/*.cmti |
67c93bbb | 110 | %{_libdir}/ocaml/%{module}/libzarith.a |
7f4ec68f | 111 | %{_libdir}/ocaml/%{module}/zarith.h |
67c93bbb JR |
112 | %if %{with ocaml_opt} |
113 | %{_libdir}/ocaml/%{module}/zarith.a | |
7f4ec68f | 114 | %{_libdir}/ocaml/%{module}/zarith.cmxa |
2581d7f6 | 115 | %endif |