%{!?_licensedir: %global license %%doc} %if 0%{?rhel} && 0%{?rhel} <= 6 %{!?__python2: %global __python2 /usr/bin/python2} %{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} %endif %if 0%{?fedora} # Requires a py3 version of trollius requested at: # https://bugzilla.redhat.com/1230868 %global with_python3 0 %else # EL doesn't have Python 3 %global with_python3 0 %endif %global pkgname trollius-redis %global modname trollius_redis Name: python-%{pkgname} Version: 0.1.4 Release: 1%{?dist} Summary: Redis client for the Python event loop PEP3156 for Trollius. License: BSD URL: http://pypi.python.org/pypi/trollius-redis Source0: https://pypi.python.org/packages/source/t/trollius_redis/trollius_redis-%{version}.tar.gz Requires: python-trollius BuildRequires: python-trollius BuildRequires: python2-devel BuildArch: noarch %description Redis client for Python trollius This Redis library is a completely asynchronous, non-blocking client for a Redis server. It depends on trollius (asyncio compatible for PEP 3156). It supports Python 2 Trollius-using developers. If you're new to asyncio, it can be helpful to check out the asyncio documentation first. %if 0%{?with_python3} %package -n python3-%{pkgname} Summary: Python 3.x Redis client for the python event loop PEP3156 Requires: python3-trollius BuildRequires: python3-devel BuildRequires: python3-trollius BuildArch: noarch %description -n python3-%{pkgname} Redis client for Python trollius This Redis library is a completely asynchronous, non-blocking client for a Redis server. It depends on trollius (asyncio compatible for PEP 3156). It supports Python 3 Trollius-using developers. If you're new to asyncio, it can be helpful to check out the asyncio documentation first. %endif %prep %setup -q -n %{modname}-%{version} %if 0%{?with_python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif # Remove bundled egg-info in case it exists rm -rf %{modname}.egg-info %build %{__python2} setup.py build %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install -O1 --skip-build --root=%{buildroot} %if 0%{?with_python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root=%{buildroot} popd %endif ## Tests are failing on koji because they require network acess #%check #%{__python2} setup.py test # #%if 0%{?with_python3} #pushd %{py3dir} #%{__python3} setup.py test #popd #%endif %files %doc README.rst # requested upstream: https://github.com/benjolitz/trollius-redis/issues/1 #%license LICENSE %{python2_sitelib}/%{modname}/ %{python2_sitelib}/%{modname}-%{version}* %if 0%{?with_python3} %files -n python3-%{pkgname} %doc README.rst %{python3_sitelib}/%{pkgname}-%{version}-py%{python3_version}.egg-info %{python3_sitelib}/%{pkgname} %endif %changelog * Wed Jun 10 2015 Pierre-Yves Chibon - 0.1.4-1 - initial package for Fedora