Browse Source

update psycopg{1,2}

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@2351 ec354946-7b23-47d6-9f5a-488ba84defc7
owa 14 years ago
parent
commit
d0b202b98b
2 changed files with 101 additions and 51 deletions
  1. 52 28
      p/python-psycopg/python-psycopg-vl.spec
  2. 49 23
      p/python-psycopg2/python-psycopg2-vl.spec

+ 52 - 28
p/python-psycopg/python-psycopg-vl.spec

@@ -1,21 +1,26 @@
-%define _python python%(python -c 'import sys;print(sys.version[0:3])')
+%define _zope2_pythonlibs %{_var}/lib/Zope2/lib/python
+%define _zope2_installdir %{_var}/lib/Zope2/Products
 %define _product ZPsycopgDA
-%define _zope_instance %{_libdir}/zope/lib/python/Products
-
 Summary: psycopg is a PostgreSQL database adapter for Python
 Summary(ja): psycopg は Python の PostgreSQL 用データベースアダプタです
 Name: python-psycopg
 Group: Applications/Databases
 Version: 1.1.21
-Release: 4%{?_dist_release}
+Release: 5%{?_dist_release}
 License: GNU GPL2
 URL: http://initd.org/software/initd/psycopg
-Source: http://initd.org/pub/software/psycopg/psycopg-%{version}.tar.gz
+Source0: http://initd.org/pub/software/psycopg/psycopg-%{version}.tar.gz
+Patch0: psycopg-1.1.21-DA.patch
+Patch1: psycopg-1.1.21-DABase.patch
+BuildRequires: python-devel
+BuildRequires: postgresql-devel
+BuildRequires: python-egenix-mx-base
+Requires: python
+Requires: postgresql-libs
+BuildRoot: %{_tmppath}/psycopg-%{version}-root
 Distribution: Vine Linux
 Vendor: Project Vine
-BuildRoot: %{_tmppath}/psycopg-%{version}-root
-BuildRequires: python-devel postgresql-devel python-egenix-mx-base
-Requires: python postgresql-libs
+Packager: owa
 
 %description
 psycopg is a PostgreSQL database adapter for the Python programming
@@ -32,57 +37,76 @@ Group: Applications/Databases
 Documenation and example files for the psycopg python PostgreSQL
 database adapter.
 
-%package -n Zope-%{_product}
+%package %{_product}
 Summary: ZPsycopgDA is a PostgreSQL database adapter product for Zope
 Group: Development/Web Applications
-Requires: python-psycopg == %{version}
-Requires: Zope-zserver
+Requires: %{name} == %{version}
+Requires: Zope2-zserver >= 2.12
+Provides: %{_product}
+Obsoletes: Zope-%{_product}
 
-%description -n Zope-%{_product}
+%description %{_product}
 ZPsycopgDA is a PostgreSQL database adapter product for Zope.
 
+
 %prep
 %setup -q -n psycopg-%{version}
+%patch0 -p1 -b .DA
+%patch1 -p1 -b .DABase
+
 
 %build
 %configure \
-	--with-python=%{_bindir}/%{_python} \
 	--with-postgres-libraries=%{_libdir} \
 	--with-postgres-includes=%{_includedir}/pgsql \
-	--with-mxdatetime-includes=%{_libdir}/%{_python}/site-packages/mx/DateTime/mxDateTime  \
-	--with-zope=%{_libdir}/zope
-
+	--with-mxdatetime-includes=%{python_sitearch}/mx/DateTime/mxDateTime  \
+	--with-zope=%{_libdir}/Zope2 \
+	;
 make
 
+
 %install
-mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_python}/site-packages
-install -m 755 psycopgmodule.so $RPM_BUILD_ROOT%{_libdir}/%{_python}/site-packages
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT%{python_sitearch}
+install -m 755 psycopgmodule.so $RPM_BUILD_ROOT%{python_sitearch}
+mkdir -p $RPM_BUILD_ROOT%{_zope2_pythonlibs}
+ln -sf %{python_sitearch}/psycopgmodule.so $RPM_BUILD_ROOT%{_zope2_pythonlibs}
 
-mkdir -p $RPM_BUILD_ROOT%{_zope_instance}
 find %{_product} -name CVS | xargs rm -fr
-cp -pR %{_product} $RPM_BUILD_ROOT%{_zope_instance}
+mkdir -p $RPM_BUILD_ROOT%{_zope2_installdir}
+cp -pR %{_product} $RPM_BUILD_ROOT%{_zope2_installdir}
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-if [ -d /var/lib/zope/Products/%{_product} ]; then
-	rm -rf /var/lib/zope/Products/%{_product}
+
+%preun %{_product}
+if [ $1 = 0 ]; then
+	rm -rf %{_zope2_installdir}/%{_product}/*.pyc
 fi
 
+
 %files
 %defattr(-,root,root)
-%{_libdir}/%{_python}/site-packages/*.so
+%{python_sitearch}/psycopgmodule.so
 
 %files doc
 %defattr(-,root,root)
-%doc AUTHORS  COPYING  CREDITS  FAQ  INSTALL  NEWS  README  RELEASE-1.0  SUCCESS  TODO doc
+%doc AUTHORS COPYING CREDITS FAQ INSTALL NEWS README RELEASE-1.0 SUCCESS TODO doc
+
+%files %{_product}
+%defattr(-,Zope2,Zope2)
+%{_zope2_pythonlibs}/psycopgmodule.so
+%{_zope2_installdir}/%{_product}
 
-%files -n Zope-%{_product}
-%defattr(-,zope,zope)
-%{_zope_instance}/%{_product}
 
 %changelog
+* Wed Dec 15 2010 Shu KONNO <owa@bg.wakwak.com> 1.1.21-5
+- added psycopg-1.1.21-DA.patch
+- added psycopg-1.1.21-DABase.patch
+- rename sub-package: Zope-%{_product} => %{name}-%{_product}
+
 * Tue Feb 02 2010 Shu KONNO <owa@bg.wakwak.com> 1.1.21-4
 - rebuild with python-2.6
 

+ 49 - 23
p/python-psycopg2/python-psycopg2-vl.spec

@@ -1,19 +1,24 @@
-%define zope_product ZPsycopgDA
-%define zope_instance %{_libdir}/zope/lib/python/Products
-
+%define _zope2_pythonlibs %{_var}/lib/Zope2/lib/python
+%define _zope2_installdir %{_var}/lib/Zope2/Products
+%define _product ZPsycopgDA
 Summary: psycopg2 is a PostgreSQL database adapter for Python
 Summary(ja): psycopg2 は Python の PostgreSQL 用データベースアダプタです
 Name: python-psycopg2
 Group: Applications/Databases
-Version: 2.0.13
+Version: 2.2.2
 Release: 1%{?_dist_release}
-License: GNU GPL2
+License: LGPL or ZPL
 Source: http://initd.org/pub/software/psycopg/psycopg2-%{version}.tar.gz
+Patch0: psycopg2-2.2.2-DA.patch
+BuildRequires: python-devel
+BuildRequires: postgresql-devel
+BuildRequires: python-egenix-mx-base
+Requires: python
+Requires: postgresql-libs
+BuildRoot: %{_tmppath}/psycopg-%{version}-root
 Distribution: Vine Linux
 Vendor: Project Vine
-BuildRoot: %{_tmppath}/psycopg-%{version}-root
-BuildRequires: python-devel postgresql-devel python-egenix-mx-base
-Requires: python postgresql-libs
+Packager: owa
 
 %description
 psycopg is a PostgreSQL database adapter for the Python programming
@@ -29,51 +34,72 @@ Group: Applications/Databases
 Documenation and example files for the psycopg python PostgreSQL
 database adapter.
 
-%package ZPsycopgDA
+%package %{_product}
 Summary: ZPsycopgDA is a PostgreSQL database adapter product for Zope
 Group: Development/Web Applications
 Requires: %{name} == %{version}
-Requires: Zope-zserver >= 2.9
-conflicts: Zope-ZPsycopgDA
-%description ZPsycopgDA
+Requires: Zope2-zserver >= 2.12
+Provides: %{_product}
+
+%description %{_product}
 ZPsycopgDA is a PostgreSQL database adapter product for Zope.
 
 
 %prep
 %setup -q -n psycopg2-%{version}
+%patch0 -p1 -b .DA
+
 
 %build
 python setup.py build
 
 
 %install
-python setup.py install --root $RPM_BUILD_ROOT
-mkdir -p $RPM_BUILD_ROOT%{zope_instance}
-find %{zope_product} -name CVS | xargs rm -fr
-cp -pR %{zope_product} $RPM_BUILD_ROOT%{zope_instance}
+rm -rf $RPM_BUILD_ROOT
+python setup.py install \
+	--root $RPM_BUILD_ROOT \
+	--install-lib %{python_sitearch} \
+	;
+mkdir -p $RPM_BUILD_ROOT%{_zope2_pythonlibs}
+ln -sf %{python_sitearch}/psycopg2 $RPM_BUILD_ROOT%{_zope2_pythonlibs}
+ln -sf %{python_sitearch}/psycopg2-%{version}-py%{pyver}.egg-info $RPM_BUILD_ROOT%{_zope2_pythonlibs}
+
+find %{_product} -name CVS | xargs rm -fr
+mkdir -p $RPM_BUILD_ROOT%{_zope2_installdir}
+cp -pR %{_product} $RPM_BUILD_ROOT%{_zope2_installdir}
+
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%post
-if [ -d /var/lib/zope/Products/%{zope_product} ]; then
-	rm -rf /var/lib/zope/Products/%{zope_product}
+
+%preun %{_product}
+if [ $1 = 0 ]; then
+	rm -rf %{_zope2_installdir}/%{_product}/*.pyc
 fi
 
+
 %files
 %defattr(-,root,root)
 %{python_sitearch}/psycopg2
-%{python_sitearch}/psycopg2-%{version}-py%{pyver}.egg-info
+%{python_sitearch}/psycopg2-%{version}-py*.egg-info
 
 %files doc
 %defattr(-,root,root)
 %doc AUTHORS INSTALL README doc
 
-%files ZPsycopgDA
-%defattr(-,zope,zope)
-%{zope_instance}/%{zope_product}
+%files %{_product}
+%defattr(-,Zope2,Zope2)
+%{_zope2_pythonlibs}/psycopg2
+%{_zope2_pythonlibs}/psycopg2-%{version}-py*.egg-info
+%{_zope2_installdir}/%{_product}
+
 
 %changelog
+* Wed Dec 15 2010 Shu KONNO <owa@bg.wakwak.com> 2.2.2-1
+- updated psycopg2 to 2.2.2
+- added psycopg2-2.2.2-DA.patch
+
 * Wed Feb 17 2010 Shu KONNO <owa@bg.wakwak.com> 2.0.13-1
 - updated psycopg2 to 2.0.13