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