%if 0%{?fedora} || 0%{?rhel} > 7 %global with_python3 1 %else %global with_python2 1 %endif %global pypi_name django-debreach Name: python-%{pypi_name} Version: 1.5.2 Release: 1%{?dist} Summary: Basic/extra mitigation against the BREACH attack for Django projects License: BSD URL: http://github.com/lpomfrey/django-debreach Source0: https://files.pythonhosted.org/packages/source/d/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch %if 0%{?with_python2} BuildRequires: python2-devel BuildRequires: python2-django BuildRequires: python2-setuptools %endif %if 0%{?with_python3} BuildRequires: python3-devel BuildRequires: python3dist(django) BuildRequires: python3dist(setuptools) BuildRequires: python3dist(sphinx) %endif %description Basic/extra mitigation against the BREACH attack for Django projects. When combined with rate limiting in your web-server, or by using something like django-ratelimit, the techniques here should provide at least some protection against the BREACH attack. %if 0%{?with_python2} %package -n python2-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python2-%{pypi_name}} Requires: python2-django %description -n python2-%{pypi_name} Basic/extra mitigation against the BREACH attack for Django projects. When combined with rate limiting in your web-server, or by using something like django-ratelimit, the techniques here should provide at least some protection against the BREACH attack. %endif %if 0%{?with_python3} %package -n python3-%{pypi_name} Summary: %{summary} %{?python_provide:%python_provide python3-%{pypi_name}} Requires: python3dist(django) %description -n python3-%{pypi_name} Basic/extra mitigation against the BREACH attack for Django projects. When combined with rate limiting in your web-server, or by using something like django-ratelimit, the techniques here should provide at least some protection against the BREACH attack. %endif %prep %autosetup -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %build %if 0%{?with_python2} %py2_build %endif %if 0%{?with_python3} %py3_build %endif %install # Must do the default python version install last because # the scripts in /usr/bin are overwritten with every setup.py install. %if 0%{?with_python2} %py2_install %endif %if 0%{?with_python3} %py3_install %endif %check %if 0%{?with_python2} PYTHONPATH=. %{__python2} setup.py test %endif %if 0%{?with_python3} PYTHONPATH=. %{__python3} setup.py test %endif %if 0%{?with_python2} %files -n python2-%{pypi_name} %license LICENSE %doc README.rst %{python2_sitelib}/debreach %{python2_sitelib}/django_debreach-%{version}-py?.?.egg-info %endif %if 0%{?with_python3} %files -n python3-%{pypi_name} %license LICENSE %doc README.rst %{python3_sitelib}/debreach %{python3_sitelib}/django_debreach-%{version}-py?.?.egg-info %endif %changelog * Fri Aug 31 2018 Javier Peña - 1.5.2-1 - Initial package.