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