%define __python /usr/bin/python2.6 %define pybase_ver 26 # Python major version. %{expand: %%define pyver %(%{__python} -c 'import sys;print(sys.version[0:3])')} %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")} # Fix byte-compilation: %define __os_install_post %{__python26_os_install_post} Summary: A PostgreSQL database adapter for Python Name: python%{pybase_ver}-psycopg2 Version: 2.0.14 Release: 2%{?dist} Source0: http://initd.org/pub/software/psycopg/psycopg2-%{version}.tar.gz License: LGPLv3+ with exceptions Group: Applications/Databases BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Url: http://www.initd.org/software/initd/psycopg BuildRequires: python%{pybase_ver}-devel postgresql-devel %description psycopg is a PostgreSQL database adapter for the Python programming language (just like pygresql and popy.) It was written from scratch with the aim of being very small and fast, and stable as a rock. The main advantages of psycopg are that it supports the full Python DBAPI-2.0 and being thread safe at level 2. %package doc Summary: Documentation for psycopg python PostgreSQL database adapter Group: Documentation Requires: %{name} = %{version}-%{release} %description doc Documentation and example files for the psycopg python PostgreSQL database adapter. %prep %setup -q -n psycopg2-%{version} # Fix encoding of doc/ChangeLog-1.x, preserving timestamp: iconv --from=ISO-8859-1 --to=UTF-8 doc/ChangeLog-1.x > doc/ChangeLog-1.x.new && \ touch -r doc/ChangeLog-1.x doc/ChangeLog-1.x.new && \ mv doc/ChangeLog-1.x.new doc/ChangeLog-1.x %build %{__python} setup.py build # Fix for wrong-file-end-of-line-encoding problem; upstream also must fix this. for i in `find doc -iname "*.html"`; do sed -i 's/\r//' $i; done for i in `find doc -iname "*.css"`; do sed -i 's/\r//' $i; done %install rm -Rf %{buildroot} mkdir -p %{buildroot}%{python_sitearch}/psycopg2 %{__python} setup.py install --no-compile --root %{buildroot} rm doc/html/.buildinfo rm -rf doc/src %clean rm -rf %{buildroot} %files %defattr(-,root,root) %doc AUTHORS ChangeLog INSTALL LICENSE README %dir %{python_sitearch}/psycopg2 %{python_sitearch}/psycopg2/*.py %{python_sitearch}/psycopg2/*.pyc %{python_sitearch}/psycopg2/*.so %{python_sitearch}/psycopg2/*.pyo %{python_sitearch}/psycopg2-*-py2.6.egg-info %files doc %defattr(-,root,root) %doc doc examples/ %changelog * Wed Mar 17 2010 David Malcolm - 2.0.14-2 - initial version for python26 in EPEL5, based on python-psycopg2-2.0.14-1.el5 in EPEL5 - define __python macro to use python2.6 and use it to replace python invocations throughout - fix byte-compilation to use 2.6 - drop zope subpackage for now, as the python26 stack doesn't have zope - list the egg-info file in the manifest - remove explicit dependency on postgresql-libs; rpm adds this for us - don't ship the .buildinfo file in the docs, or the tools for the docs - fix encoding of doc/ChangeLog-1.x, preserving timestamp - update license metadata * Wed Mar 17 2010 Devrim GUNDUZ - 2.0.14-1 - Update to 2.0.14 * Sun Oct 18 2009 Devrim GUNDUZ - 2.0.13-1 - Update to 2.0.13 * Tue May 19 2009 Devrim GUNDUZ - 2.0.11-1 - Update to 2.0.11 * Tue Apr 21 2009 Devrim GUNDUZ - 2.0.10-1 - Update to 2.0.10 * Fri Mar 20 2009 Devrim GUNDUZ - 2.0.9-1 - Update to 2.0.9 * Tue Dec 16 2008 Devrim GUNDUZ 2.0.8-1 - Update to 2.0.8 * Wed Apr 30 2008 Devrim GUNDUZ 2.0.7-1 - Update to 2.0.7 * Fri Jun 15 2007 - Devrim GUNDUZ 2.0.6-1 - Update to 2.0.6 * Sun May 06 2007 Thorsten Leemhuis - rebuilt for RHEL5 final * Wed Dec 6 2006 - Devrim GUNDUZ 2.0.5.1-4 - Rebuilt for PostgreSQL 8.2.0 * Mon Sep 11 2006 - Devrim GUNDUZ 2.0.5.1-3 - Rebuilt * Wed Sep 6 2006 - Devrim GUNDUZ 2.0.5.1-2 - Remove ghost'ing, per Python Packaging Guidelines * Mon Sep 4 2006 - Devrim GUNDUZ 2.0.5.1-1 - Update to 2.0.5.1 * Sun Aug 6 2006 - Devrim GUNDUZ 2.0.3-3 - Fixed zope package dependencies and macro definition, per bugzilla review (#199784) - Fixed zope package directory ownership, per bugzilla review (#199784) - Fixed cp usage for zope subpackage, per bugzilla review (#199784) * Mon Jul 31 2006 - Devrim GUNDUZ 2.0.3-2 - Fixed 64 bit builds - Fixed license - Added Zope subpackage - Fixed typo in doc description - Added macro for zope subpackage dir * Mon Jul 31 2006 - Devrim GUNDUZ 2.0.3-1 - Update to 2.0.3 - Fixed spec file, per bugzilla review (#199784) * Sat Jul 22 2006 - Devrim GUNDUZ 2.0.2-3 - Removed python dependency, per bugzilla review. (#199784) - Changed doc package group, per bugzilla review. (#199784) - Replaced dos2unix with sed, per guidelines and bugzilla review (#199784) - Fix changelog dates * Sat Jul 21 2006 - Devrim GUNDUZ 2.0.2-2 - Added dos2unix to buildrequires - removed python related part from package name * Fri Jul 20 2006 - Devrim GUNDUZ 2.0.2-1 - Fix rpmlint errors, including dos2unix solution - Re-engineered spec file * Fri Jan 23 2006 - Devrim GUNDUZ - First 2.0.X build * Fri Jan 23 2006 - Devrim GUNDUZ - Update to 1.2.21 * Tue Dec 06 2005 - Devrim GUNDUZ - Initial release for 1.1.20