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