]> git.pld-linux.org Git - packages/python-bleach.git/blame - python-bleach.spec
- disabled python3 here
[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
b288807e 7%bcond_with python3 # CPython 3.x module (built from python3-bleach.spec)
d0daa539
JB
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
0730390f
JB
12# keep 3.x here for python2 support
13Version: 3.3.1
14Release: 1
d0daa539
JB
15License: Apache v2.0
16Group: Libraries/Python
17#Source0Download: https://pypi.org/simple/bleach/
18Source0: https://files.pythonhosted.org/packages/source/b/bleach/bleach-%{version}.tar.gz
0730390f 19# Source0-md5: b4c1b8f27289f9e5d73792daed4c0879
d0daa539
JB
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
d0daa539
JB
28BuildRequires: python-six >= 1.9.0
29BuildRequires: python-webencodings
30%endif
31%endif
32%if %{with python3}
0730390f 33BuildRequires: python3-modules >= 1:3.5
d0daa539
JB
34BuildRequires: python3-setuptools
35%if %{with tests}
36BuildRequires: python3-pytest >= 3.0.0
d0daa539
JB
37BuildRequires: python3-six >= 1.9.0
38BuildRequires: python3-webencodings
39%endif
40%endif
41%if %{with doc}
b288807e 42BuildRequires: sphinx-pdg-2
d0daa539
JB
43%endif
44Requires: python-modules >= 1:2.7
45BuildArch: noarch
46BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48%description
49Bleach is an allowed-list-based HTML sanitizing library that escapes
50or strips markup and attributes.
51
52%description -l pl.UTF-8
53Bleach to oparta na liście elementów dozwolonych biblioteka
54zabezpieczająca lub usuwająca znaczniki i atrybuty.
55
56%package -n python3-bleach
57Summary: An easy safelist-based HTML-sanitizing tool
58Summary(pl.UTF-8): Proste, oparte na liście elementów bezpiecznych, narzędzie do porządkowania HTML-a
59Group: Libraries/Python
0730390f 60Requires: python3-modules >= 1:3.5
d0daa539
JB
61
62%description -n python3-bleach
63Bleach is an allowed-list-based HTML sanitizing library that escapes
64or strips markup and attributes.
65
66%description -n python3-bleach -l pl.UTF-8
67Bleach to oparta na liście elementów dozwolonych biblioteka
68zabezpieczająca lub usuwająca znaczniki i atrybuty.
69
70%package apidocs
71Summary: API documentation for Python bleach module
72Summary(pl.UTF-8): Dokumentacja API modułu Pythona bleach
73Group: Documentation
74
75%description apidocs
76API documentation for Python bleach module.
77
78%description apidocs -l pl.UTF-8
79Dokumentacja API modułu Pythona bleach.
80
81%prep
82%setup -q -n bleach-%{version}
d0daa539
JB
83
84%build
85%if %{with python2}
0730390f
JB
86%py_build
87
88%if %{with tests}
89PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
90%{__python} -m pytest tests
91%endif
d0daa539
JB
92%endif
93
94%if %{with python3}
0730390f
JB
95%py3_build
96
97%if %{with tests}
98PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99%{__python3} -m pytest tests
100%endif
d0daa539
JB
101%endif
102
103%if %{with doc}
b288807e
JB
104%{__make} -C docs html \
105 SPHINXBUILD=sphinx-build-2
d0daa539
JB
106%endif
107
108%install
109rm -rf $RPM_BUILD_ROOT
110
111%if %{with python2}
112%py_install
113
114%py_postclean
115%endif
116
117%if %{with python3}
118%py3_install
119%endif
120
121%clean
122rm -rf $RPM_BUILD_ROOT
123
124%if %{with python2}
125%files
126%defattr(644,root,root,755)
127%doc CHANGES CONTRIBUTORS LICENSE README.rst
128%{py_sitescriptdir}/bleach
129%{py_sitescriptdir}/bleach-%{version}-py*.egg-info
130%endif
131
132%if %{with python3}
133%files -n python3-bleach
134%defattr(644,root,root,755)
135%doc CHANGES CONTRIBUTORS LICENSE README.rst
136%{py3_sitescriptdir}/bleach
137%{py3_sitescriptdir}/bleach-%{version}-py*.egg-info
138%endif
139
140%if %{with doc}
141%files apidocs
142%defattr(644,root,root,755)
143%doc docs/_build/html/{_modules,_static,*.html,*.js}
144%endif
This page took 0.157852 seconds and 4 git commands to generate.