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
12 # keep 3.x here for python2 support
16 Group: Libraries/Python
17 #Source0Download: https://pypi.org/simple/bleach/
18 Source0: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
19 # Source0-md5: b4c1b8f27289f9e5d73792daed4c0879
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-six >= 1.9.0
29 BuildRequires: python-webencodings
33 BuildRequires: python3-modules >= 1:3.5
34 BuildRequires: python3-setuptools
36 BuildRequires: python3-pytest >= 3.0.0
37 BuildRequires: python3-six >= 1.9.0
38 BuildRequires: python3-webencodings
42 BuildRequires: sphinx-pdg
44 Requires: python-modules >= 1:2.7
46 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49 Bleach is an allowed-list-based HTML sanitizing library that escapes
50 or strips markup and attributes.
52 %description -l pl.UTF-8
53 Bleach to oparta na liście elementów dozwolonych biblioteka
54 zabezpieczająca lub usuwająca znaczniki i atrybuty.
56 %package -n python3-bleach
57 Summary: An easy safelist-based HTML-sanitizing tool
58 Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
59 Group: Libraries/Python
60 Requires: python3-modules >= 1:3.5
62 %description -n python3-bleach
63 Bleach is an allowed-list-based HTML sanitizing library that escapes
64 or strips markup and attributes.
66 %description -n python3-bleach -l pl.UTF-8
67 Bleach to oparta na liście elementów dozwolonych biblioteka
68 zabezpieczająca lub usuwająca znaczniki i atrybuty.
71 Summary: API documentation for Python bleach module
72 Summary(pl.UTF-8): Dokumentacja API modułu Pythona bleach
76 API documentation for Python bleach module.
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API modułu Pythona bleach.
82 %setup -q -n bleach-%{version}
89 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
90 %{__python} -m pytest tests
98 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99 %{__python3} -m pytest tests
104 %{__make} -C docs html
108 rm -rf $RPM_BUILD_ROOT
121 rm -rf $RPM_BUILD_ROOT
125 %defattr(644,root,root,755)
126 %doc CHANGES CONTRIBUTORS LICENSE README.rst
127 %{py_sitescriptdir}/bleach
128 %{py_sitescriptdir}/bleach-%{version}-py*.egg-info
132 %files -n python3-bleach
133 %defattr(644,root,root,755)
134 %doc CHANGES CONTRIBUTORS LICENSE README.rst
135 %{py3_sitescriptdir}/bleach
136 %{py3_sitescriptdir}/bleach-%{version}-py*.egg-info
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_modules,_static,*.html,*.js}