From 5d8b05315f82b6986a8e3a45d0b705dd41b91752 Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 12 Jul 2011 12:33:04 -0700 Subject: [PATCH] Upgrade to 0.8 final. Remove the two remaining Apache licensed files until their license is fixed. Patch regressions that we had already submitted upstream -- resubmit --- docutils-encoding.patch | 12 +++++++++ docutils-test-exceptions.patch | 22 ++++++++++++++++ docutils-test-io-exception.patch | 29 --------------------- python-docutils.spec | 43 +++++++++++++++++++------------- sources | 2 +- 5 files changed, 60 insertions(+), 48 deletions(-) create mode 100644 docutils-encoding.patch create mode 100644 docutils-test-exceptions.patch delete mode 100644 docutils-test-io-exception.patch diff --git a/docutils-encoding.patch b/docutils-encoding.patch new file mode 100644 index 0000000..1670a5f --- /dev/null +++ b/docutils-encoding.patch @@ -0,0 +1,12 @@ +Index: docutils-0.8/test/test_functional.py +=================================================================== +--- docutils-0.8.orig/test/test_functional.py ++++ docutils-0.8/test/test_functional.py +@@ -175,7 +175,6 @@ expected output and check it in: + f = open(expected_path, 'r') + else: # samples are UTF8 encoded. 'rb' leads to errors with Python 3! + f = open(expected_path, 'r', encoding='utf-8') +- f = open(expected_path, 'r') + # Normalize line endings: + expected = '\n'.join(f.read().splitlines()) + f.close() diff --git a/docutils-test-exceptions.patch b/docutils-test-exceptions.patch new file mode 100644 index 0000000..9da6723 --- /dev/null +++ b/docutils-test-exceptions.patch @@ -0,0 +1,22 @@ +Index: docutils-0.8/test/test_error_reporting.py +=================================================================== +--- docutils-0.8.orig/test/test_error_reporting.py ++++ docutils-0.8/test/test_error_reporting.py +@@ -236,7 +236,7 @@ class SafeStringTests_locale(unittest.Te + except UnicodeEncodeError: + try: + open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) +- except IOError: ++ except IOError, e: + uioe = e + try: + os.chdir(b('\xfc')) +@@ -249,7 +249,7 @@ class SafeStringTests_locale(unittest.Te + except UnicodeEncodeError: + try: + os.chdir(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) +- except OSError: ++ except OSError, e: + uose = e + # wrapped test data: + wbioe = SafeString(bioe) diff --git a/docutils-test-io-exception.patch b/docutils-test-io-exception.patch deleted file mode 100644 index c6e2054..0000000 --- a/docutils-test-io-exception.patch +++ /dev/null @@ -1,29 +0,0 @@ -Index: docutils/test/test_functional.py -=================================================================== ---- docutils/test/test_functional.py (revision 7036) -+++ docutils/test/test_functional.py (working copy) -@@ -171,7 +171,10 @@ - no_expected = self.no_expected_template % { - 'exp': expected_path, 'out': params['destination_path']} - self.assert_(os.access(expected_path, os.R_OK), no_expected) -- f = open(expected_path, 'r') # ! 'rb' leads to errors with Python 3! -+ if sys.version_info < (3,0): -+ f = open(expected_path, 'r') -+ else: -+ f = open(expected_path, 'r', encoding='utf-8') # ! 'rb' leads to errors with Python 3! - # Normalize line endings: - expected = '\n'.join(f.read().splitlines()) - f.close() -Index: docutils/test/test_io.py -=================================================================== ---- docutils/test/test_io.py (revision 7036) -+++ docutils/test/test_io.py (working copy) -@@ -99,7 +99,7 @@ - except UnicodeEncodeError: - try: - open(u'\xfc'.encode(sys.getfilesystemencoding(), 'replace')) -- except IOError: -+ except IOError, e: - uioe = e - if locale: - locale.setlocale(locale.LC_ALL, 'C') # reset diff --git a/python-docutils.spec b/python-docutils.spec index 99f7583..c50a73f 100644 --- a/python-docutils.spec +++ b/python-docutils.spec @@ -11,21 +11,24 @@ Name: python-%{srcname} Version: 0.8 -Release: 0.1.20110517svn7036%{?dist} +Release: 1%{?dist} Summary: System for processing plaintext documentation Group: Development/Languages # See COPYING.txt for information -License: Public Domain and MIT and Python and GPLv2 +License: Public Domain and BSD and Python and GPLv3+ URL: http://docutils.sourceforge.net -#Source0: http://downloads.sourceforge.net/docutils/%{srcname}-%{version}.tar.gz -# Build a snapshot -# svn co svn://svn.berlios.de/docutils/trunk/docutils +Source0: http://downloads.sourceforge.net/docutils/%{srcname}-%{version}.tar.gz +# Sometimes we need snapshots. Instructions below: +# svn co -r $REV svn://svn.berlios.de/docutils/trunk/docutils # cd docutils # python setup.py sdist # The tarball is in dist/docutils-VERSION.tar.gz -Source0: %{srcname}-%{version}.tar.gz -Patch0: docutils-test-io-exception.patch +#Source0: %{srcname}-%{version}.tar.gz +# Patches submitted upstream here: +# https://sourceforge.net/tracker/index.php?func=detail&aid=3365041&group_id=38414&atid=422032 +Patch0: docutils-test-exceptions.patch +Patch1: docutils-encoding.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch @@ -74,23 +77,21 @@ This package contains the module, ported to run under python3. %prep %setup -q -n %{srcname}-%{version} -%patch0 -p1 -b .testio +%patch0 -p1 -b .testexc +%patch1 -p1 -b .testencoding -# We want to check if this is necessary every time we rebuild -# since it is icky, nasty, and gross. -# The python3 bug that needs to be solved for this to work is: -# https://bugzilla.redhat.com/show_bug.cgi?id=705436 -%if 0%{?with_python3} -if test x"%{release}" = x"0.1.20110517svn7036%{?dist}" ; then - sed -i 's/Günter/Gunter/' tools/rst2xetex.py -fi -%endif +# Remove Apache licensed files for now. Can stop doing this when this bug is resolved +# https://sourceforge.net/tracker/?func=detail&aid=3364658&group_id=38414&atid=422030 +rm -f docs/user/docutils-05-compat.sty.txt docutils/writers/latex2e/docutils-05-compat.sty # Remove shebang from library files -for file in docutils/_string_template_compat.py ; do +for file in docutils/_string_template_compat.py docutils/math/{__init__.py,latex2mathml.py}; do sed -i -e '/#! *\/usr\/bin\/.*/{1D}' $file done +iconv -f ISO88592 -t UTF8 tools/editors/emacs/IDEAS.rst > tmp +mv tmp tools/editors/emacs/IDEAS.rst + %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} @@ -183,10 +184,16 @@ rm -rf %{buildroot} %{python3_sitelib}/* %changelog +* Tue Jul 12 2011 Toshio Kuratomi - 0.8-1 +- Upgrade to 0.8 final. +- Remove the two remaining Apache licensed files until their license is fixed. +- Patch regressions that we had already submitted upstream -- resubmit + * Tue May 17 2011 Toshio Kuratomi - 0.8-0.1.20110517svn7036 - Ship a snapshot of 0.8 so that we can build on python-3.2.1 - Unfortunately, 3.2.1 isn't out yet either. So also apply a fix for building with 3.2.0 that we'll need to remove later. +- The new docutils.math module is licensed Apache. Update the license to reflect this * Wed Mar 16 2011 Toshio Kuratomi - 0.7-5 - Fix building with python-3.2 via a workaround. Sent upstream awaiting diff --git a/sources b/sources index dad96d1..3e30e52 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -b31ddafaf1c091fca4661270cf20c1b0 docutils-0.8.tar.gz +f57474b69bfbf0eb608706a104f92dda docutils-0.8.tar.gz