]> git.pld-linux.org Git - packages/python-bleach.git/blob - python-bleach.spec
5e5295f6ec3c364485e1a7c0da6e2c8244fd3485
[packages/python-bleach.git] / python-bleach.spec
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
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
11 Name:           python-bleach
12 # keep 3.x here for python2 support
13 Version:        3.3.1
14 Release:        1
15 License:        Apache v2.0
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
23 %if %{with python2}
24 BuildRequires:  python-modules >= 1:2.7
25 BuildRequires:  python-setuptools
26 %if %{with tests}
27 BuildRequires:  python-pytest >= 3.0.0
28 BuildRequires:  python-six >= 1.9.0
29 BuildRequires:  python-webencodings
30 %endif
31 %endif
32 %if %{with python3}
33 BuildRequires:  python3-modules >= 1:3.5
34 BuildRequires:  python3-setuptools
35 %if %{with tests}
36 BuildRequires:  python3-pytest >= 3.0.0
37 BuildRequires:  python3-six >= 1.9.0
38 BuildRequires:  python3-webencodings
39 %endif
40 %endif
41 %if %{with doc}
42 BuildRequires:  sphinx-pdg
43 %endif
44 Requires:       python-modules >= 1:2.7
45 BuildArch:      noarch
46 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
47
48 %description
49 Bleach is an allowed-list-based HTML sanitizing library that escapes
50 or strips markup and attributes.
51
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.
55
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
61
62 %description -n python3-bleach
63 Bleach is an allowed-list-based HTML sanitizing library that escapes
64 or strips markup and attributes.
65
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.
69
70 %package apidocs
71 Summary:        API documentation for Python bleach module
72 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona bleach
73 Group:          Documentation
74
75 %description apidocs
76 API documentation for Python bleach module.
77
78 %description apidocs -l pl.UTF-8
79 Dokumentacja API modułu Pythona bleach.
80
81 %prep
82 %setup -q -n bleach-%{version}
83
84 %build
85 %if %{with python2}
86 %py_build
87
88 %if %{with tests}
89 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
90 %{__python} -m pytest tests
91 %endif
92 %endif
93
94 %if %{with python3}
95 %py3_build
96
97 %if %{with tests}
98 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
99 %{__python3} -m pytest tests
100 %endif
101 %endif
102
103 %if %{with doc}
104 %{__make} -C docs html
105 %endif
106
107 %install
108 rm -rf $RPM_BUILD_ROOT
109
110 %if %{with python2}
111 %py_install
112
113 %py_postclean
114 %endif
115
116 %if %{with python3}
117 %py3_install
118 %endif
119
120 %clean
121 rm -rf $RPM_BUILD_ROOT
122
123 %if %{with python2}
124 %files
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
129 %endif
130
131 %if %{with python3}
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
137 %endif
138
139 %if %{with doc}
140 %files apidocs
141 %defattr(644,root,root,755)
142 %doc docs/_build/html/{_modules,_static,*.html,*.js}
143 %endif
This page took 0.055906 seconds and 2 git commands to generate.