File python-feedparser.spec of Package python-feedparser
#
# spec file for package python-feedparser
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# Tests require a network connection
%bcond_without tests
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-feedparser
Version: 5.2.1
Release: 0
Summary: Universal Feed Parser Module for Python
License: BSD-2-Clause
Group: Development/Libraries/Python
Url: https://github.com/kurtmckee/feedparser
Source: https://files.pythonhosted.org/packages/source/f/feedparser/feedparser-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-2to3
BuildRequires: %{python_module devel}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module xml}
Requires: python-xml
BuildArch: noarch
%python_subpackages
%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
%setup -q -n feedparser-%{version}
find . -type f -exec chmod 0644 {} \; # 5.2.1 had executable bit set on almost all files
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with tests}
%check
# Tests only work on Python 2.x
pushd feedparser
python2 feedparsertest.py
popd
%endif
%files %{python_files}
%defattr(-,root,root)
%doc LICENSE NEWS README.rst
%{python_sitelib}/feedparser.py*
%pycache_only %{python_sitelib}/__pycache__/feedparser.*.py*
%{python_sitelib}/feedparser-%{version}-py*.egg-info
%changelog