1 # TODO: use system html5lib
4 %bcond_without doc # Sphinx documentation
5 %bcond_without tests # unit tests
6 %bcond_without python2 # CPython 2.x module
7 %bcond_without python3 # CPython 3.x module
9 Summary: An easy safelist-based HTML-sanitizing tool
10 Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
15 Group: Libraries/Python
16 #Source0Download: https://pypi.org/simple/bleach/
17 Source0: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
18 # Source0-md5: fc8df989e0200a45f7a3a95ef9ee9854
19 Patch0: %{name}-pytest.patch
20 URL: https://pypi.org/project/bleach/
21 BuildRequires: rpm-pythonprov
22 BuildRequires: rpmbuild(macros) >= 1.714
24 BuildRequires: python-modules >= 1:2.7
25 BuildRequires: python-setuptools
27 BuildRequires: python-pytest >= 3.0.0
28 BuildRequires: python-pytest-runner >= 2.0
29 BuildRequires: python-six >= 1.9.0
30 BuildRequires: python-webencodings
34 BuildRequires: python3-modules >= 1:3.4
35 BuildRequires: python3-setuptools
37 BuildRequires: python3-pytest >= 3.0.0
38 BuildRequires: python3-pytest-runner >= 2.0
39 BuildRequires: python3-six >= 1.9.0
40 BuildRequires: python3-webencodings
44 BuildRequires: sphinx-pdg
46 Requires: python-modules >= 1:2.7
48 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
51 Bleach is an allowed-list-based HTML sanitizing library that escapes
52 or strips markup and attributes.
54 %description -l pl.UTF-8
55 Bleach to oparta na liście elementów dozwolonych biblioteka
56 zabezpieczająca lub usuwająca znaczniki i atrybuty.
58 %package -n python3-bleach
59 Summary: An easy safelist-based HTML-sanitizing tool
60 Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
61 Group: Libraries/Python
62 Requires: python3-modules >= 1:3.4
64 %description -n python3-bleach
65 Bleach is an allowed-list-based HTML sanitizing library that escapes
66 or strips markup and attributes.
68 %description -n python3-bleach -l pl.UTF-8
69 Bleach to oparta na liście elementów dozwolonych biblioteka
70 zabezpieczająca lub usuwająca znaczniki i atrybuty.
73 Summary: API documentation for Python bleach module
74 Summary(pl.UTF-8): Dokumentacja API modułu Pythona bleach
78 API documentation for Python bleach module.
80 %description apidocs -l pl.UTF-8
81 Dokumentacja API modułu Pythona bleach.
84 %setup -q -n bleach-%{version}
89 %py_build %{?with_tests:test}
93 %py3_build %{?with_tests:test}
97 %{__make} -C docs html
101 rm -rf $RPM_BUILD_ROOT
114 rm -rf $RPM_BUILD_ROOT
118 %defattr(644,root,root,755)
119 %doc CHANGES CONTRIBUTORS LICENSE README.rst
120 %{py_sitescriptdir}/bleach
121 %{py_sitescriptdir}/bleach-%{version}-py*.egg-info
125 %files -n python3-bleach
126 %defattr(644,root,root,755)
127 %doc CHANGES CONTRIBUTORS LICENSE README.rst
128 %{py3_sitescriptdir}/bleach
129 %{py3_sitescriptdir}/bleach-%{version}-py*.egg-info
134 %defattr(644,root,root,755)
135 %doc docs/_build/html/{_modules,_static,*.html,*.js}