2009-09-03 14:43:11 +00:00
|
|
|
#
|
2011-06-09 13:37:53 +00:00
|
|
|
# spec file for package python-feedparser
|
2009-09-03 14:43:11 +00:00
|
|
|
#
|
2019-04-01 09:04:03 +00:00
|
|
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
2009-09-03 14:43:11 +00:00
|
|
|
#
|
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
2018-12-04 13:27:07 +00:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2009-09-03 14:43:11 +00:00
|
|
|
#
|
|
|
|
|
|
2018-12-04 13:27:07 +00:00
|
|
|
|
2018-12-04 17:13:23 +00:00
|
|
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
2009-09-03 14:43:11 +00:00
|
|
|
Name: python-feedparser
|
2017-05-01 15:13:51 +00:00
|
|
|
Version: 5.2.1
|
2011-12-08 15:43:56 +00:00
|
|
|
Release: 0
|
2009-09-03 14:43:11 +00:00
|
|
|
Summary: Universal Feed Parser Module for Python
|
2011-12-08 15:43:56 +00:00
|
|
|
License: BSD-2-Clause
|
2009-09-03 14:43:11 +00:00
|
|
|
Group: Development/Libraries/Python
|
2018-12-04 17:13:23 +00:00
|
|
|
URL: https://github.com/kurtmckee/feedparser
|
2017-05-01 15:13:51 +00:00
|
|
|
Source: https://files.pythonhosted.org/packages/source/f/feedparser/feedparser-%{version}.tar.bz2
|
2019-04-01 09:04:03 +00:00
|
|
|
Patch0: py37.patch
|
|
|
|
|
Patch1: non-ascii-entity-hiding.patch
|
|
|
|
|
# Similar to https://github.com/kurtmckee/feedparser/commit/b3d9463.patch
|
|
|
|
|
# However the "gets overwritten as xml.sax.SAXException later" is not
|
|
|
|
|
# happening in version 5.2.1.
|
|
|
|
|
Patch2: catch-gzip-error.patch
|
2018-12-04 13:27:07 +00:00
|
|
|
BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: %{python_module xml}
|
2017-05-01 15:13:51 +00:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
BuildRequires: python-rpm-macros
|
2019-04-01 09:04:03 +00:00
|
|
|
BuildRequires: python3-sgmllib3k
|
|
|
|
|
# Tests fail in Python 2 and 3 when chardet is installed
|
|
|
|
|
#BuildRequires: python3-chardet
|
2011-06-09 13:37:53 +00:00
|
|
|
Requires: python-xml
|
2019-04-01 09:04:03 +00:00
|
|
|
# chardet is an optional dependency, but some tests fail when it is present
|
|
|
|
|
Recommends: python-chardet
|
|
|
|
|
%ifpython3
|
|
|
|
|
# If sgmllib is not available, the parser can fail with undefined local variable
|
|
|
|
|
Requires: python3-sgmllib3k
|
|
|
|
|
%endif
|
2009-09-03 14:43:11 +00:00
|
|
|
BuildArch: noarch
|
2017-05-01 15:13:51 +00:00
|
|
|
%python_subpackages
|
2009-09-03 14:43:11 +00:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
A universal feed parser module for Python that handles RSS 0.9x, RSS 1.0, RSS
|
|
|
|
|
2.0, CDF, Atom 0.3, Atom 1.0 feeds.
|
|
|
|
|
|
|
|
|
|
%prep
|
2011-06-09 13:37:53 +00:00
|
|
|
%setup -q -n feedparser-%{version}
|
2019-04-01 09:04:03 +00:00
|
|
|
%autopatch -p1
|
|
|
|
|
|
2017-05-01 15:13:51 +00:00
|
|
|
find . -type f -exec chmod 0644 {} \; # 5.2.1 had executable bit set on almost all files
|
2009-09-03 14:43:11 +00:00
|
|
|
|
2019-04-01 09:04:03 +00:00
|
|
|
# In version 5.2.1, it contains only test data, so move it out of install
|
|
|
|
|
mv feedparser/tests .
|
|
|
|
|
|
|
|
|
|
# Move the test module out of the runtime install, into top level directory
|
|
|
|
|
# so it can find the test data, and manually run 2to3.
|
|
|
|
|
python3 -m lib2to3 -w -n -o . --add-suffix=-%{python3_bin_suffix} --no-diffs feedparser/feedparsertest.py
|
|
|
|
|
mv feedparser/feedparsertest.py feedparsertest.py-%{python2_bin_suffix}
|
|
|
|
|
|
2009-09-03 14:43:11 +00:00
|
|
|
%build
|
2017-05-01 15:13:51 +00:00
|
|
|
%python_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%python_install
|
|
|
|
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
2009-09-03 14:43:11 +00:00
|
|
|
|
2011-06-09 13:37:53 +00:00
|
|
|
%check
|
2019-04-01 09:04:03 +00:00
|
|
|
%{python_expand export PYTHONPATH=%{buildroot}%{$python_sitelib}:${PWD}
|
|
|
|
|
cp feedparsertest.py-%{$python_bin_suffix} feedparsertest.py
|
|
|
|
|
$python -c 'import feedparser; assert feedparser._XML_AVAILABLE == 1; assert feedparser._SGML_AVAILABLE == 1'
|
|
|
|
|
$python -c 'import feedparsertest; assert feedparsertest._UTF32_AVAILABLE == 1'
|
|
|
|
|
$python feedparsertest.py
|
|
|
|
|
}
|
2011-06-09 13:37:53 +00:00
|
|
|
|
2017-05-01 15:13:51 +00:00
|
|
|
%files %{python_files}
|
2018-12-04 17:13:23 +00:00
|
|
|
%license LICENSE
|
|
|
|
|
%doc NEWS README.rst
|
2017-05-01 15:13:51 +00:00
|
|
|
%{python_sitelib}/feedparser.py*
|
|
|
|
|
%pycache_only %{python_sitelib}/__pycache__/feedparser.*.py*
|
|
|
|
|
%{python_sitelib}/feedparser-%{version}-py*.egg-info
|
2009-09-03 14:43:11 +00:00
|
|
|
|
|
|
|
|
%changelog
|