%global pypi_name feedgenerator
%global sum Standalone version of Django's feedgenerator module
%global commit 6b6572cfd3e7f40993204af5aa70aab443a5b63c
%global shortcommit %(c=%{commit}; echo ${c:0:7})
Name: python-%{pypi_name}
Version: 1.9.1
Release: %autorelease
Summary: %{sum}
License: BSD
URL: https://github.com/getpelican/%{pypi_name}
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: %{py3_dist pytz}
BuildRequires: %{py3_dist setuptools}
BuildRequires: %{py3_dist six}
%description
FeedGenerator is a standalone version of Django’s feedgenerator module. It has
evolved over time, including an update for Py3K and numerous other
enhancements.
%package -n python3-%{pypi_name}
Summary: %{sum}
Requires: %{py3_dist six pytz}
%py_provides python3-%{pypi_name}
%description -n python3-%{pypi_name}
FeedGenerator is a standalone version of Django’s feedgenerator module. It has
evolved over time, including an update for Py3K and numerous other
enhancements.
%prep
%autosetup -n %{pypi_name}-%{version}
rm -rf .tox
rm -rf feedgenerator.egg-info
rm -rf feedgenerator/django/utils/six.py
for f in feedgenerator/django/utils/*py;
do
sed -i -e 's/from . import six/import six/' -e 's/from .six \(import .*$\)/from six \1/' $f
done
%build
%py3_build
%install
%py3_install
%check
%{__python3} setup.py test
%files -n python3-%{pypi_name}
%license LICENSE
%doc README.rst
%{python3_sitelib}/*
%changelog
%autochangelog