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