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 Summary(pl.UTF-8): Biblioteka Curl dla OCamla (ocurl)
14 Name: ocaml-%{pkgname}
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
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)
37 The Ocaml Curl Library (Ocurl) is an interface library for the
38 programming language Ocaml to the networking library libcurl.
40 %description -l pl.UTF-8
41 Biblioteka Ocaml Curl (Ocurl) to biblioteka interfejsu języka
42 programowania Ocaml do biblioteki sieciowe libcurl.
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}
51 This package contains libraries and signature files for developing
52 applications that use OCaml Curl library.
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.
59 %setup -q -n ocurl-%{version}
67 rm -rf $RPM_BUILD_ROOT
69 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
70 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
73 DESTDIR=$RPM_BUILD_ROOT
76 cp -p curl.mli $OCAMLFIND_DESTDIR/curl
78 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/curl/META <<EOF
80 version = "%{version}"
82 archive(byte) = "curl.cma"
83 archive(native) = "curl.cmxa"
87 # Make clean in the examples dir so our docs don't contain binaries.
88 %{__make} -C examples clean
91 rm -rf $RPM_BUILD_ROOT
94 %defattr(644,root,root,755)
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
106 %defattr(644,root,root,755)
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
117 %{_libdir}/ocaml/curl/*.mli