%global pypi_name django-redis
%global modname django_redis
%if 0%{?fedora}
%global with_python3 1
%endif
Name: python-%{pypi_name}
Version: 4.3.0
Release: 1%{?dist}
Summary: Full featured redis cache backend for Django
License: BSD
URL: https://github.com/niwibe/django-redis
Source0: https://pypi.python.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
BuildArch: noarch
%description
Full featured redis cache backend for Django.
%package -n python2-%{pypi_name}
Summary: Full featured redis cache backend for Django
%{?python_provide:%python_provide python2-%{pypi_name}}
BuildRequires: python2-devel
BuildRequires: python-setuptools
BuildRequires: python-django
Requires: python-django
Requires: python-redis >= 2.10.0
%description -n python2-%{pypi_name}
Full featured redis cache backend for Django.
%if 0%{?with_python3}
%package -n python3-%{pypi_name}
Summary: Full featured redis cache backend for Django
%{?python_provide:%python_provide python3-%{pypi_name}}
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-django
Requires: python3-django
Requires: python3-redis >= 2.10.0
%description -n python3-%{pypi_name}
Full featured redis cache backend for Django.
%endif
%prep
%autosetup -n %{pypi_name}-%{version}
# Remove bundled egg-info
rm -rf %{pypi_name}.egg-info
%build
%py2_build
%if 0%{?with_python3}
%py3_build
%endif
%install
# Must do the subpackages' install first because the scripts in /usr/bin are
# overwritten with every setup.py install.
%if 0%{?with_python3}
%py3_install
%endif
%py2_install
%files -n python2-%{pypi_name}
%doc README.rst
%license LICENSE
%{python2_sitelib}/%{modname}
%{python2_sitelib}/django_redis-%{version}-py?.?.egg-info
%if 0%{?with_python3}
%files -n python3-%{pypi_name}
%doc README.rst
%license LICENSE
%{python3_sitelib}/%{modname}
%{python3_sitelib}/django_redis-%{version}-py?.?.egg-info
%endif
%changelog
* Thu Jan 14 2016 Haïkel Guémar <hguemar@fedoraproject.org> - 4.3.0-1
- Initial package.