]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | ||
6 | %define module markupsafe | |
7 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3 | |
8 | Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 3 bezpieczny pod kątem znaczników XML/HTML/XHTML | |
9 | Name: python3-%{module} | |
10 | Version: 1.1.1 | |
11 | Release: 3 | |
12 | License: BSD | |
13 | Group: Development/Languages/Python | |
14 | #Source0Download: https://pypi.org/simple/markupsafe/ | |
15 | Source0: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz | |
16 | # Source0-md5: 43fd756864fe42063068e092e220c57b | |
17 | URL: http://www.pocoo.org/projects/markupsafe/#markupsafe | |
18 | BuildRequires: rpm-pythonprov | |
19 | BuildRequires: rpmbuild(macros) >= 1.714 | |
20 | BuildRequires: python3-devel >= 1:3.4 | |
21 | BuildRequires: python3-setuptools | |
22 | %if %{with tests} | |
23 | BuildRequires: python3-pytest | |
24 | %endif | |
25 | %if %{with doc} | |
26 | BuildRequires: python3-pallets-sphinx-themes >= 1.1.0 | |
27 | # docs/requirements.txt says 1.8.0, but 1.7.6 also works | |
28 | #BuildRequires: sphinx-pdg-3 >= 1.8.0 | |
29 | BuildRequires: sphinx-pdg-3 >= 1.7.0 | |
30 | %endif | |
31 | Requires: python3-modules >= 1:3.4 | |
32 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
33 | ||
34 | %description | |
35 | MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python. | |
36 | ||
37 | %description -l pl.UTF-8 | |
38 | MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego | |
39 | pod kątem znaczników XML/HTML/XHTML. | |
40 | ||
41 | %package apidocs | |
42 | Summary: API documentation for Python MarkupSafe module | |
43 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona MarkupSafe | |
44 | Group: Documentation | |
45 | ||
46 | %description apidocs | |
47 | API documentation for Python MarkupSafe module. | |
48 | ||
49 | %description apidocs -l pl.UTF-8 | |
50 | Dokumentacja API modułu Pythona MarkupSafe. | |
51 | ||
52 | %prep | |
53 | %setup -q -n MarkupSafe-%{version} | |
54 | ||
55 | %build | |
56 | %py3_build | |
57 | ||
58 | %if %{with tests} | |
59 | PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \ | |
60 | %{__python3} -m pytest tests | |
61 | %endif | |
62 | ||
63 | %if %{with doc} | |
64 | %{__make} -C docs html \ | |
65 | SPHINXBUILD=sphinx-build-3 | |
66 | %endif | |
67 | ||
68 | %install | |
69 | rm -rf $RPM_BUILD_ROOT | |
70 | %py3_install | |
71 | ||
72 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c | |
73 | ||
74 | %clean | |
75 | rm -rf $RPM_BUILD_ROOT | |
76 | ||
77 | %files | |
78 | %defattr(644,root,root,755) | |
79 | %doc CHANGES.rst LICENSE.rst README.rst | |
80 | %dir %{py3_sitedir}/markupsafe | |
81 | %{py3_sitedir}/markupsafe/*.py | |
82 | %{py3_sitedir}/markupsafe/__pycache__ | |
83 | %attr(755,root,root) %{py3_sitedir}/markupsafe/_speedups.cpython-*.so | |
84 | %{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info | |
85 | ||
86 | %if %{with doc} | |
87 | %files apidocs | |
88 | %defattr(644,root,root,755) | |
89 | %doc docs/_build/html/{_static,*.html,*.js} | |
90 | %endif |