-cat > $RPM_BUILD_ROOT%{_libdir}/%{name}/ld.conf <<EOF
-%{_libdir}/%{name}/stublibs
-%{_libdir}/%{name}
-EOF
-
-%if %{with emacs}
-%{__make} -C emacs DESTDIR=$RPM_BUILD_ROOT install \
- EMACS="`if [ -x %{_bindir}/emacs ]; then echo emacs; \
- else echo xemacs; fi`" \
- EMACSDIR="$RPM_BUILD_ROOT%{_datadir}/emacs/site-lisp"
-%endif
-
-# symlink .opt versions of compilers (if present)
-# warning: don't do that with camlp4 (can't load extensions then)
-for f in ocamlc ocamlopt ocamldoc ocamllex; do
- if test -f $RPM_BUILD_ROOT%{_bindir}/$f.opt; then
- mv -f $RPM_BUILD_ROOT%{_bindir}/$f \
- $RPM_BUILD_ROOT%{_bindir}/$f.byte
- ln -sf %{_bindir}/$f.opt $RPM_BUILD_ROOT%{_bindir}/$f
- fi
-done
-
-# move includes to the proper place
-mv -f $RPM_BUILD_ROOT%{_libdir}/%{name}/caml $RPM_BUILD_ROOT%{_includedir}/caml
-# but leave compatibility symlink
-ln -s ../../include/caml $RPM_BUILD_ROOT%{_libdir}/%{name}/caml
-
-# compiled sources of compiler, needed by some programs
-for f in {asm,byte}comp parsing typing utils ; do
- install -d $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
- cp $f/*.{cmi,cmo,cmx,o} $RPM_BUILD_ROOT%{_libdir}/%{name}/compiler/$f
-done
-
-# this isn't installed by default, but is useful
-install tools/objinfo $RPM_BUILD_ROOT%{_bindir}/ocamlobjinfo
-cp -r examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
-cp -r otherlibs/labltk/examples* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-labltk-%{version}
-ln -sf %{_libdir}/%{name}/{scrape,add}labels $RPM_BUILD_ROOT%{_bindir}
-
-# shutup checkfiles
-rm -rf $RPM_BUILD_ROOT%{_mandir}/man3
-rm -f $RPM_BUILD_ROOT%{_libdir}/%{name}/labltk/{labltktop,pp}
-
-# install info pages
-cp -f infoman/*.gz $RPM_BUILD_ROOT%{_infodir}
-