355d4eff29d36ac0891aa8b1d27d4f67ee07889a
[packages/ocaml-curl.git] / ocaml-curl.spec
1 #
2 # Conditional build:
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
9
10 %define debug_package %{nil}
11 %define pkgname curl
12 Summary:        OCaml Curl library (ocurl)
13 Name:           ocaml-%{pkgname}
14 Version:        0.9.1
15 Release:        1
16 License:        MIT
17 Group:          Libraries
18 Source0:        https://github.com/ygrek/ocurl/releases/download/%{version}/ocurl-%{version}.tar.gz
19 # Source0-md5:  1ff6b12803fa0c6e9a4358dd29b83910
20 Patch0:         ocaml_opt.patch
21 URL:            http://ocurl.forge.ocamlcore.org/
22 BuildRequires:  curl-devel >= 7.12.0
23 BuildRequires:  gawk
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)
32
33 %description
34 The Ocaml Curl Library (Ocurl) is an interface library for the
35 programming language Ocaml to the networking library libcurl.
36
37 %package devel
38 Summary:        Development files for %{name}
39 Group:          Development/Libraries
40 Requires:       %{name} = %{version}-%{release}
41
42 %description devel
43 The %{name}-devel package contains libraries and signature files for
44 developing applications that use %{name}.
45
46 %prep
47 %setup -q -n ocurl-%{version}
48 %patch0 -p1
49
50 %build
51 %configure
52 %{__make} -j1 all
53
54 %install
55 rm -rf $RPM_BUILD_ROOT
56 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
57 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
58
59 %{__make} install \
60         DESTDIR=$RPM_BUILD_ROOT
61
62 # Install curl.mli
63 cp -p curl.mli $OCAMLFIND_DESTDIR/curl
64
65 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/curl/META <<EOF
66 requires = ""
67 version = "%{version}"
68 directory = "+curl"
69 archive(byte) = "curl.cma"
70 archive(native) = "curl.cmxa"
71 linkopts = ""
72 EOF
73
74 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/curl
75 ln -sr $RPM_BUILD_ROOT%{_libdir}/ocaml/{curl,site-lib/curl}/META
76
77 # Make clean in the examples dir so our docs don't contain binaries.
78 %{__make} -C examples clean
79
80 %clean
81 rm -rf $RPM_BUILD_ROOT
82
83 %files
84 %defattr(644,root,root,755)
85 %doc COPYING
86 %{_libdir}/ocaml/curl
87 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so
88 %{_libdir}/ocaml/stublibs/dllcurl-helper.so.owner
89 %if %{with ocaml_opt}
90 %exclude %{_libdir}/ocaml/curl/*.a
91 %exclude %{_libdir}/ocaml/curl/*.cmxa
92 %endif
93 %exclude %{_libdir}/ocaml/curl/*.mli
94
95 %files devel
96 %defattr(644,root,root,755)
97 %doc examples/*
98 %if %{with ocaml_opt}
99 %{_libdir}/ocaml/curl/*.a
100 %{_libdir}/ocaml/curl/*.cmxa
101 %endif
102 %{_libdir}/ocaml/curl/*.mli
103 %{_libdir}/ocaml/site-lib/curl
This page took 0.08033 seconds and 3 git commands to generate.