[python-paste] * Mon Aug 2 2010 Kyle VanderBeek <kylev at kylev.com> - 1.7.4-7 - Add python3 version. - Unbundle stdl

Kyle VanderBeek kylev at fedoraproject.org
Tue Aug 3 03:23:53 UTC 2010


commit dfd3cd574048d95bc89aed014222b7a533c21f1e
Author: Kyle VanderBeek <kylev at kylev.com>
Date:   Mon Aug 2 20:23:44 2010 -0700

    * Mon Aug  2 2010 Kyle VanderBeek <kylev at kylev.com> - 1.7.4-7
    - Add python3 version.
    - Unbundle stdlib (2.4+) subprocess module.

 paste-27-lambda.patch       |   12 +++++++++
 paste-unbundle-stdlib.patch |   45 ++++++++++++++++++++++++++++++++++
 python-paste.spec           |   57 +++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 112 insertions(+), 2 deletions(-)
---
diff --git a/paste-27-lambda.patch b/paste-27-lambda.patch
new file mode 100644
index 0000000..91dcad1
--- /dev/null
+++ b/paste-27-lambda.patch
@@ -0,0 +1,12 @@
+diff -r 30425672adf7 paste/auth/cookie.py
+--- a/paste/auth/cookie.py	Wed Jun 23 17:15:45 2010 -0500
++++ b/paste/auth/cookie.py	Mon Aug 02 20:06:43 2010 -0700
+@@ -62,7 +62,7 @@
+ _decode = [(v, k) for (k, v) in _encode]
+ _decode.reverse()
+ def encode(s, sublist = _encode):
+-    return reduce((lambda a, (b, c): a.replace(b, c)), sublist, str(s))
++    return reduce((lambda a, b: a.replace(b[0], b[1])), sublist, str(s))
+ decode = lambda s: encode(s, _decode)
+ 
+ class CookieTooLarge(RuntimeError):
diff --git a/paste-unbundle-stdlib.patch b/paste-unbundle-stdlib.patch
index c7ab3f7..56c55ad 100644
--- a/paste-unbundle-stdlib.patch
+++ b/paste-unbundle-stdlib.patch
@@ -14,3 +14,48 @@ Index: Paste-1.7.4/paste/debug/fsdiff.py
  import operator
  import re
  
+diff -r 30425672adf7 paste/debug/doctest_webapp.py
+--- a/paste/debug/doctest_webapp.py	Wed Jun 23 17:15:45 2010 -0500
++++ b/paste/debug/doctest_webapp.py	Mon Aug 02 20:16:47 2010 -0700
+@@ -8,10 +8,7 @@
+ These are functions for use when doctest-testing a document.
+ """
+ 
+-try:
+-    import subprocess
+-except ImportError:
+-    from paste.util import subprocess24 as subprocess
++import subprocess
+ import doctest
+ import os
+ import sys
+diff -r 30425672adf7 paste/debug/wdg_validate.py
+--- a/paste/debug/wdg_validate.py	Wed Jun 23 17:15:45 2010 -0500
++++ b/paste/debug/wdg_validate.py	Mon Aug 02 20:16:47 2010 -0700
+@@ -6,10 +6,7 @@
+ """
+ 
+ from cStringIO import StringIO
+-try:
+-    import subprocess
+-except ImportError:
+-    from paste.util import subprocess24 as subprocess
++import subprocess
+ from paste import wsgilib
+ import re
+ import cgi
+diff -r 30425672adf7 paste/fixture.py
+--- a/paste/fixture.py	Wed Jun 23 17:15:45 2010 -0500
++++ b/paste/fixture.py	Mon Aug 02 20:16:47 2010 -0700
+@@ -26,10 +26,7 @@
+ except ImportError:
+     from StringIO import StringIO
+ import re
+-try:
+-    import subprocess
+-except ImportError:
+-    from paste.util import subprocess24 as subprocess
++import subprocess
+ 
+ from paste import wsgilib
+ from paste import lint
diff --git a/python-paste.spec b/python-paste.spec
index 24bfafe..d45a222 100644
--- a/python-paste.spec
+++ b/python-paste.spec
@@ -1,10 +1,13 @@
-%if 0%{?fedora} < 13 && 0%{?rhel} < 6
+%if 0%{?fedora} > 12 || 0%{?rhel} > 6
+%global with_python3 1
+%else
 %{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 %endif
+%global with_python3 1
 
 Name:           python-paste
 Version:        1.7.4
-Release:        6%{?dist}
+Release:        7%{?dist}
 Summary:        Tools for using a Web Server Gateway Interface stack
 Group:          System Environment/Libraries
 # Most of the code is MIT
@@ -20,6 +23,7 @@ Source0:        http://cheeseshop.python.org/packages/source/P/Paste/Paste-%{ver
 Patch0: paste-unbundle-stdlib.patch
 # Use a system version of python-tempita before our bundled copy
 Patch1: paste-unbundle-tempita.patch
+Patch2: paste-27-lambda.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch:      noarch
 
@@ -32,17 +36,39 @@ BuildRequires:  python-setuptools
 Requires: python-tempita
 Requires: pyOpenSSL
 
+%if 0%{?with_python3}
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: /usr/bin/2to3
+%endif # if with_python3
+
 %description
 These provide several pieces of "middleware" (or filters) that can be nested
 to build web applications.  Each piece of middleware uses the WSGI (PEP 333)
 interface, and should be compatible with other middleware based on those
 interfaces.
 
+%if 0%{?with_python3}
+%package -n python3-paste
+Summary:        Tools for using a Web Server Gateway Interface stack
+Group:          System Environment/Libraries
+Requires: python3-tempita
+# TODO is there a pyOpenSSL for python3
+
+%description -n python3-paste
+These provide several pieces of "middleware" (or filters) that can be nested
+to build web applications.  Each piece of middleware uses the WSGI (PEP 333)
+interface, and should be compatible with other middleware based on those
+interfaces.
+%endif # with_python3
+
 
 %prep
 %setup -q -n Paste-%{version}
 %patch0 -p1 -b .stdlib
+rm paste/util/subprocess24.py
 %patch1 -p1 -b .tmpta
+%patch2 -p1 -b .27lambda
 # Strip #! lines that make these seeme like scripts
 %{__sed} -i -e '/^#!.*/,1 d' paste/util/scgiserver.py paste/debug/doctest_webapp.py
 
@@ -51,15 +77,32 @@ pushd docs
 rm StyleGuide.txt
 popd
 
+%if 0%{?with_python3}
+rm -rf %{py3dir}
+cp -a . %{py3dir}
+2to3 --write --nobackups %{py3dir}
+%endif # with_python3
 
 %build
 %{__python} setup.py build
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif # with_python3
+
 
 %install
 rm -rf %{buildroot}
 %{__python} setup.py install --skip-build --root %{buildroot}
 
+%if 0%{?with_python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root $RPM_BUILD_ROOT
+popd
+%endif # with_python3
+
 
 %clean
 rm -rf %{buildroot}
@@ -70,8 +113,18 @@ rm -rf %{buildroot}
 %doc docs/*
 %{python_sitelib}/*
 
+%if 0%{?with_python3}
+%files -n python3-paste
+%defattr(-,root,root,-)
+%{python3_sitelib}/*
+%endif
+
 
 %changelog
+* Mon Aug  2 2010 Kyle VanderBeek <kylev at kylev.com> - 1.7.4-7
+- Add python3 version.
+- Unbundle stdlib (2.4+) subprocess module.
+
 * Fri Jul 30 2010 Toshio Kuratomi <toshio at fedoraproject.org> - 1.7.4-6
 - Include another function from tempita that is used by paste-script.
 


More information about the scm-commits mailing list