Blob Blame History Raw
%global modname bleach

Name:           python-%{modname}
Version:        1.5
Release:        2%{?dist}
Summary:        An easy whitelist-based HTML-sanitizing tool

License:        ASL 2.0
URL:            http://github.com/jsocol/bleach
Source0:        %{url}/archive/v%{version}/%{modname}-%{version}.tar.gz

# https://github.com/mozilla/bleach/issues/244
Patch0001:      0001-setup.py-don-t-hardcode-pytest-versions.patch

BuildArch:      noarch

%global _description \
Bleach is an HTML sanitizing library that escapes or strips markup and\
attributes based on a white list.

%description %{_description}

%package -n python2-%{modname}
Summary:        %{summary}
%{?python_provide:%python_provide python2-%{modname}}
BuildRequires:  python2-devel
BuildRequires:  python2-setuptools
BuildRequires:  python2-pytest
BuildRequires:  python2-pytest-runner
BuildRequires:  python2-six
BuildRequires:  python-html5lib
Requires:       python2-six
Requires:       python-html5lib

%description -n python2-%{modname} %{_description}

Python 2 version.

%package -n python3-%{modname}
Summary:        An easy whitelist-based HTML-sanitizing tool
%{?python_provide:%python_provide python3-%{modname}}
BuildRequires:  python3-devel
BuildRequires:  python3-setuptools
BuildRequires:  python3-pytest
BuildRequires:  python3-pytest-runner
BuildRequires:  python3-six
BuildRequires:  python3-html5lib
Requires:       python3-six
Requires:       python3-html5lib

%description -n python3-%{modname} %{_description}

Python 3 version.

%prep
%autosetup -n %{modname}-%{version} -p1

%build
%py2_build
%py3_build

%install
%py2_install
%py3_install

%check
%{__python2} setup.py test
%{__python3} setup.py test

%files -n python2-%{modname}
%license LICENSE
%doc README.rst
%{python2_sitelib}/%{modname}-*.egg-info/
%{python2_sitelib}/%{modname}/

%files -n python3-%{modname}
%license LICENSE
%doc README.rst
%{python3_sitelib}/%{modname}-*.egg-info/
%{python3_sitelib}/%{modname}/

%changelog
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Mon Jan 02 2017 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 1.5-1
- Update to 1.5.0

* Mon Dec 19 2016 Miro HronĨok <mhroncok@redhat.com> - 1.4.3-2
- Rebuild for Python 3.6

* Fri Aug 26 2016 Igor Gnatenko <ignatenko@redhat.com> - 1.4.3-1
- Update to 1.4.3
- Fix packaging

* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-7
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Tue Nov 10 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-5
- Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5

* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Mon Jun 15 2015 Matthias Runge <mrunge@redhat.com> - 1.4.1-3
- fix requirements to install only a single version, not both
  (rhbz#1231426)

* Thu Feb 12 2015 Matthias Runge <mrunge@redhat.com> - 1.4.1-2
- add python3 subpackage

* Sat Feb 07 2015 Matthias Runge <mrunge@redhat.com> - 1.4.1-1
- Initial package. (rhbz#1190378)