%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0) %define debug_package %{nil} Name: ocaml-mysql Version: 1.0.4 Release: 2%{?dist} Summary: OCaml library for accessing MySQL databases Group: Development/Libraries License: LGPLv2+ with exceptions URL: http://raevnos.pennmush.org/code/ocaml-mysql/ Source0: http://raevnos.pennmush.org/code/ocaml-mysql/ocaml-mysql-%{version}.tar.gz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: ocaml >= 3.10.0 BuildRequires: ocaml-findlib-devel BuildRequires: ocaml-ocamldoc BuildRequires: ocaml-camlp4-devel BuildRequires: mysql-devel 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 ocaml-mysql is a package for ocaml that provides access to mysql databases. It consists of low level functions implemented in C and a module Mysql intended for application development. %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 ./configure --libdir=%{_libdir} %build make %if %opt make opt %endif strip dll*.so chrpath --delete dll*.so %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 %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc COPYING %{_libdir}/ocaml/mysql %if %opt %exclude %{_libdir}/ocaml/mysql/*.a %exclude %{_libdir}/ocaml/mysql/*.cmxa %exclude %{_libdir}/ocaml/mysql/*.cmx %endif %exclude %{_libdir}/ocaml/mysql/*.mli %{_libdir}/ocaml/stublibs/*.so %{_libdir}/ocaml/stublibs/*.so.owner %files devel %defattr(-,root,root,-) %doc COPYING CHANGES doc/html README VERSION %if %opt %{_libdir}/ocaml/mysql/*.a %{_libdir}/ocaml/mysql/*.cmxa %{_libdir}/ocaml/mysql/*.cmx %endif %{_libdir}/ocaml/mysql/*.mli %changelog * Mon Mar 3 2008 Richard W.M. Jones - 1.0.4-2 - Don't need 'ExcludeArch: ppc64' any more. - Add missing BR for ocaml-camlp4-devel. - Test build in mock. * Sun Feb 24 2008 Richard W.M. Jones - 1.0.4-1 - Initial RPM release.