%define name pyPgSQL %define version 2.4 %define release 3mdk # automatically set GCC flags based on version %{expand:%%define gccmajorvers %(gcc -v 2>&1 | tail -1 | awk '{ print $3 }' | awk -F. '{ print $1 }')} %if %{gccmajorvers} >= 3 %define cflags -std=c99 $RPM_OPT_FLAGS %else %define cflags $RPM_OPT_FLAGS %endif Summary: pyPgSQL - A Python DB-API 2.0 compliant interface to PostgreSQL. Name: %{name} Version: %{version} Release: %{release} Source: http://telia.dl.sourceforge.net/sourceforge/pypgsql/%name-%{version}.tar.bz2 Patch: pypgsql-2.3-mdk.patch.bz2 License: BSD Group: Development/Python BuildRoot: %{_tmppath}/%{name}-buildroot Url: http://pypgsql.sourceforge.net/ Requires: egenix-mx-base , python >= 2.2 , postgresql BuildPrereq: python-devel , postgresql-devel %description pyPgSQL is a package of two modules that provide a Python DB-API 2.0 compliant interface to PostgreSQL databases. The first module, libpq, exports the PostgreSQL C API to Python. This module is written in C and can be compiled into Python or can be dynamically loaded on demand. The second module, PgSQL, provides the DB-API 2.0 compliant interface and support for various PostgreSQL data types, such as INT8, NUMERIC, MONEY, BOOL, ARRAYS, etc. This module is written in Python. %prep rm -rf $RPM_BUILD_ROOT %setup -n pypgsql %patch -p1 %build env CFLAGS="%{cflags}" /usr/bin/python setup.py build # change the path in the test/examples find test examples -type f | while read file do echo "Fixing path in $file" sed -i 's|^#!.*|#!/usr/bin/env python|' $file done %install # remove CVS files find . -type d -name CVS | xargs rm -rf %_bindir/python setup.py install --root=$RPM_BUILD_ROOT %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc README Announce ChangeLog %doc examples test %_libdir/python%pyver/site-packages/%{name} %changelog * Mon May 09 2005 Buchan Milne <bgmilne@linux-mandrake.com> 2.4-3mdk - Rebuild for postgresql-devel 8.0.2 * Sun Dec 05 2004 Michael Scherer <misc@mandrake.org> 2.4-2mdk - Rebuild for new python * Mon Sep 22 2003 Lenny Cartier <lenny@mandrakesoft.com> 2.4-1mdk - 2.4 - fix buildrequires * Thu May 15 2003 Lenny Cartier <lenny@mandrakesoft.com> 2.3-3mdk - use -p1 for patch - fix files list - from Michael Bonert <bonerti@mie.utoronto.ca> : - Changed compression of source files from 'gz' to 'bz2' - Changed "#!/usr/bin/env python2" to "#!/usr/bin/env python" in "Fixing path" section * Tue Apr 08 2003 Michael Bonert <bonerti@mie.utoronto.ca> 2.3-2mdk - Implemented Patch for Mandrake Linux systems RPM based on "pyPgSQL-2.3-1.src.rpm" released by pyPgSQL developers