]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without opt # build opt | |
4 | ||
5 | %define debug_package %{nil} | |
6 | Summary: OCaml Curl library (ocurl) | |
7 | Name: ocaml-curl | |
8 | Version: 0.5.3 | |
9 | Release: 0.1 | |
10 | License: MIT | |
11 | Group: Libraries | |
12 | Source0: http://downloads.sourceforge.net/ocurl/ocurl-%{version}.tgz | |
13 | Patch1: ocurl-0.5.3-include-o-cmx.patch | |
14 | URL: http://sourceforge.net/projects/ocurl | |
15 | BuildRequires: curl-devel >= 7.12.0 | |
16 | BuildRequires: gawk | |
17 | BuildRequires: ocaml >= 3.10.0-7 | |
18 | BuildRequires: ocaml-findlib-devel | |
19 | ExcludeArch: sparc64 s390 s390x | |
20 | # Explicitly require Curl (fixes #711261). Since ocaml-curl uses | |
21 | # -custom rather than ocamlmklib, automatic detection is infeasible. | |
22 | Requires: curl-devel >= 7.12.0 | |
23 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
24 | ||
25 | %description | |
26 | The Ocaml Curl Library (Ocurl) is an interface library for the | |
27 | programming language Ocaml to the networking library libcurl. | |
28 | ||
29 | %package devel | |
30 | Summary: Development files for %{name} | |
31 | Group: Development/Libraries | |
32 | Requires: %{name} = %{version}-%{release} | |
33 | ||
34 | %description devel | |
35 | The %{name}-devel package contains libraries and signature files for | |
36 | developing applications that use %{name}. | |
37 | ||
38 | %prep | |
39 | %setup -qc | |
40 | mv ocurl/* . | |
41 | %patch1 -p1 | |
42 | ||
43 | # Files in the archive have spurious +x mode. | |
44 | find -type f | xargs chmod 0644 | |
45 | chmod 0755 configure install-sh | |
46 | ||
47 | %build | |
48 | %configure \ | |
49 | --with-findlib | |
50 | ||
51 | %{__make} -j1 all \ | |
52 | %if %{with opt} | |
53 | OCBYTE="ocamlc.opt -g" \ | |
54 | OCOPT="ocamlopt.opt -g" | |
55 | %endif | |
56 | ||
57 | %install | |
58 | rm -rf $RPM_BUILD_ROOT | |
59 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
60 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
61 | %{__make} install \ | |
62 | DESTDIR=$RPM_BUILD_ROOT | |
63 | ||
64 | # Install curl.mli | |
65 | cp -p curl.mli $OCAMLFIND_DESTDIR/curl | |
66 | ||
67 | # Make clean in the examples dir so our docs don't contain binaries. | |
68 | %{__make} -C examples clean | |
69 | ||
70 | %clean | |
71 | rm -rf $RPM_BUILD_ROOT | |
72 | ||
73 | %files | |
74 | %defattr(644,root,root,755) | |
75 | %doc COPYING | |
76 | %{_libdir}/ocaml/curl | |
77 | %if %{with opt} | |
78 | %exclude %{_libdir}/ocaml/curl/*.a | |
79 | %exclude %{_libdir}/ocaml/curl/*.o | |
80 | %exclude %{_libdir}/ocaml/curl/*.cmx | |
81 | %exclude %{_libdir}/ocaml/curl/*.cmxa | |
82 | %endif | |
83 | %exclude %{_libdir}/ocaml/curl/*.mli | |
84 | ||
85 | %files devel | |
86 | %defattr(644,root,root,755) | |
87 | %doc examples/* | |
88 | %if %{with opt} | |
89 | %{_libdir}/ocaml/curl/*.a | |
90 | %{_libdir}/ocaml/curl/*.o | |
91 | %{_libdir}/ocaml/curl/*.cmx | |
92 | %{_libdir}/ocaml/curl/*.cmxa | |
93 | %endif | |
94 | %{_libdir}/ocaml/curl/*.mli |