%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-foolib Version: 1.2.3 Release: 1%{?dist} Summary: OCaml library for fooing bars Group: Development/Libraries License: LGPL URL: http://www.example.com/foolib Source0: http://www.example.com/foolib-1.2.3.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ocaml, ocaml-findlib-devel %define _use_internal_dependency_generator 0 %define __find_requires /usr/lib/rpm/ocaml-find-requires.sh %define __find_provides /usr/lib/rpm/ocaml-find-provides.sh %description OCaml library for fooing bars. This library can also foo bazes. %package devel Summary: Development files for %{name} Group: Development/Libraries Requires: %{name} = %{version}-%{release} %description devel The %{name}-devel package contains libraries and signature files for developing applications that use %{name}. %prep %setup -q -n foolib-%{version} # You may need a ./configure step here. %build make byte %if %opt make opt %endif %install # These rules work if the library uses 'ocamlfind install' to install itself. rm -rf $RPM_BUILD_ROOT export DESTDIR=$RPM_BUILD_ROOT export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml mkdir -p $OCAMLFIND_DESTDIR $OCAMLFIND_DESTDIR/stublibs make install %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc README %{_libdir}/ocaml/foolib %if %opt %exclude %{_libdir}/ocaml/foolib/*.a %exclude %{_libdir}/ocaml/foolib/*.cmxa %exclude %{_libdir}/ocaml/foolib/*.cmx %endif %exclude %{_libdir}/ocaml/foolib/*.mli %{_libdir}/ocaml/stublibs/*.so %{_libdir}/ocaml/stublibs/*.so.owner %files devel %defattr(-,root,root,-) %doc README %if %opt %{_libdir}/ocaml/foolib/*.a %{_libdir}/ocaml/foolib/*.cmxa %{_libdir}/ocaml/foolib/*.cmx %endif %{_libdir}/ocaml/foolib/*.mli %changelog * Sat May 26 2007 Your Name - 1.2.3-1 - Initial RPM release.