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