3 %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
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
10 %define debug_package %{nil}
12 Summary: OCaml Curl library (ocurl)
13 Name: ocaml-%{pkgname}
18 Source0: https://forge.ocamlcore.org/frs/download.php/1400/ocurl-%{version}.tar.gz
19 # Source0-md5: d138fd78538ae3bd008d6e9c2993d240
20 Patch0: ocaml_opt.patch
21 URL: http://ocurl.forge.ocamlcore.org/
22 BuildRequires: curl-devel >= 7.12.0
24 BuildRequires: ocaml >= 3.10.0-7
25 BuildRequires: ocaml-findlib-devel
26 # Explicitly require Curl (fixes RHBZ#711261). Since ocaml-curl uses
27 # -custom rather than ocamlmklib, automatic detection is infeasible.
28 Requires: curl-devel >= 7.12.0
29 %requires_eq ocaml-runtime
30 ExcludeArch: sparc64 s390 s390x
31 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
34 The Ocaml Curl Library (Ocurl) is an interface library for the
35 programming language Ocaml to the networking library libcurl.
38 Summary: Development files for %{name}
39 Group: Development/Libraries
40 Requires: %{name} = %{version}-%{release}
43 The %{name}-devel package contains libraries and signature files for
44 developing applications that use %{name}.
47 %setup -q -n ocurl-%{version}
54 OCBYTE="ocamlc.opt -g" \
55 OCOPT="ocamlopt.opt -g"
59 rm -rf $RPM_BUILD_ROOT
60 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
61 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
64 DESTDIR=$RPM_BUILD_ROOT
67 cp -p curl.mli $OCAMLFIND_DESTDIR/curl
69 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/curl
70 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/curl/META <<EOF
72 version = "%{version}"
74 archive(byte) = "curl.cma"
75 archive(native) = "curl.cmxa"
79 # Make clean in the examples dir so our docs don't contain binaries.
80 %{__make} -C examples clean
83 rm -rf $RPM_BUILD_ROOT
86 %defattr(644,root,root,755)
89 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so
90 %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner
92 %exclude %{_libdir}/ocaml/curl/*.a
93 %exclude %{_libdir}/ocaml/curl/*.o
94 %exclude %{_libdir}/ocaml/curl/*.cmx
95 %exclude %{_libdir}/ocaml/curl/*.cmxa
97 %exclude %{_libdir}/ocaml/curl/*.mli
100 %defattr(644,root,root,755)
102 %if %{with ocaml_opt}
103 %{_libdir}/ocaml/curl/*.a
104 %{_libdir}/ocaml/curl/*.o
105 %{_libdir}/ocaml/curl/*.cmx
106 %{_libdir}/ocaml/curl/*.cmxa
108 %{_libdir}/ocaml/curl/*.mli
109 %{_libdir}/ocaml/site-lib/curl