]> git.pld-linux.org Git - packages/ocaml-curl.git/blob - ocaml-curl.spec
- moved examples to examplesdir
[packages/ocaml-curl.git] / ocaml-curl.spec
1 #
2 # Conditional build:
3 %bcond_without  ocaml_opt       # native optimized binaries (bytecode is always built)
4
5 # not yet available on x32 (ocaml 4.02.1), update 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
12 Summary:        OCaml Curl library (ocurl)
13 Summary(pl.UTF-8):      Biblioteka Curl dla OCamla (ocurl)
14 Name:           ocaml-curl
15 Version:        0.9.1
16 Release:        4
17 License:        MIT
18 Group:          Libraries
19 Source0:        https://github.com/ygrek/ocurl/releases/download/%{version}/ocurl-%{version}.tar.gz
20 # Source0-md5:  1ff6b12803fa0c6e9a4358dd29b83910
21 Patch0:         ocaml_opt.patch
22 Patch1:         %{name}-sh.patch
23 URL:            http://ocurl.forge.ocamlcore.org/
24 BuildRequires:  autoconf >= 2.50
25 BuildRequires:  curl-devel >= 7.28.0
26 BuildRequires:  gawk
27 BuildRequires:  ocaml >= 3.10.0-7
28 BuildRequires:  ocaml-findlib-devel
29 BuildRequires:  ocaml-lwt-devel
30 BuildRequires:  ocaml-lwt-ppx-devel
31 BuildRequires:  pkgconfig
32 # Explicitly require Curl (fixes RHBZ#711261). Since ocaml-curl uses
33 # -custom rather than ocamlmklib, automatic detection is infeasible.
34 Requires:       curl-devel >= 7.28.0
35 %requires_eq    ocaml-runtime
36 ExcludeArch:    sparc64 s390 s390x
37 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
38
39 %description
40 The Ocaml Curl Library (Ocurl) is an interface library for the
41 programming language Ocaml to the networking library libcurl.
42
43 %description -l pl.UTF-8
44 Biblioteka Ocaml Curl (Ocurl) to biblioteka interfejsu języka
45 programowania Ocaml do biblioteki sieciowe libcurl.
46
47 %package devel
48 Summary:        OCaml Curl library (ocurl) - development part
49 Summary(pl.UTF-8):      Biblioteka Curl dla OCamla (ocurl) - część programistyczna
50 Group:          Development/Libraries
51 Requires:       %{name} = %{version}-%{release}
52
53 %description devel
54 This package contains libraries and signature files for developing
55 applications that use OCaml Curl library.
56
57 %description devel -l pl.UTF-8
58 Ten pakiet zawiera biblioteki i pliki sygnatur do tworzenia aplikacji
59 z użyciem biblioteki OCamla Curl.
60
61 %prep
62 %setup -q -n ocurl-%{version}
63 %patch0 -p1
64 %patch1 -p1
65
66 %build
67 %{__autoconf}
68 %configure
69 %{__make} -j1 all
70
71 %install
72 rm -rf $RPM_BUILD_ROOT
73
74 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
75 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
76
77 %{__make} install \
78         DESTDIR=$RPM_BUILD_ROOT
79
80 # Install curl.mli
81 cp -p curl.mli $OCAMLFIND_DESTDIR/curl
82
83 cat > $RPM_BUILD_ROOT%{_libdir}/ocaml/curl/META <<EOF
84 requires = ""
85 version = "%{version}"
86 directory = "+curl"
87 archive(byte) = "curl.cma"
88 archive(native) = "curl.cmxa"
89 linkopts = ""
90 EOF
91
92 # useless in rpm
93 %{__rm} $RPM_BUILD_ROOT%{_libdir}/ocaml/stublibs/*.so.owner
94
95 # Make clean in the examples dir so our docs don't contain binaries.
96 %{__make} -C examples clean
97 install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
98 cp -p examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
99
100 %clean
101 rm -rf $RPM_BUILD_ROOT
102
103 %files
104 %defattr(644,root,root,755)
105 %doc COPYING
106 %dir %{_libdir}/ocaml/curl
107 %{_libdir}/ocaml/curl/META
108 %{_libdir}/ocaml/curl/*.cma
109 %if %{with ocaml_opt}
110 %attr(755,root,root) %{_libdir}/ocaml/curl/*.cmxs
111 %endif
112 %attr(755,root,root) %{_libdir}/ocaml/stublibs/dllcurl-helper.so
113
114 %files devel
115 %defattr(644,root,root,755)
116 %{_libdir}/ocaml/curl/libcurl-helper.a
117 %{_libdir}/ocaml/curl/*.cmi
118 %{_libdir}/ocaml/curl/*.cmo
119 %{_libdir}/ocaml/curl/*.cmt
120 %{_libdir}/ocaml/curl/*.cmti
121 %{_libdir}/ocaml/curl/*.mli
122 %if %{with ocaml_opt}
123 %{_libdir}/ocaml/curl/curl*.a
124 %{_libdir}/ocaml/curl/*.cmx
125 %{_libdir}/ocaml/curl/*.cmxa
126 %{_libdir}/ocaml/curl/*.o
127 %endif
128 %{_examplesdir}/%{name}-%{version}
This page took 0.072017 seconds and 4 git commands to generate.