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