]>
Commit | Line | Data |
---|---|---|
26de232b ER |
1 | # |
2 | # Conditional build: | |
56573ec9 | 3 | %bcond_with opt # build opt |
26de232b ER |
4 | |
5 | %define debug_package %{nil} | |
f6f0b5de | 6 | %define pkgname curl |
26de232b | 7 | Summary: OCaml Curl library (ocurl) |
c81abe36 | 8 | Name: ocaml-%{pkgname} |
8fd8b94e | 9 | Version: 0.7.1 |
c63f57ee | 10 | Release: 2 |
26de232b ER |
11 | License: MIT |
12 | Group: Libraries | |
8fd8b94e JR |
13 | Source0: https://forge.ocamlcore.org/frs/download.php/1400/ocurl-%{version}.tar.gz |
14 | # Source0-md5: d138fd78538ae3bd008d6e9c2993d240 | |
56573ec9 | 15 | URL: http://ocurl.forge.ocamlcore.org/ |
26de232b ER |
16 | BuildRequires: curl-devel >= 7.12.0 |
17 | BuildRequires: gawk | |
18 | BuildRequires: ocaml >= 3.10.0-7 | |
19 | BuildRequires: ocaml-findlib-devel | |
c81abe36 | 20 | # Explicitly require Curl (fixes RHBZ#711261). Since ocaml-curl uses |
26de232b ER |
21 | # -custom rather than ocamlmklib, automatic detection is infeasible. |
22 | Requires: curl-devel >= 7.12.0 | |
c63f57ee | 23 | %requires_eq ocaml-runtime |
c81abe36 | 24 | ExcludeArch: sparc64 s390 s390x |
26de232b ER |
25 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
26 | ||
27 | %description | |
28 | The Ocaml Curl Library (Ocurl) is an interface library for the | |
29 | programming language Ocaml to the networking library libcurl. | |
30 | ||
56573ec9 | 31 | %package devel |
26de232b ER |
32 | Summary: Development files for %{name} |
33 | Group: Development/Libraries | |
34 | Requires: %{name} = %{version}-%{release} | |
35 | ||
56573ec9 | 36 | %description devel |
26de232b ER |
37 | The %{name}-devel package contains libraries and signature files for |
38 | developing applications that use %{name}. | |
39 | ||
40 | %prep | |
f6f0b5de | 41 | %setup -q -n ocurl-%{version} |
26de232b ER |
42 | |
43 | %build | |
56573ec9 | 44 | %configure |
26de232b ER |
45 | %{__make} -j1 all \ |
46 | %if %{with opt} | |
47 | OCBYTE="ocamlc.opt -g" \ | |
48 | OCOPT="ocamlopt.opt -g" | |
49 | %endif | |
50 | ||
51 | %install | |
52 | rm -rf $RPM_BUILD_ROOT | |
53 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
54 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
55 | %{__make} install \ | |
56 | DESTDIR=$RPM_BUILD_ROOT | |
57 | ||
58 | # Install curl.mli | |
59 | cp -p curl.mli $OCAMLFIND_DESTDIR/curl | |
60 | ||
4790749d ER |
61 | install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/curl |
62 | cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/curl/META <<EOF | |
63 | requires = "" | |
64 | version = "%{version}" | |
65 | directory = "+curl" | |
66 | archive(byte) = "curl.cma" | |
67 | archive(native) = "curl.cmxa" | |
68 | linkopts = "" | |
69 | EOF | |
70 | ||
26de232b ER |
71 | # Make clean in the examples dir so our docs don't contain binaries. |
72 | %{__make} -C examples clean | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc COPYING | |
80 | %{_libdir}/ocaml/curl | |
56573ec9 ER |
81 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so |
82 | %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner | |
26de232b ER |
83 | %if %{with opt} |
84 | %exclude %{_libdir}/ocaml/curl/*.a | |
85 | %exclude %{_libdir}/ocaml/curl/*.o | |
86 | %exclude %{_libdir}/ocaml/curl/*.cmx | |
87 | %exclude %{_libdir}/ocaml/curl/*.cmxa | |
88 | %endif | |
89 | %exclude %{_libdir}/ocaml/curl/*.mli | |
90 | ||
91 | %files devel | |
92 | %defattr(644,root,root,755) | |
93 | %doc examples/* | |
94 | %if %{with opt} | |
95 | %{_libdir}/ocaml/curl/*.a | |
96 | %{_libdir}/ocaml/curl/*.o | |
97 | %{_libdir}/ocaml/curl/*.cmx | |
98 | %{_libdir}/ocaml/curl/*.cmxa | |
99 | %endif | |
100 | %{_libdir}/ocaml/curl/*.mli | |
4790749d | 101 | %{_libdir}/ocaml/site-lib/curl |