3 %bcond_without ocaml_opt # skip building native optimized binaries (bytecode is always built)
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
10 %if %{without ocaml_opt}
11 %define _enable_debug_packages 0
14 %define module %{module}
15 Summary: %{module} binding for OCaml
16 Summary(pl.UTF-8): Wiązania %{module} dla OCamla
20 License: - (enter GPL/LGPL/BSD/BSD-like/other license name here)
22 Source0: %{module}-%{version}.tar.gz
25 #BuildRequires: -devel
26 BuildRequires: ocaml >= 3.04-7
27 %requires_eq ocaml-runtime
28 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
30 %define debug_package %{nil}
31 %if %{without ocaml_opt}
32 %define no_install_post_strip 1
33 # no opt means no native binary, stripping bytecode breaks such programs
34 %define _enable_debug_packages 0
38 This package contains files needed to run bytecode executables using
41 %description -l pl.UTF-8
42 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
43 używających biblioteki TEMPLATE.
46 Summary: TEMPLATE binding for OCaml - development part
47 Summary(pl.UTF-8): Wiązania TEMPLATE dla OCamla - cześć programistyczna
48 Group: Development/Libraries
49 Requires: %{name} = %{version}-%{release}
53 This package contains files needed to develop OCaml programs using
56 %description devel -l pl.UTF-8
57 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
61 %setup -q -n %{module}-%{version}
64 %{__make} -j1 all %{?with_ocaml_opt:opt} \
65 CC="%{__cc} %{rpmcflags} -fPIC"
68 rm -rf $RPM_BUILD_ROOT
69 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
70 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
72 DESTDIR=$RPM_BUILD_ROOT
74 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
75 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
77 # move to dir pld ocamlfind looks
78 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
79 mv $OCAMLFIND_DESTDIR/%{module}/META \
80 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
81 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
82 directory="+%{module}"
86 rm -rf $RPM_BUILD_ROOT
89 %defattr(644,root,root,755)
90 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
91 %dir %{_libdir}/ocaml/%{module}
92 %{_libdir}/ocaml/%{module}/*.cma
94 %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs
98 %defattr(644,root,root,755)
100 %{_libdir}/ocaml/%{module}/*.cmi
101 %{_libdir}/ocaml/%{module}/*.cmo
102 %{_libdir}/ocaml/%{module}/*.mli
103 %if %{with ocaml_opt}
104 %{_libdir}/ocaml/%{module}/*.[ao]
105 %{_libdir}/ocaml/%{module}/*.cmx
106 %{_libdir}/ocaml/%{module}/*.cmxa
108 %{_libdir}/ocaml/site-lib/%{module}
109 %{_examplesdir}/%{name}-%{version}