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 %define module %{module}
11 Summary: %{module} binding for OCaml
12 Summary(pl.UTF-8): Wiązania %{module} dla OCamla
16 License: - (enter GPL/LGPL/BSD/BSD-like/other license name here)
18 Source0: %{module}-%{version}.tar.gz
21 #BuildRequires: -devel
22 BuildRequires: ocaml >= 3.04-7
23 %requires_eq ocaml-runtime
24 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
26 %define debug_package %{nil}
27 %if %{without ocaml_opt}
28 %define no_install_post_strip 1
29 # no opt means no native binary, stripping bytecode breaks such programs
30 %define _enable_debug_packages 0
34 This package contains files needed to run bytecode executables using
37 %description -l pl.UTF-8
38 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
39 używających biblioteki TEMPLATE.
42 Summary: TEMPLATE binding for OCaml - development part
43 Summary(pl.UTF-8): Wiązania TEMPLATE dla OCamla - cześć programistyczna
44 Group: Development/Libraries
45 Requires: %{name} = %{version}-%{release}
49 This package contains files needed to develop OCaml programs using
52 %description devel -l pl.UTF-8
53 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
57 %setup -q -n %{module}-%{version}
60 %{__make} -j1 all %{?with_ocaml_opt:opt} \
61 CC="%{__cc} %{rpmcflags} -fPIC"
64 rm -rf $RPM_BUILD_ROOT
65 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
66 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
68 DESTDIR=$RPM_BUILD_ROOT
70 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
71 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
73 # move to dir pld ocamlfind looks
74 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
75 mv $OCAMLFIND_DESTDIR/%{module}/META \
76 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
77 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
78 directory="+%{module}"
82 rm -rf $RPM_BUILD_ROOT
85 %defattr(644,root,root,755)
86 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
87 %dir %{_libdir}/ocaml/%{module}
88 %{_libdir}/ocaml/%{module}/*.cma
90 %attr(755,root,root) %{_libdir}/ocaml/%{module}/*.cmxs
94 %defattr(644,root,root,755)
96 %{_libdir}/ocaml/%{module}/*.cmi
97 %{_libdir}/ocaml/%{module}/*.cmo
98 %{_libdir}/ocaml/%{module}/*.mli
100 %{_libdir}/ocaml/%{module}/*.[ao]
101 %{_libdir}/ocaml/%{module}/*.cmx
102 %{_libdir}/ocaml/%{module}/*.cmxa
104 %{_libdir}/ocaml/site-lib/%{module}
105 %{_examplesdir}/%{name}-%{version}