]> git.pld-linux.org Git - packages/python-bleach.git/blob - python-bleach.spec
66ea01aae2bec8fea16e30792cf24f444ecc6064
[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 Version:        3.1.0
13 Release:        5
14 License:        Apache v2.0
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
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-pytest-runner >= 2.0
29 BuildRequires:  python-six >= 1.9.0
30 BuildRequires:  python-webencodings
31 %endif
32 %endif
33 %if %{with python3}
34 BuildRequires:  python3-modules >= 1:3.4
35 BuildRequires:  python3-setuptools
36 %if %{with tests}
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
41 %endif
42 %endif
43 %if %{with doc}
44 BuildRequires:  sphinx-pdg
45 %endif
46 Requires:       python-modules >= 1:2.7
47 BuildArch:      noarch
48 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
49
50 %description
51 Bleach is an allowed-list-based HTML sanitizing library that escapes
52 or strips markup and attributes.
53
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.
57
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
63
64 %description -n python3-bleach
65 Bleach is an allowed-list-based HTML sanitizing library that escapes
66 or strips markup and attributes.
67
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.
71
72 %package apidocs
73 Summary:        API documentation for Python bleach module
74 Summary(pl.UTF-8):      Dokumentacja API modułu Pythona bleach
75 Group:          Documentation
76
77 %description apidocs
78 API documentation for Python bleach module.
79
80 %description apidocs -l pl.UTF-8
81 Dokumentacja 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
101 rm -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
114 rm -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.092286 seconds and 2 git commands to generate.