]>
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) |
0acf091f | 13 | Summary(pl.UTF-8): Biblioteka Curl dla OCamla (ocurl) |
c81abe36 | 14 | Name: ocaml-%{pkgname} |
e88cf738 | 15 | Version: 0.9.1 |
0680142d | 16 | Release: 4 |
26de232b ER |
17 | License: MIT |
18 | Group: Libraries | |
e88cf738 JR |
19 | Source0: https://github.com/ygrek/ocurl/releases/download/%{version}/ocurl-%{version}.tar.gz |
20 | # Source0-md5: 1ff6b12803fa0c6e9a4358dd29b83910 | |
9781d077 | 21 | Patch0: ocaml_opt.patch |
56573ec9 | 22 | URL: http://ocurl.forge.ocamlcore.org/ |
26de232b ER |
23 | BuildRequires: curl-devel >= 7.12.0 |
24 | BuildRequires: gawk | |
25 | BuildRequires: ocaml >= 3.10.0-7 | |
26 | BuildRequires: ocaml-findlib-devel | |
0680142d JR |
27 | BuildRequires: ocaml-lwt-devel |
28 | BuildRequires: ocaml-lwt-ppx-devel | |
c81abe36 | 29 | # Explicitly require Curl (fixes RHBZ#711261). Since ocaml-curl uses |
26de232b ER |
30 | # -custom rather than ocamlmklib, automatic detection is infeasible. |
31 | Requires: curl-devel >= 7.12.0 | |
c63f57ee | 32 | %requires_eq ocaml-runtime |
c81abe36 | 33 | ExcludeArch: sparc64 s390 s390x |
26de232b ER |
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 | ||
0acf091f JB |
40 | %description -l pl.UTF-8 |
41 | Biblioteka Ocaml Curl (Ocurl) to biblioteka interfejsu języka | |
42 | programowania Ocaml do biblioteki sieciowe libcurl. | |
43 | ||
56573ec9 | 44 | %package devel |
0acf091f JB |
45 | Summary: OCaml Curl library (ocurl) - development part |
46 | Summary(pl.UTF-8): Biblioteka Curl dla OCamla (ocurl) - część programistyczna | |
26de232b ER |
47 | Group: Development/Libraries |
48 | Requires: %{name} = %{version}-%{release} | |
49 | ||
56573ec9 | 50 | %description devel |
0acf091f JB |
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. | |
26de232b ER |
57 | |
58 | %prep | |
f6f0b5de | 59 | %setup -q -n ocurl-%{version} |
9ed04161 | 60 | %patch0 -p1 |
26de232b ER |
61 | |
62 | %build | |
56573ec9 | 63 | %configure |
5750614e | 64 | %{__make} -j1 all |
26de232b ER |
65 | |
66 | %install | |
67 | rm -rf $RPM_BUILD_ROOT | |
0acf091f | 68 | |
26de232b ER |
69 | export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml |
70 | install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs | |
9781d077 | 71 | |
26de232b ER |
72 | %{__make} install \ |
73 | DESTDIR=$RPM_BUILD_ROOT | |
74 | ||
75 | # Install curl.mli | |
76 | cp -p curl.mli $OCAMLFIND_DESTDIR/curl | |
77 | ||
9ed04161 | 78 | cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/curl/META <<EOF |
4790749d ER |
79 | requires = "" |
80 | version = "%{version}" | |
81 | directory = "+curl" | |
82 | archive(byte) = "curl.cma" | |
83 | archive(native) = "curl.cmxa" | |
84 | linkopts = "" | |
85 | EOF | |
86 | ||
26de232b ER |
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 | |
a1673ef5 JR |
96 | %dir %{_libdir}/ocaml/curl |
97 | %{_libdir}/ocaml/curl/META | |
56573ec9 ER |
98 | %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so |
99 | %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner | |
a1673ef5 | 100 | %{_libdir}/ocaml/curl/*.cma |
90c843a1 | 101 | %if %{with ocaml_opt} |
a1673ef5 | 102 | %attr(755,root,root) %{_libdir}/ocaml/curl/*.cmxs |
26de232b | 103 | %endif |
26de232b ER |
104 | |
105 | %files devel | |
106 | %defattr(644,root,root,755) | |
107 | %doc examples/* | |
90c843a1 | 108 | %{_libdir}/ocaml/curl/*.a |
a1673ef5 | 109 | %{_libdir}/ocaml/curl/*.cmi |
0680142d | 110 | %{_libdir}/ocaml/curl/*.cmo |
a1673ef5 JR |
111 | %{_libdir}/ocaml/curl/*.cmt |
112 | %{_libdir}/ocaml/curl/*.cmti | |
9781d077 | 113 | %if %{with ocaml_opt} |
a1673ef5 | 114 | %{_libdir}/ocaml/curl/*.cmx |
26de232b ER |
115 | %{_libdir}/ocaml/curl/*.cmxa |
116 | %endif | |
117 | %{_libdir}/ocaml/curl/*.mli |