]> git.pld-linux.org Git - packages/python-bleach.git/blame - python-bleach.spec
rebuild with tests and docs
[packages/python-bleach.git] / python-bleach.spec
CommitLineData
d0daa539
JB
1# TODO: use system html5lib
2#
3# Conditional build:
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
8
9Summary: An easy safelist-based HTML-sanitizing tool
10Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
11Name: python-bleach
12Version: 3.1.0
9a2b133e 13Release: 6
d0daa539
JB
14License: Apache v2.0
15Group: Libraries/Python
16#Source0Download: https://pypi.org/simple/bleach/
17Source0: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
18# Source0-md5: fc8df989e0200a45f7a3a95ef9ee9854
19Patch0: %{name}-pytest.patch
20URL: https://pypi.org/project/bleach/
21BuildRequires: rpm-pythonprov
22BuildRequires: rpmbuild(macros) >= 1.714
23%if %{with python2}
24BuildRequires: python-modules >= 1:2.7
25BuildRequires: python-setuptools
26%if %{with tests}
27BuildRequires: python-pytest >= 3.0.0
28BuildRequires: python-pytest-runner >= 2.0
29BuildRequires: python-six >= 1.9.0
30BuildRequires: python-webencodings
31%endif
32%endif
33%if %{with python3}
34BuildRequires: python3-modules >= 1:3.4
35BuildRequires: python3-setuptools
36%if %{with tests}
37BuildRequires: python3-pytest >= 3.0.0
38BuildRequires: python3-pytest-runner >= 2.0
39BuildRequires: python3-six >= 1.9.0
40BuildRequires: python3-webencodings
41%endif
42%endif
43%if %{with doc}
44BuildRequires: sphinx-pdg
45%endif
46Requires: python-modules >= 1:2.7
47BuildArch: noarch
48BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50%description
51Bleach is an allowed-list-based HTML sanitizing library that escapes
52or strips markup and attributes.
53
54%description -l pl.UTF-8
55Bleach to oparta na liście elementów dozwolonych biblioteka
56zabezpieczająca lub usuwająca znaczniki i atrybuty.
57
58%package -n python3-bleach
59Summary: An easy safelist-based HTML-sanitizing tool
60Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
61Group: Libraries/Python
62Requires: python3-modules >= 1:3.4
63
64%description -n python3-bleach
65Bleach is an allowed-list-based HTML sanitizing library that escapes
66or strips markup and attributes.
67
68%description -n python3-bleach -l pl.UTF-8
69Bleach to oparta na liście elementów dozwolonych biblioteka
70zabezpieczająca lub usuwająca znaczniki i atrybuty.
71
72%package apidocs
73Summary: API documentation for Python bleach module
74Summary(pl.UTF-8): Dokumentacja API modułu Pythona bleach
75Group: Documentation
76
77%description apidocs
78API documentation for Python bleach module.
79
80%description apidocs -l pl.UTF-8
81Dokumentacja API modułu Pythona bleach.
82
83%prep
84%setup -q -n bleach-%{version}
85%patch0 -p1
86
87%build
88%if %{with python2}
89%py_build %{?with_tests:test}
90%endif
91
92%if %{with python3}
93%py3_build %{?with_tests:test}
94%endif
95
96%if %{with doc}
97%{__make} -C docs html
98%endif
99
100%install
101rm -rf $RPM_BUILD_ROOT
102
103%if %{with python2}
104%py_install
105
106%py_postclean
107%endif
108
109%if %{with python3}
110%py3_install
111%endif
112
113%clean
114rm -rf $RPM_BUILD_ROOT
115
116%if %{with python2}
117%files
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
122%endif
123
124%if %{with python3}
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
130%endif
131
132%if %{with doc}
133%files apidocs
134%defattr(644,root,root,755)
135%doc docs/_build/html/{_modules,_static,*.html,*.js}
136%endif
This page took 0.143532 seconds and 4 git commands to generate.