%if 0%{?fedora} > 12 %bcond_without python3 %else %bcond_with python3 %endif %global pypi_name bleach Name: python-%{pypi_name} Version: 1.4.1 Release: 2%{?dist} Summary: An easy whitelist-based HTML-sanitizing tool License: ASL 2.0 URL: http://github.com/jsocol/bleach Source0: https://pypi.python.org/packages/source/b/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python2-devel BuildRequires: python-nose >= 1.3 # Runtime requirements are test requirements, mirror them here BuildRequires: python-six BuildRequires: python-html5lib >= 0.999 Requires: python-six Requires: python-html5lib >= 0.999 %if %{with python3} BuildRequires: python3-devel BuildRequires: python3-nose >= 1.3 # Runtime requirements are test requirements, mirror them here BuildRequires: python3-six BuildRequires: python3-html5lib >= 0.999 Requires: python3-html5lib >= 0.999 Requires: python3-six %package -n python3-%{pypi_name} Summary: An easy whitelist-based HTML-sanitizing tool %description -n python3-%{pypi_name} Bleach is an HTML sanitizing library that escapes or strips markup and attributes based on a white list. %endif %description Bleach is an HTML sanitizing library that escapes or strips markup and attributes based on a white list. %prep %setup -q -n %{pypi_name}-%{version} # Remove bundled egg-info rm -rf %{pypi_name}.egg-info %if %{with python3} rm -rf %{py3dir} cp -a . %{py3dir} %endif %build %{__python2} setup.py build %if %{with python3} pushd %{py3dir} %{__python3} setup.py build popd %endif %install %{__python2} setup.py install --skip-build --root %{buildroot} %if %{with python3} pushd %{py3dir} %{__python3} setup.py install -O1 --skip-build --root %{buildroot} popd %endif %check %{__python2} setup.py test %if %{with python3} %{__python3} setup.py test %endif %files %doc README.rst %license LICENSE %{python2_sitelib}/%{pypi_name} %{python2_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %if %{with python3} %files -n python3-%{pypi_name} %doc README.rst %license LICENSE %{python3_sitelib}/%{pypi_name} %{python3_sitelib}/%{pypi_name}-%{version}-py?.?.egg-info %endif %changelog * Thu Feb 12 2015 Matthias Runge - 1.4.1-2 - add python3 subpackage * Sat Feb 07 2015 Matthias Runge - 1.4.1-1 - Initial package. (rhbz#1190378)