]>
Commit | Line | Data |
---|---|---|
26de232b ER |
1 | # |
2 | # Conditional build: | |
56573ec9 | 3 | %bcond_with opt # build opt |
26de232b ER |
4 | |
5 | %define debug_package %{nil} | |
c81abe36 | 6 | %define pkgname ocurl |
26de232b | 7 | Summary: OCaml Curl library (ocurl) |
c81abe36 | 8 | Name: ocaml-%{pkgname} |
56573ec9 | 9 | Version: 0.6.0 |
c81abe36 | 10 | Release: 1 |
26de232b ER |
11 | License: MIT |
12 | Group: Libraries | |
56573ec9 ER |
13 | Source0: https://forge.ocamlcore.org/frs/download.php/1238/%{pkgname}-%{version}.tar.gz |
14 | # Source0-md5: 21575e86b390c6c182a8dee42e8db1f3 | |
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 | |
c81abe36 | 23 | ExcludeArch: sparc64 s390 s390x |
26de232b ER |
24 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
25 | ||
26 | %description | |
27 | The Ocaml Curl Library (Ocurl) is an interface library for the | |
28 | programming language Ocaml to the networking library libcurl. | |
29 | ||
56573ec9 | 30 | %package devel |
26de232b ER |
31 | Summary: Development files for %{name} |
32 | Group: Development/Libraries | |
33 | Requires: %{name} = %{version}-%{release} | |
34 | ||
56573ec9 | 35 | %description devel |
26de232b ER |
36 | The %{name}-devel package contains libraries and signature files for |
37 | developing applications that use %{name}. | |
38 | ||
39 | %prep | |
56573ec9 | 40 | %setup -q -n %{pkgname}-%{version} |
26de232b ER |
41 | |
42 | %build | |
56573ec9 | 43 | %configure |
26de232b ER |
44 | %{__make} -j1 all \ |
45 | %if %{with opt} | |
46 | OCBYTE="ocamlc.opt -g" \ | |
47 | OCOPT="ocamlopt.opt -g" | |
48 | %endif | |
49 | ||
50 | %install | |
51 | rm -rf $RPM_BUILD_ROOT | |
52 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml | |
53 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
54 | %{__make} install \ | |
55 | DESTDIR=$RPM_BUILD_ROOT | |
56 | ||
57 | # Install curl.mli | |
58 | cp -p curl.mli $OCAMLFIND_DESTDIR/curl | |
59 | ||
60 | # Make clean in the examples dir so our docs don't contain binaries. | |
61 | %{__make} -C examples clean | |
62 | ||
63 | %clean | |
64 | rm -rf $RPM_BUILD_ROOT | |
65 | ||
66 | %files | |
67 | %defattr(644,root,root,755) | |
68 | %doc COPYING | |
69 | %{_libdir}/ocaml/curl | |
56573ec9 ER |
70 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so |
71 | %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner | |
26de232b ER |
72 | %if %{with opt} |
73 | %exclude %{_libdir}/ocaml/curl/*.a | |
74 | %exclude %{_libdir}/ocaml/curl/*.o | |
75 | %exclude %{_libdir}/ocaml/curl/*.cmx | |
76 | %exclude %{_libdir}/ocaml/curl/*.cmxa | |
77 | %endif | |
78 | %exclude %{_libdir}/ocaml/curl/*.mli | |
79 | ||
80 | %files devel | |
81 | %defattr(644,root,root,755) | |
82 | %doc examples/* | |
83 | %if %{with opt} | |
84 | %{_libdir}/ocaml/curl/*.a | |
85 | %{_libdir}/ocaml/curl/*.o | |
86 | %{_libdir}/ocaml/curl/*.cmx | |
87 | %{_libdir}/ocaml/curl/*.cmxa | |
88 | %endif | |
89 | %{_libdir}/ocaml/curl/*.mli | |
56573ec9 | 90 |