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