File python-eventlet.spec of Package python-eventlet

%global pypi_name eventlet

Name:           python-%{pypi_name}
Version:        0.21.0
Release:        1%{?dist}
Summary:        Highly concurrent networking library
License:        MIT
URL:            http://eventlet.net
Source0:        https://pypi.io/packages/source/e/eventlet/eventlet-%{version}.tar.gz
Patch0:			python-eventlet-0.21.0-change-install-requires.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools

%description
Eventlet is a networking library written in Python. It achieves high
scalability by using non-blocking io while at the same time retaining
high programmer usability by using coroutines to make the non-blocking
io operations appear blocking at the source code level.

%package -n python2-%{pypi_name}
Summary:        Highly concurrent networking library

Requires:       python2-greenlet

%{?python_provide:%python_provide python2-%{pypi_name}}

%description -n python2-%{pypi_name}
Eventlet is a networking library written in Python. It achieves high
scalability by using non-blocking io while at the same time retaining
high programmer usability by using coroutines to make the non-blocking
io operations appear blocking at the source code level.

%prep
%setup -q -n %{pypi_name}-%{version}
%patch0 -p1

rm -rf *.egg-info

%build
%py2_build

%install
%py2_install
# FIXME: Those files are not meant to be used with Python 2.7
# Anyway the whole module eventlet.green.http is Python 3 only
# Trying to import it will fail under Python 2.7
# https://github.com/eventlet/eventlet/issues/369
%{__rm} -rf %{buildroot}/%{python2_sitelib}/%{pypi_name}/green/http/{cookiejar,client}.py


%files -n python2-%{pypi_name}
%doc README.rst AUTHORS LICENSE NEWS
%if (0%{?rhel} >= 7) || (0%{?suse_version} >= 1315)
%license LICENSE
%endif
%{python2_sitelib}/%{pypi_name}
%{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info

%changelog
* Mon Dec 25 2017 Yunfei Shi <shiyf2@lenovo.com> - 0.21.0-1
- Initial package.
openSUSE Build Service is sponsored by