Browse Source

python-paste package update

Signed-off-by: basebuilder_pel7ppc64lebuilder0 <basebuilder@powerel.org>
master
basebuilder_pel7ppc64lebuilder0 5 years ago
parent
commit
ed6859b745
  1. 12
      SOURCES/paste-27-lambda.patch
  2. 50
      SOURCES/paste-digest-snap.patch
  3. 15
      SOURCES/paste-manifest.patch
  4. 64
      SOURCES/paste-unbundle-stdlib.patch
  5. 1860
      SOURCES/paste-unbundle-tempita.patch
  6. 270
      SPECS/python-paste.spec

12
SOURCES/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):

50
SOURCES/paste-digest-snap.patch

@ -0,0 +1,50 @@
diff -r abaf4a78f69b paste/auth/digest.py
--- a/paste/auth/digest.py Wed Dec 21 09:00:48 2011 -0800
+++ b/paste/auth/digest.py Wed Dec 21 16:03:49 2011 -0800
@@ -38,6 +38,34 @@
import time, random
from urllib import quote as url_quote
+def _split_auth_string(auth_string):
+ """ split a digest auth string into individual key=value strings """
+ prev = None
+ for item in auth_string.split(","):
+ try:
+ if prev.count('"') == 1:
+ prev = "%s,%s" % (prev, item)
+ continue
+ except AttributeError:
+ if prev == None:
+ prev = item
+ continue
+ else:
+ raise StopIteration
+ yield prev.strip()
+ prev = item
+
+ yield prev.strip()
+ raise StopIteration
+
+def _auth_to_kv_pairs(auth_string):
+ """ split a digest auth string into key, value pairs """
+ for item in _split_auth_string(auth_string):
+ (k, v) = item.split("=", 1)
+ if v.startswith('"') and len(v) > 1 and v.endswith('"'):
+ v = v[1:-1]
+ yield (k, v)
+
def digest_password(realm, username, password):
""" construct the appropriate hashcode needed for HTTP digest """
return md5("%s:%s:%s" % (username, realm, password)).hexdigest()
@@ -98,10 +126,7 @@
(authmeth, auth) = authorization.split(" ", 1)
if 'digest' != authmeth.lower():
return self.build_authentication()
- amap = {}
- for itm in auth.split(","):
- (k,v) = [s.strip() for s in itm.strip().split("=", 1)]
- amap[k] = v.replace('"', '')
+ amap = dict(_auth_to_kv_pairs(auth))
try:
username = amap['username']
authpath = amap['uri']

15
SOURCES/paste-manifest.patch

@ -0,0 +1,15 @@
diff -r 852439f67241 -r abaf4a78f69b MANIFEST.in
--- a/MANIFEST.in Wed Aug 17 15:52:53 2011 -0500
+++ b/MANIFEST.in Wed Dec 21 09:00:48 2011 -0800
@@ -1,6 +1,8 @@
-recursive-include docs *.txt
+recursive-include docs *.txt *.css *.js
+include docs/_templates/*.html
include docs/conf.py
+include docs/test_server.ini
recursive-exclude docs/_build/_sources *
recursive-include docs/_build *.html
-recursive-include tests *.txt *.py
-recursive-include paste *.js *.jpg
+recursive-include tests *.txt *.py *.cgi *.html
+recursive-include paste *.js *.jpg *.png

64
SOURCES/paste-unbundle-stdlib.patch

@ -0,0 +1,64 @@
Index: Paste-1.7.5/paste/debug/fsdiff.py
===================================================================
--- Paste-1.7.5.orig/paste/debug/fsdiff.py
+++ Paste-1.7.5/paste/debug/fsdiff.py
@@ -12,7 +12,10 @@ the file was.
import os
from fnmatch import fnmatch
from datetime import datetime
-from paste.util.UserDict24 import IterableUserDict
+try:
+ from UserDict import IterableUserDict
+except ImportError:
+ from paste.util.UserDict24 import IterableUserDict
import operator
import re
Index: Paste-1.7.5/paste/debug/doctest_webapp.py
===================================================================
--- Paste-1.7.5.orig/paste/debug/doctest_webapp.py
+++ Paste-1.7.5/paste/debug/doctest_webapp.py
@@ -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
Index: Paste-1.7.5/paste/debug/wdg_validate.py
===================================================================
--- Paste-1.7.5.orig/paste/debug/wdg_validate.py
+++ Paste-1.7.5/paste/debug/wdg_validate.py
@@ -6,10 +6,7 @@ Middleware that tests the validity of al
"""
from cStringIO import StringIO
-try:
- import subprocess
-except ImportError:
- from paste.util import subprocess24 as subprocess
+import subprocess
from paste.response import header_value
import re
import cgi
Index: Paste-1.7.5/paste/fixture.py
===================================================================
--- Paste-1.7.5.orig/paste/fixture.py
+++ Paste-1.7.5/paste/fixture.py
@@ -26,10 +26,7 @@ try:
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

1860
SOURCES/paste-unbundle-tempita.patch

File diff suppressed because it is too large Load Diff

270
SPECS/python-paste.spec

@ -0,0 +1,270 @@
%if 0%{?fedora} || 0%{?rhel} > 6
#global with_python3 1
# paste is not python3 compatible at this time
%else
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%endif

Name: python-paste
Version: 1.7.5.1
Release: 9.20111221hg1498%{?dist}
Summary: Tools for using a Web Server Gateway Interface stack
Group: System Environment/Libraries
# Most of the code is MIT
# paste/exceptions/collector.py is ZPLv2.0
# paste/evalexception/mochikit/MochiKit.js AFL or MIT
# paste/lint.py MIT or Apache v2
# subproccess24.py PySourceColor.py, Python
# doctest24.py, Public Domain
License: MIT and ZPLv2.0 and Python and Public Domain and (AFL or MIT) and (MIT or ASL 2.0)
URL: http://pythonpaste.org
# All files arent included in the 0.7.5.1 release. Take a snapshot to get
# unittests working and pick up three bugfixes as well
# hg clone -r 1498 https://bitbucket.org/ianb/paste
# cd paste
# patch -p1 < ../paste-manifest.patch
# python setup.py sdist
# Source is in dist/Paste-1.7.5.1.tar.gz
Source0: Paste-%{version}.tar.gz
#Source0: http://pypi.python.org/pypi/packages/source/P/Paste/Paste-%{version}.tar.gz
# In one remaining place, make sure we check for string in the stdlib before we use our copy
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
# Fix parsing of digest key value pairs
# Submitted upstream pull request
Patch3: paste-digest-snap.patch
# Submitted upstream pull request with this change.
# This patch is needed when creating the tarball, not during rpm build
Patch100: paste-manifest.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-nose
BuildRequires: python-tempita
BuildRequires: pyOpenSSL
Requires: python-tempita
Requires: pyOpenSSL
Requires: python-setuptools

%if 0%{?with_python3}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-nose
BuildRequires: python3-tempita
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
Requires: python3-setuptools
# 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
%patch3 -p1 -b .digest
# Strip #! lines that make these seem like scripts
%{__sed} -i -e '/^#!.*/,1 d' paste/util/scgiserver.py paste/debug/doctest_webapp.py

# clean docs directory
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

%check
export PYTHONPATH=$(pwd)
# We don't have access to the wider internet in the buildsystem
nosetests -e '.*test_paste_website'

%if 0%{?with_python3}
pushd %{py3dir}
export PYTHONPATH=$(pwd)
nosetests-%{python3_version}
popd
%endif # with_python3

%clean
rm -rf %{buildroot}


%files
%defattr(-,root,root,-)
%doc docs/*
%{python_sitelib}/*

%if 0%{?with_python3}
%files -n python3-paste
%defattr(-,root,root,-)
%{python3_sitelib}/*
%endif


%changelog
* Fri Dec 27 2013 Daniel Mach <dmach@redhat.com> - 1.7.5.1-9.20111221hg1498
- Mass rebuild 2013-12-27

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.5.1-8.20111221hg1498
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.5.1-7.20111221hg1498
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jan 23 2012 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.5.1-6.20111221hg1498
- Disable python3 subpackage as paste is not python3 compatible at this time

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.5.1-5.20111221hg1498
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Dec 21 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.5.1-4.20111221hg1498
- Tarball is missing files, use a snapshot to get those files and also pick up
several bug fixes (one related to serving CGI scripts, another for http
Continue requests, and a third regarding digest authentication and internet
explorer)

* Tue Dec 20 2011 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.5.1-3
- Ugh. Enable unittests and make a note that the python3 module is totally
non-functional. Open a bug for that for the actual package maintainers to
make a decision on.

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Sep 22 2010 Luke Macken <lmacken@redhat.com> - 1.7.5.1-1
- 1.7.5.1 upstream release

* Wed Sep 15 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.5-1
- New upstream bugfix

* Mon Aug 23 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.4-8
- Rebuild for python3-3.2

* Mon Aug 2 2010 Kyle VanderBeek <kylev@kylev.com> - 1.7.4-7
- Add python3 version.
- Fix python 2.7/3 incompatible lambda syntax.
- Unbundle stdlib (2.4+) subprocess module (removed because it isn't even 3.x legal).

* Fri Jul 30 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.4-6
- Include another function from tempita that is used by paste-script.

* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.7.4-5
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild

* Fri Jul 9 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.4-4
- Actually apply the patches :-(

* Fri Jul 2 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.4-3
- Require pyOpenSSL so that we get SSL capabilities

* Thu Jul 1 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.7.4-2
- Unbundle tempita and don't rely on utils.string24

* Thu Jun 24 2010 Luke Macken <lmacken@redhat.com> - 1.7.4-1
- 1.7.4 security release

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Mon Jun 22 2009 Kyle VanderBeek <kylev@kylev.com> - 1.7.2-3
- Package formerly ghost'ed .pyo files
- Update to current python package methods

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Tue Jan 06 2009 Luke Macken <lmacken@redhat.com> - 1.7.2-1
- Update to 1.7.2

* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 1.7.1-2
- Rebuild for Python 2.6

* Sat Jun 14 2008 Luke Macken <lmacken@redhat.com> - 1.7.1-1
- Update to Paste 1.7.1

* Thu Feb 28 2008 Luke Macken <lmacken@redhat.com> - 1.6-1
- Update to 1.6

* Wed Oct 3 2007 Luke Macken <lmacken@redhat.com> - 1.4.2-1
- 1.4.2

* Sun Sep 2 2007 Luke Macken <lmacken@redhat.com> - 1.4-2
- Update for python-setuptools changes in rawhide

* Sat Jul 8 2007 Luke Macken <lmacken@redhat.com> - 1.4-1
- 1.4

* Sat Mar 3 2007 Luke Macken <lmacken@redhat.com> - 1.2.1-1
- 1.2.1

* Sat Dec 9 2006 Luke Macken <lmacken@redhat.com> - 1.0-2
- Add python-devel to BuildRequires
- 1.0

* Sun Sep 17 2006 Luke Macken <lmacken@redhat.com> - 0.9.8.1-1
- 0.9.8.1

* Sun Sep 3 2006 Luke Macken <lmacken@redhat.com> - 0.9.3-5
- Rebuild for FC6

* Wed Jul 19 2006 Luke Macken <lmacken@redhat.com> - 0.9.3-4
- Use a smarter shebang removal expression

* Wed Jul 19 2006 Luke Macken <lmacken@redhat.com> - 0.9.3-3
- Fix doc inclusion

* Sat Jul 15 2006 Luke Macken <lmacken@redhat.com> - 0.9.3-2
- Clean up docs directory
- Remove shebang from from non-executable scripts
- Use consistent build root variables

* Mon Jul 10 2006 Luke Macken <lmacken@redhat.com> - 0.9.3-1
- Initial package
Loading…
Cancel
Save