]>
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 | |
6 | %ifnarch %{ix86} %{x8664} arm aarch64 ppc sparc sparcv9 | |
7 | %undefine with_ocaml_opt | |
8 | %endif | |
2581d7f6 | 9 | |
62d25049 | 10 | %define module zarith |
2581d7f6 | 11 | Summary: Zarith: arbitrary-precision integers |
62d25049 | 12 | Name: ocaml-zarith |
e0f0490e JR |
13 | Version: 1.4.1 |
14 | Release: 1 | |
2581d7f6 JR |
15 | License: GPL |
16 | Group: Applications/Math | |
e0f0490e JR |
17 | Source0: http://forge.ocamlcore.org/frs/download.php/1574/%{module}-%{version}.tgz |
18 | # Source0-md5: 9ab2482d57f632c9cb3d10149138bc6e | |
2581d7f6 JR |
19 | URL: http://forge.ocamlcore.org/projects/zarith |
20 | BuildRequires: bash | |
21 | BuildRequires: gmp-devel | |
22 | BuildRequires: ocaml >= 3.09.0 | |
23 | BuildRequires: camlp5 >= 5.01 | |
24 | %requires_eq ocaml-runtime | |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
26 | ||
27 | %description | |
28 | The Zarith library implements arithmetic and logical operations over | |
29 | arbitrary-precision integers. It uses GMP to efficiently implement | |
30 | arithmetic over big integers. Small integers are represented as Caml | |
31 | unboxed integers, for speed and space economy. | |
32 | ||
33 | %package devel | |
34 | Summary: Zarith library development files | |
35 | Group: Development/Libraries | |
36 | Requires: %{name} = %{version}-%{release} | |
37 | %requires_eq ocaml | |
38 | ||
39 | %description devel | |
40 | This package contains files needed to develop OCaml programs using | |
41 | zarith library. | |
42 | ||
43 | %prep | |
62d25049 | 44 | %setup -q -n %{module}-%{version} |
2581d7f6 JR |
45 | |
46 | %build | |
47 | CFLAGS="%{rpmcflags}" \ | |
48 | ./configure \ | |
49 | -installdir $RPM_BUILD_ROOT/%{_libdir}/ocaml \ | |
50 | -gmp | |
51 | ||
60665bdb | 52 | %{__make} -j1 VERBOSE=1 |
2581d7f6 JR |
53 | |
54 | %install | |
55 | rm -rf $RPM_BUILD_ROOT | |
56 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
57 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
58 | ||
59 | %{__make} install \ | |
60 | DESTDIR=$RPM_BUILD_ROOT | |
61 | ||
62 | # move to dir pld ocamlfind looks | |
62d25049 JR |
63 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} |
64 | mv $OCAMLFIND_DESTDIR/%{module}/META \ | |
65 | $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module} | |
66 | cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META | |
67 | directory="+%{module}" | |
2581d7f6 JR |
68 | EOF |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so | |
76 | %{_libdir}/ocaml/stublibs/*.so.owner | |
62d25049 | 77 | %dir %{_libdir}/ocaml/%{module} |
67c93bbb | 78 | %if %{with ocaml_opt} |
62d25049 | 79 | %{_libdir}/ocaml/%{module}/*.cmxs |
67c93bbb | 80 | %endif |
62d25049 | 81 | %{_libdir}/ocaml/site-lib/%{module} |
2581d7f6 JR |
82 | |
83 | %files devel | |
84 | %defattr(644,root,root,755) | |
85 | %doc LICENSE | |
62d25049 JR |
86 | %{_libdir}/ocaml/%{module}/*.cm[axi] |
87 | %{_libdir}/ocaml/%{module}/*.mli | |
88 | %{_libdir}/ocaml/%{module}/*.h | |
67c93bbb JR |
89 | %{_libdir}/ocaml/%{module}/libzarith.a |
90 | %if %{with ocaml_opt} | |
91 | %{_libdir}/ocaml/%{module}/zarith.a | |
62d25049 | 92 | %{_libdir}/ocaml/%{module}/*.cmxa |
2581d7f6 | 93 | %endif |