summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2013-03-14 16:56:53 +0100
committerMatěj Cepl <mcepl@redhat.com>2013-03-14 16:57:24 +0100
commitac9ec1db070874a8af06d7ce7f542e5815308b3c (patch)
treeb033c2b86790ac094a3d17022e64dac33fd3f11d
parent3439239e404370ec45bb0542fc1da0262aaa9fb7 (diff)
parent9b3cec8edebe4dce09817e8ea7689671b484493d (diff)
downloadpython-feedparser-el6.zip
python-feedparser-el6.tar.gz
python-feedparser-el6.tar.xz
Merge branch 'master' into el6HEADel6
Conflicts: .gitignore python-feedparser.spec sources
-rw-r--r--democracynow_feedparser_fix.patch11
-rw-r--r--feedparser-5.1.3-tests-py3.patch33
-rw-r--r--feedparser_utf8_decoding.patch11
-rw-r--r--python-feedparser.spec164
-rw-r--r--sources2
5 files changed, 185 insertions, 36 deletions
diff --git a/democracynow_feedparser_fix.patch b/democracynow_feedparser_fix.patch
deleted file mode 100644
index 58c710a..0000000
--- a/democracynow_feedparser_fix.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- feedparser.py.orig 2007-12-28 00:59:15.000000000 +0100
-+++ feedparser.py 2007-12-28 00:59:46.000000000 +0100
-@@ -563,7 +563,7 @@
-
- def mapContentType(self, contentType):
- contentType = contentType.lower()
-- if contentType == 'text':
-+ if contentType == 'text' or contentType == 'plain':
- contentType = 'text/plain'
- elif contentType == 'html':
- contentType = 'text/html'
diff --git a/feedparser-5.1.3-tests-py3.patch b/feedparser-5.1.3-tests-py3.patch
new file mode 100644
index 0000000..c6cf4bc
--- /dev/null
+++ b/feedparser-5.1.3-tests-py3.patch
@@ -0,0 +1,33 @@
+diff -Nur feedparser-5.1.3-orig/feedparser/feedparsertest.py feedparser-5.1.3/feedparser/feedparsertest.py
+--- feedparser-5.1.3-orig/feedparser/feedparsertest.py 2012-12-09 17:18:06.000000000 +0100
++++ feedparser-5.1.3/feedparser/feedparsertest.py 2013-03-09 11:38:04.664372770 +0100
+@@ -163,9 +163,9 @@
+ try:
+ if not eval(evalString, globals(), env):
+ failure=(msg or 'not eval(%s) \nWITH env(%s)' % (evalString, pprint.pformat(env)))
+- raise self.failureException, failure
++ raise self.failureException(failure)
+ if not everythingIsUnicode(env):
+- raise self.failureException, "not everything is unicode \nWITH env(%s)" % (pprint.pformat(env), )
++ raise self.failureException("not everything is unicode \nWITH env(%s)" % (pprint.pformat(env), ))
+ except SyntaxError:
+ # Python 3 doesn't have the `u""` syntax, so evalString needs to be modified,
+ # which will require the failure message to be updated
+@@ -173,7 +173,7 @@
+ evalString = re.sub(unicode2_re, _s2bytes(' "'), evalString)
+ if not eval(evalString, globals(), env):
+ failure=(msg or 'not eval(%s) \nWITH env(%s)' % (evalString, pprint.pformat(env)))
+- raise self.failureException, failure
++ raise self.failureException(failure)
+
+ class BaseTestCase(unittest.TestCase):
+ failUnlessEval = failUnlessEval
+@@ -742,7 +742,7 @@
+ skipUnless = '1'
+ search_results = desc_re.search(data)
+ if not search_results:
+- raise RuntimeError, "can't parse %s" % xmlfile
++ raise RuntimeError("can't parse %s" % xmlfile)
+ description, evalString = map(lambda s: s.strip(), list(search_results.groups()))
+ description = xmlfile + ": " + unicode(description, 'utf8')
+ return description, evalString, skipUnless
diff --git a/feedparser_utf8_decoding.patch b/feedparser_utf8_decoding.patch
deleted file mode 100644
index 44111b9..0000000
--- a/feedparser_utf8_decoding.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /var/lib/python-support/python2.5/feedparser.py 2008-01-23 20:10:27.000000000 +0100
-+++ feedparser.py 2008-07-28 11:01:38.000000000 +0200
-@@ -1455,7 +1455,7 @@
- # thanks to Kevin Marks for this breathtaking hack to deal with (valid) high-bit attribute values in UTF-8 feeds
- for key, value in attrs:
- if type(value) != type(u''):
-- value = unicode(value, self.encoding)
-+ value = unicode(value, self.encoding, errors='replace')
- uattrs.append((unicode(key, self.encoding), value))
- strattrs = u''.join([u' %s="%s"' % (key, value) for key, value in uattrs]).encode(self.encoding)
- if tag in self.elements_no_end_tag:
diff --git a/python-feedparser.spec b/python-feedparser.spec
index b8dfc27..a02a339 100644
--- a/python-feedparser.spec
+++ b/python-feedparser.spec
@@ -1,18 +1,56 @@
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%if 0%{?rhel} >= 6 || 0%{?fedora} > 12
+%bcond_without python3
+%else
+%bcond_with python3
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print (get_python_lib())")}
+%endif
+
+%if %{with python3}
+%global __python3 /usr/bin/python3
+%{!?python3_sitelib: %define python3_sitelib %(%{__python3} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
+%endif
+
+%global srcname feedparser
Name: python-feedparser
-Version: 5.0.1
-Release: 1%{?dist}
+Version: 5.1.3
+Release: 2.0.EL6py3%{?dist}
Summary: Parse RSS and Atom feeds in Python
Group: Development/Languages
License: BSD
-URL: http://feedparser.org/
+URL: http://code.google.com/p/feedparser/
Source0: http://feedparser.googlecode.com/files/feedparser-%{version}.tar.bz2
+# only for EPEL5
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: python-devel
+BuildRequires: python-setuptools
+
+# optional import at run-time, but is likely installed because other
+# python module packages depend on it, too
+# no failing tests on 2013-03-09 with python-chardet-2.0.1
+BuildRequires: python-chardet
+Requires: python-chardet
+
+## TODO: Decide on these, also with regard to explicit "Requires".
+## Optional imports at run-time and influence the test-suite, too,
+## and causes additional tests to fail.
+#
+#BuildRequires: python-BeautifulSoup
+# usage removed in > 5.1.3
+#
+## the preferred XML parser
+#BuildRequires: libxml2-python
+
+## TODO: python3-chardet BR and Req
+# fixes included in > 5.1.3
+
+# shows that for Python 3 the test-suite fails early with
+# ImportError: No module named 'BaseHTTPServer'
+Patch0: feedparser-5.1.3-tests-py3.patch
+
%description
Universal Feed Parser is a Python module for downloading and parsing
@@ -21,43 +59,143 @@ Userland RSS 0.91, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0,
Atom 0.3, Atom 1.0, and CDF feeds. It also parses several popular extension
modules, including Dublin Core and Apple's iTunes extensions.
+%if %{with python3}
+%package -n python3-%{srcname}
+Summary: Parse RSS and Atom feeds in Python
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+%description -n python3-%{srcname}
+Universal Feed Parser is a Python module for downloading and parsing
+syndicated feeds. It can handle RSS 0.90, Netscape RSS 0.91,
+Userland RSS 0.91, RSS 0.92, RSS 0.93, RSS 0.94, RSS 1.0, RSS 2.0,
+Atom 0.3, Atom 1.0, and CDF feeds. It also parses several popular extension
+modules, including Dublin Core and Apple's iTunes extensions.
+%endif
+
%prep
-%setup -q -n feedparser-%{version}
+%setup -q -n %{srcname}-%{version}
+%if %{with python3}
+cp -a . %{py3dir}
+pushd %{py3dir}
+%patch0 -p1
+popd
+%endif
+
find -type f -exec sed -i 's/\r//' {} ';'
find -type f -exec chmod 0644 {} ';'
%build
-CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+%{__python} setup.py build
+%if %{with python3}
+pushd %{py3dir}
+%{__python3} setup.py build
+popd
+%endif
%install
-rm -rf $RPM_BUILD_ROOT
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
+# only for EPEL5
+rm -rf %{buildroot}
-
-%check
-%{__python} feedparser/feedparsertest.py
+%{__python} setup.py install -O1 --skip-build --root %{buildroot}
+%if %{with python3}
+pushd %{py3dir}
+%{__python3} setup.py install --skip-build --root %{buildroot}
+popd
+%endif
+%check
+pushd feedparser
+PYTHONPATH=%{buildroot}%{python_sitelib} %{__python} feedparsertest.py || :
+popd
+%if %{with python3}
+pushd %{py3dir}/feedparser
+PYTHONPATH=%{buildroot}%{python3_sitelib} %{__python3} feedparsertest.py || :
+popd
+%endif
+
+# only for EPEL5
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
-%doc LICENSE README
+%doc LICENSE README NEWS
%{python_sitelib}/*
+%if %{with python3}
+%files -n python3-%{srcname}
+%doc LICENSE README NEWS
+%{python3_sitelib}/*
+%endif
+
%changelog
+* Sat Mar 9 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 5.1.3-2
+- Add BuildRequires/Requires python-chardet because if it's installed
+ as a dependency of other Python module packages, it would be imported
+ and used anyway, and it doesn't make any tests fail.
+
+* Sat Mar 9 2013 Michael Schwendt <mschwendt@fedoraproject.org> - 5.1.3-1
+- Update to 5.1.3 (50k diff).
+- Patch test-suite minimally for python3 to show that it fails early.
+- Fix file permissions and line delimiters at end of %%prep section.
+- Fix python3 sitelib path in %%check section.
+
+* Fri Mar 8 2013 Michael Schwendt <mschwendt@fedoraproject.org>
+- Update URL to new location at Google code (#880138).
+
+* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-6
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
+
+* Tue Jan 22 2013 Haïkel Guémar <hguemar@fedoraproject.org> - 5.1.2-5
+- remove rhel logic from with_python3 conditional (RHBZ #902896)
+
+* Sat Aug 04 2012 David Malcolm <dmalcolm@redhat.com> - 5.1.2-4
+- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3
+
+* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.1.2-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
+
+* Wed May 23 2012 Michael Schwendt <mschwendt@fedoraproject.org> - 5.1.2-2
+- Also package NEWS files as documentation.
+- 5.1.2 fixes CVE-2012-2921
+ (DoS via memory consumption processing ENTITY declarations).
+
+* Tue May 22 2012 Michael Schwendt <mschwendt@fedoraproject.org> - 5.1.2-1
+- Update to 5.1.2 and its security fix (#787401).
+- Ignore testsuite results for now (#787401).
+- Set PYTHONPATH in %%check section to include files in %%buildroot.
+- Drop CFLAGS usage from spec file, because this is Python.
+
+* Sat Feb 4 2012 Haïkel Guémar <hguemar@fedoraproject.org> - 5.1-1
+- upstream 5.1 (#787401)
+- spec cleanup
+- tests disabled
+- python3 support
+
+* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 5.0.1-2
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
+
* Tue Apr 05 2011 Luke Macken <lmacken@redhat.com> - 5.0.1-1
- Latest upstream release
- Remove feedparser_utf8_decoding.patch
- Remove democracynow_feedparser_fix.patch
- Run the test suite
+* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.1-13
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
+
+* Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 4.1-12
+- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
+
+* Mon Dec 14 2009 Haïkel Guémar <karlthered@gmail.com> - 4.1-11
+- rebuild for Fedora 13
+
* Fri Aug 07 2009 Konstantin Ryabitsev <icon@fedoraproject.org> - 4.1-10
- Apply patch for title munging issue (#491373)
diff --git a/sources b/sources
index e1e45d4..584dbe8 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-702835de74bd4a578524f311e62c2877 feedparser-5.0.1.tar.bz2
+6fb6372a1dc2f56d4d79d740b8f49f25 feedparser-5.1.3.tar.bz2