%define opt %(test -x %{_bindir}/ocamlopt && echo 1 || echo 0)
%define debug_package %{nil}
Name: ocaml-pgocaml
Version: 1.4
Release: 1%{?dist}
Summary: OCaml library for type-safe access to PostgreSQL databases
Group: Development/Libraries
License: LGPLv2+ with exceptions
URL: http://developer.berlios.de/projects/pgocaml/
Source0: http://download.berlios.de/pgocaml/pgocaml-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
ExcludeArch: sparc64 s390 s390x
BuildRequires: ocaml >= 3.10.0
BuildRequires: ocaml-findlib-devel, ocaml-ocamldoc
BuildRequires: ocaml-extlib-devel
BuildRequires: ocaml-pcre-devel, pcre-devel
BuildRequires: ocaml-calendar-devel >= 2.01.1-2
BuildRequires: ocaml-csv-devel
BuildRequires: ocaml-camlp4-devel
# The find-requires/provides scripts don't understand the packed
# CalendarLib module well. Ignore the packed submodules.
%define _use_internal_dependency_generator 0
%define __find_requires /usr/lib/rpm/ocaml-find-requires.sh -i Asttypes -i Calendar_builder -i Calendar_sig -i Date -i Date_sig -i Fcalendar -i Ftime -i Parsetree -i Period -i Printer -i Time -i Time_sig -i Time_Zone -i Utils -i Version
%define __find_provides /usr/lib/rpm/ocaml-find-provides.sh
%description
PG'OCaml is a type-safe, simple interface to PostgreSQL from OCaml. It
lets you embed SQL statements directly into OCaml code.
%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 pgocaml-%{version}
%build
make depend
make all
make doc
strip pgocaml_prof
%install
rm -rf $RPM_BUILD_ROOT
export DESTDIR=$RPM_BUILD_ROOT
export OCAMLFIND_DESTDIR=$RPM_BUILD_ROOT%{_libdir}/ocaml
mkdir -p $OCAMLFIND_DESTDIR
ocamlfind install pgocaml META *.mli *.cmi *.cmx *.cma *.cmxa *.a pa_*.cmo
mkdir -p $RPM_BUILD_ROOT%{_bindir}
install -m 0755 pgocaml_prof $RPM_BUILD_ROOT%{_bindir}
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc COPYING.LIB
%{_libdir}/ocaml/pgocaml
%if %opt
%exclude %{_libdir}/ocaml/pgocaml/*.a
%exclude %{_libdir}/ocaml/pgocaml/*.cmxa
%exclude %{_libdir}/ocaml/pgocaml/*.cmx
%endif
%exclude %{_libdir}/ocaml/pgocaml/*.mli
%{_bindir}/pgocaml_prof
%files devel
%defattr(-,root,root,-)
%doc README.txt README.profiling BUGS.txt CONTRIBUTORS.txt COPYING.LIB HOW_IT_WORKS.txt html/*
%if %opt
%{_libdir}/ocaml/pgocaml/*.a
%{_libdir}/ocaml/pgocaml/*.cmxa
%{_libdir}/ocaml/pgocaml/*.cmx
%endif
%{_libdir}/ocaml/pgocaml/*.mli
%changelog
* Thu Jan 6 2011 Richard W.M. Jones <rjones@redhat.com> - 1.4-1
- New upstream version 1.4.
- Rebuild for OCaml 3.12.0.
* Wed Dec 30 2009 Richard W.M. Jones <rjones@redhat.com> - 1.3-2
- Rebuild for OCaml 3.11.2.
* Thu Oct 8 2009 Richard W.M. Jones <rjones@redhat.com> - 1.3-1
- New upstream version 1.3.
- Simplify build system.
* Sat Jul 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sat May 23 2009 Richard W.M. Jones <rjones@redhat.com> - 1.1-9
- Rebuild for OCaml 3.11.1
* Thu Apr 16 2009 S390x secondary arch maintainer <fedora-s390x@lists.fedoraproject.org>
- ExcludeArch sparc64, s390, s390x as we don't have OCaml on those archs
(added sparc64 per request from the sparc maintainer)
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Fri Dec 5 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-7
- Rebuild for OCaml 3.11.0.
* Wed Nov 26 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-6
- Rebuild for OCaml 3.11.0+rc1.
* Wed Nov 19 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-5
- Rebuild for OCaml 3.11.0
* Thu Jul 10 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-4
- Rebuild against ocaml-calendar 2.0.4
* Tue Jul 1 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-3
- Ignore Parsetree dep.
- Bump release to -3 to solve EVR problems with F-9.
* Tue Mar 4 2008 Richard W.M. Jones <rjones@redhat.com> - 1.1-1
- New upstream release 1.1.
- Clarify license is LGPLv2+ with exceptions.
- New home page and download URL.
* Mon Mar 3 2008 Richard W.M. Jones <rjones@redhat.com> - 0.9-5
- Ignore modules which are really submodules of CalendarLib.
* Sat Mar 1 2008 Richard W.M. Jones <rjones@redhat.com> - 0.9-4
- Add missing BR for ocaml-camlp4-devel.
- Add missing BR for pcre-devel.
- Check it builds in mock.
* Sat Feb 23 2008 Richard W.M. Jones <rjones@redhat.com> - 0.9-3
- Check it builds with OCaml 3.10.1
- Only keep license file in main package.
- Clarify license is LGPLv2 with exceptions.
* Mon Sep 3 2007 Richard W.M. Jones <rjones@redhat.com> - 0.9-2
- Added the syntax extension.
* Mon Sep 3 2007 Richard W.M. Jones <rjones@redhat.com> - 0.9-1
- Initial RPM release.