%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-sqlite Version: 0.23.0 Release: 2%{?dist} Summary: OCaml library for accessing SQLite3 databases Group: Development/Libraries License: BSD URL: http://www.ocaml.info/home/ocaml_sources.html Source0: http://www.ocaml.info/ocaml_sources/ocaml-sqlite3-%{version}.tar.bz2 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) ExcludeArch: ppc64 Patch0: ocaml-sqlite-debian-install-no-mktop.patch BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-camlp4-devel BuildRequires: sqlite-devel >= 3 BuildRequires: chrpath %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 SQLite 3 database library wrapper for OCaml. %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 ocaml-sqlite3-%{version} %patch0 -p1 ./configure --libdir=%{_libdir} %build make all %check pushd test for f in test_db test_exec test_stmt test_fun; do ocamlopt -I .. str.cmxa sqlite3.cmxa $f.ml -o $f ./$f done popd %install 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 strip $OCAMLFIND_DESTDIR/stublibs/dll*.so chrpath --delete $OCAMLFIND_DESTDIR/stublibs/dll*.so %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING %{_libdir}/ocaml/sqlite3 %if %opt %exclude %{_libdir}/ocaml/sqlite3/*.a %exclude %{_libdir}/ocaml/sqlite3/*.cmxa %exclude %{_libdir}/ocaml/sqlite3/*.cmx %endif %exclude %{_libdir}/ocaml/sqlite3/*.mli %{_libdir}/ocaml/stublibs/*.so %{_libdir}/ocaml/stublibs/*.so.owner %files devel %defattr(-,root,root,-) %doc COPYING CHANGES doc README TODO VERSION %if %opt %{_libdir}/ocaml/sqlite3/*.a %{_libdir}/ocaml/sqlite3/*.cmxa %{_libdir}/ocaml/sqlite3/*.cmx %endif %{_libdir}/ocaml/sqlite3/*.mli %changelog * Fri Feb 29 2008 Richard W.M. Jones - 0.23.0-2 - Added BR ocaml-camlp4-devel. * Sun Feb 24 2008 Richard W.M. Jones - 0.23.0-1 - Initial RPM release.