--- python-psycopg2.spec 2010-03-17 17:36:59.000000000 -0400 +++ python26-psycopg2.spec 2010-03-17 17:21:40.000000000 -0400 @@ -1,21 +1,23 @@ +%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])')} +%{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)")} -%define ZPsycopgDAdir %{_localstatedir}/lib/zope/Products/ZPsycopgDA - +# Fix byte-compilation: +%define __os_install_post %{__python26_os_install_post} Summary: A PostgreSQL database adapter for Python -Name: python-psycopg2 +Name: python%{pybase_ver}-psycopg2 Version: 2.0.14 -Release: 1%{?dist} +Release: 2%{?dist} Source0: http://initd.org/pub/software/psycopg/psycopg2-%{version}.tar.gz -License: GPL (with Exceptions) +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-devel postgresql-devel -Requires: postgresql-libs +BuildRequires: python%{pybase_ver}-devel postgresql-devel %description psycopg is a PostgreSQL database adapter for the Python programming @@ -33,19 +35,17 @@ Requires: %{name} = %{version}-%{release Documentation and example files for the psycopg python PostgreSQL database adapter. -%package zope -Summary: Zope Database Adapter ZPsycopgDA -Group: Applications/Databases -Requires: %{name} = %{version}-%{release} zope - -%description zope -Zope Database Adapter for PostgreSQL, called ZPsycopgDA - %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 +%{__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 @@ -53,10 +53,9 @@ for i in `find doc -iname "*.css"`; do s %install rm -Rf %{buildroot} mkdir -p %{buildroot}%{python_sitearch}/psycopg2 -python setup.py install --no-compile --root %{buildroot} - -install -d %{buildroot}%{ZPsycopgDAdir} -cp -pr ZPsycopgDA/* %{buildroot}%{ZPsycopgDAdir} +%{__python} setup.py install --no-compile --root %{buildroot} +rm doc/html/.buildinfo +rm -rf doc/src %clean rm -rf %{buildroot} @@ -69,21 +68,26 @@ rm -rf %{buildroot} %{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/ -%files zope -%defattr(-,root,root) -%dir %{ZPsycopgDAdir} -%{ZPsycopgDAdir}/*.py -%{ZPsycopgDAdir}/*.pyo -%{ZPsycopgDAdir}/*.pyc -%{ZPsycopgDAdir}/dtml/* -%{ZPsycopgDAdir}/icons/* - %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