3 %bcond_without ocaml_opt # build opt
6 # not yet available on x32 (ocaml 4.02.1), remove when upstream will support it
7 %undefine▸ with_ocaml_opt
10 %if %{without ocaml_opt}
11 %define▸▸ no_install_post_strip▸ 1
12 # no opt means no native binary, stripping bytecode breaks such programs
13 %define▸▸ _enable_debug_packages▸ 0
16 %define module %{module}
17 Summary: %{module} binding for OCaml
18 Summary(pl.UTF-8): Wiązania %{module} dla OCamla
22 License: - (enter GPL/LGPL/BSD/BSD-like/other license name here)
24 Source0: %{module}-%{version}.tar.gz
27 #BuildRequires: -devel
28 BuildRequires: ocaml >= 3.04-7
29 %requires_eq ocaml-runtime
30 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
32 %define debug_package %{nil}
35 This package contains files needed to run bytecode executables using
38 %description -l pl.UTF-8
39 Pakiet ten zawiera binaria potrzebne do uruchamiania programów
40 używających tej biblioteki.
43 Summary: TEMPLATE binding for OCaml - development part
44 Summary(pl.UTF-8): Wiązania TEMPLATE dla OCamla - cześć programistyczna
45 Group: Development/Libraries
46 Requires: %{name} = %{version}-%{release}
50 This package contains files needed to develop OCaml programs using
53 %description devel -l pl.UTF-8
54 Pakiet ten zawiera pliki niezbędne do tworzenia programów używających
58 %setup -q -n %{module}-%{version}
61 %{__make} -j1 all %{?with_ocaml_opt:opt} \
62 CC="%{__cc} %{rpmcflags} -fPIC"
65 rm -rf $RPM_BUILD_ROOT
66 export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
67 install -d $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs
69 DESTDIR=$RPM_BUILD_ROOT
71 #install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
72 #cp -r foo bar $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
74 # move to dir pld ocamlfind looks
75 install -d $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
76 mv $OCAMLFIND_DESTDIR/%{module}/META \
77 $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}
78 cat <<EOF >> $RPM_BUILD_ROOT%{_libdir}/ocaml/site-lib/%{module}/META
79 directory="+%{module}"
83 rm -rf $RPM_BUILD_ROOT
86 %defattr(644,root,root,755)
87 %attr(755,root,root) %{_libdir}/ocaml/stublibs/*.so
90 %defattr(644,root,root,755)
92 %{_libdir}/ocaml/%{module}/*.cm[xi]
93 %{_libdir}/ocaml/%{module}/*.cmo
94 %{_libdir}/ocaml/%{module}/*.mli
96 %{_libdir}/ocaml/%{module}/*.[ao]
97 %{_libdir}/ocaml/%{module}/*.cmxa
99 %{_libdir}/ocaml/site-lib/%{module}
100 %{_examplesdir}/%{name}-%{version}