From 58c14e2534030668bb9e88f551479bb83fa23432 Mon Sep 17 00:00:00 2001 From: Toshio くらとみ Date: Jan 21 2008 21:06:31 +0000 Subject: Initial import of python-cherrypy2. --- diff --git a/.cvsignore b/.cvsignore index e69de29..5c3a7d2 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +CherryPy-2.3.0.tar.gz diff --git a/README.fedora b/README.fedora new file mode 100644 index 0000000..891cb7c --- /dev/null +++ b/README.fedora @@ -0,0 +1,79 @@ +============ +CherryPy 2.x +============ + +CherryPy 2.x for Fedora is being provided so that apps written for +TurboGears 1.x can continue to run. It relies on eggs to enable multiple +versions to be installed. + +If you are using CherryPy via TurboGears, everything should work out of the +box for new projects quickstarted with the Fedora 8 packages. Existing projects +will need a small adjustment to run correctly. In your project's start-APP.py +script you need to change the commands that import TurboGears from this:: + + import pkg_resources + pkg_resources.require('TurboGears') + +to this:: + + __requires__ = 'TurboGears' + import pkg_resources + +with the packages provided by Fedora 8+. + +If you are using CherryPY via your own code and absolutely must use the 2.x +version rather than 3.x, you will need to do one of the following to make it +work in your code: + +1) Manually change your python path to place the egg directory before + site-packages. Note that if you do it this way you will either have to + change your code whenever a new version comes out (for instance, if a + bugfix release, CherryPy-2.2.2, is released.) The code would look + something like this:: + + import sys, os, distutils + compatCherryPyPath = os.path.join( + distutils.sysconfig.get_python_lib(), 'CherryPy-2.2.1-py2.5.egg') + sys.path.insert(0, compatCherryPyPath) + import cherrypy + +2) Use setuptools and entrypoints. To do this you have a function in a python + module that is your main function. You define this as an entry point in + setup.py. For instance, if you wanted your script to be called + "nifty-foo" and the entry point was the main() function in the module + nifty.foo, you would use this in setup.py:: + + # List the versions of CherryPy that will work + install_requires = [ + 'CherryPy >= 2.2,<3.0alpha' + ] + # Add the information necessary to create the script that requires + # the CherryPy version + setup ( + name='Nifty', + version='1.0', + entry_points = ''' + [console_scripts] + nifty-foo = nifty.foo:main + ''', + [...] + + When you use setup.py to install this script it will create a script that + looks like this:: + + #!/usr/bin/python + __requires__ = 'Nifty==1.0' + import sys + from pkg_resources import load_entry_point + + sys.exit( + load_entry_point('Nifty==1.0', 'console_scripts', 'nifty-foo')() + ) + + The script in turn, references the egg metadata for your module which + lists the dependency from Nifty to CherryPy>=2.2, < 3.0alpha. + +Note that although there may be other methods of making this work in some +circumstances, these are the only methods that the setuptools author and +we are able to say will work in all circumstances in this environment. Other +methods may not work reliably in some versions of setuptools. diff --git a/python-cherrypy-2.3.0-EINTR.patch b/python-cherrypy-2.3.0-EINTR.patch new file mode 100644 index 0000000..774bd4c --- /dev/null +++ b/python-cherrypy-2.3.0-EINTR.patch @@ -0,0 +1,17 @@ +diff -up CherryPy-2.3.0/cherrypy/_cpwsgiserver.py.bak CherryPy-2.3.0/cherrypy/_cpwsgiserver.py +--- CherryPy-2.3.0/cherrypy/_cpwsgiserver.py.bak 2008-01-17 15:57:48.000000000 -0800 ++++ CherryPy-2.3.0/cherrypy/_cpwsgiserver.py 2008-01-17 15:59:32.000000000 -0800 +@@ -404,6 +404,13 @@ class CherryPyWSGIServer(object): + # accept() by default + return + except socket.error, x: ++ if hasattr(errno, "EINTR") and x.args[0] == errno.EINTR: ++ # I *think* this is right. EINTR should occur when a signal ++ # is received during the accept() call; all docs say retry ++ # the call, and I *think* I'm reading it right that Python ++ # will then go ahead and poll for and handle the signal ++ # elsewhere. See http://www.cherrypy.org/ticket/707. ++ return + msg = x.args[1] + if msg == "Bad file descriptor": + # Our socket was closed diff --git a/python-cherrypy-regression-test.patch b/python-cherrypy-regression-test.patch new file mode 100644 index 0000000..781e28b --- /dev/null +++ b/python-cherrypy-regression-test.patch @@ -0,0 +1,12 @@ +Index: CherryPy-2.3.0/cherrypy/test/test.py +=================================================================== +--- CherryPy-2.3.0.orig/cherrypy/test/test.py ++++ CherryPy-2.3.0/cherrypy/test/test.py +@@ -328,7 +328,6 @@ def run(): + success = clp.run() + if clp.interactive: + print +- raw_input('hit enter') + sys.exit(success) + + diff --git a/python-cherrypy-tutorial-doc.patch b/python-cherrypy-tutorial-doc.patch new file mode 100644 index 0000000..3f0b1c4 --- /dev/null +++ b/python-cherrypy-tutorial-doc.patch @@ -0,0 +1,28 @@ +diff -up CherryPy-2.3.0/setup.py.bak CherryPy-2.3.0/setup.py +--- CherryPy-2.3.0/setup.py.bak 2008-01-17 14:37:31.000000000 -0800 ++++ CherryPy-2.3.0/setup.py 2008-01-17 14:38:06.000000000 -0800 +@@ -36,23 +36,11 @@ url="http://www.cherrypy.org" + cp_license="BSD" + packages=[ + "cherrypy", "cherrypy.lib", "cherrypy.lib.filter", +- "cherrypy.tutorial", "cherrypy.test", "cherrypy.filters", ++ "cherrypy.filters", + ] + download_url="http://download.cherrypy.org/cherrypy/2.3.0/" + data_files=[ +- ('cherrypy/tutorial', +- [ +- 'cherrypy/tutorial/tutorial.conf', +- 'cherrypy/tutorial/README.txt', +- 'cherrypy/tutorial/pdf_file.pdf', +- 'cherrypy/tutorial/custom_error.html', +- ] +- ), + ('cherrypy', ['cherrypy/favicon.ico',]), +- ('cherrypy/test', ['cherrypy/test/style.css',]), +- ('cherrypy/test/static', ['cherrypy/test/static/index.html', +- 'cherrypy/test/static/has space.html', +- 'cherrypy/test/static/dirback.jpg',]), + ] + ############################################################################### + # end arguments for setup diff --git a/python-cherrypy2.spec b/python-cherrypy2.spec new file mode 100644 index 0000000..a84db23 --- /dev/null +++ b/python-cherrypy2.spec @@ -0,0 +1,124 @@ +%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} + +Name: python-cherrypy2 +Version: 2.3.0 +Release: 3%{?dist} +Summary: A pythonic, object-oriented web development framework +Group: Development/Libraries +License: BSD +URL: http://www.cherrypy.org/ +Source0: http://download.cherrypy.org/cherrypy/%{version}/CherryPy-%{version}.tar.gz +Source1: README.fedora +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +Patch0: python-cherrypy-tutorial-doc.patch +Patch1: python-cherrypy-regression-test.patch +Patch2: python-cherrypy-2.3.0-EINTR.patch + +BuildArch: noarch + +BuildRequires: python-devel +%if 0%{?fedora} >= 8 +BuildRequires: python-setuptools-devel +%else +BuildRequires: python-setuptools +%endif + +Requires: python-setuptools + +%description +CherryPy allows developers to build web applications in much the same way +they would build any other object-oriented Python program. This usually +results in smaller source code developed in less time. + +This is a compat package for programs which still need the 2.x branch of +CherryPy. +%prep +%setup -q -n CherryPy-%{version} +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 + +%{__sed} -i 's/\r//' CHANGELOG.txt README.txt CHERRYPYTEAM.txt cherrypy/tutorial/README.txt +cp -p %{SOURCE1} . + +%build +CFLAGS="$RPM_OPT_FLAGS" %{__python} -c 'import setuptools; execfile("setup.py")' bdist_egg + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{python_sitelib} +easy_install -m --prefix $RPM_BUILD_ROOT%{_usr} dist/*.egg +find $RPM_BUILD_ROOT%{python_sitelib}/ -type f -exec chmod -x \{\} \; + +%check +cd cherrypy/test +%{__python} test.py + +%clean +rm -rf $RPM_BUILD_ROOT + +%files +%defattr(-,root,root,-) +%doc CHANGELOG.txt CHERRYPYTEAM.txt README.txt README.fedora +%doc cherrypy/tutorial +%{python_sitelib}/* + +%changelog +* Wed Jan 16 2008 Toshio Kuratomi 2.3.0-3 +- Merge changes from current python-cherrypy package. +- Update to 2.3.0. + +* Wed Jan 16 2008 Toshio Kuratomi 2.2.1-9 +- Initial cherrypy2 build. + +* Sun Jan 6 2008 Toshio Kuratomi 2.2.1-8 +- Fix a security bug with a backport of http://www.cherrypy.org/changeset/1775 +- Include the egginfo files as well as the python files. + +* Sat Nov 3 2007 Luke Macken 2.2.1-7 +- Apply backported fix from http://www.cherrypy.org/changeset/1766 + to improve CherryPy's SIGSTOP/SIGCONT handling (Bug #364911). + Thanks to Nils Philippsen for the patch. + +* Mon Feb 19 2007 Luke Macken 2.2.1-6 +- Disable regression tests until we can figure out why they + are dying in mock. + +* Sun Dec 10 2006 Luke Macken 2.2.1-5 +- Add python-devel to BuildRequires + +* Sun Dec 10 2006 Luke Macken 2.2.1-4 +- Rebuild for python 2.5 + +* Mon Sep 18 2006 Luke Macken 2.2.1-3 +- Rebuild for FC6 +- Include pyo files instead of ghosting them + +* Thu Jul 13 2006 Luke Macken 2.2.1-2 +- Rebuild + +* Thu Jul 13 2006 Luke Macken 2.2.1-1 +- Update to 2.2.1 +- Remove unnecessary python-abi requirement + +* Sat Apr 22 2006 Gijs Hollestelle 2.2.0-1 +- Update to 2.2.0 + +* Wed Feb 22 2006 Gijs Hollestelle 2.1.1-1 +- Update to 2.1.1 (Security fix) + +* Tue Nov 1 2005 Gijs Hollestelle 2.1.0-1 +- Updated to 2.1.0 + +* Sat May 14 2005 Gijs Hollestelle 2.0.0-2 +- Added dist tag + +* Sun May 8 2005 Gijs Hollestelle 2.0.0-1 +- Updated to 2.0.0 final +- Updated python-cherrypy-tutorial-doc.patch to match new version + +* Wed Apr 6 2005 Ignacio Vazquez-Abrams 2.0.0-0.2.b +- Removed CFLAGS + +* Wed Mar 23 2005 Gijs Hollestelle 2.0.0-0.1.b +- Initial Fedora Package diff --git a/sources b/sources index e69de29..bfca383 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +80ce0f666f2899d4e681432e4061db16 CherryPy-2.3.0.tar.gz