]>
Commit | Line | Data |
---|---|---|
1 | # | |
2 | # Conditional build: | |
3 | %bcond_without doc # Sphinx documentation | |
4 | %bcond_without tests # unit tests | |
5 | %bcond_without python2 # CPython 2.x module | |
6 | %bcond_without python3 # CPython 3.x module | |
7 | ||
8 | %define module markupsafe | |
9 | Summary: MarkupSafe - a XML/HTML/XHTML Markup safe string for Python 2 | |
10 | Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 2 bezpieczny pod kątem znaczników XML/HTML/XHTML | |
11 | Name: python-%{module} | |
12 | Version: 1.1.1 | |
13 | Release: 3 | |
14 | License: BSD | |
15 | Group: Development/Languages/Python | |
16 | #Source0Download: https://pypi.org/simple/markupsafe/ | |
17 | Source0: https://files.pythonhosted.org/packages/source/M/MarkupSafe/MarkupSafe-%{version}.tar.gz | |
18 | # Source0-md5: 43fd756864fe42063068e092e220c57b | |
19 | URL: http://www.pocoo.org/projects/markupsafe/#markupsafe | |
20 | BuildRequires: rpm-pythonprov | |
21 | BuildRequires: rpmbuild(macros) >= 1.714 | |
22 | %if %{with python2} | |
23 | BuildRequires: python-devel >= 1:2.7 | |
24 | BuildRequires: python-setuptools | |
25 | %if %{with tests} | |
26 | BuildRequires: python-pytest | |
27 | %endif | |
28 | %endif | |
29 | %if %{with python3} | |
30 | BuildRequires: python-2to3 | |
31 | BuildRequires: python3-devel >= 1:3.4 | |
32 | BuildRequires: python3-setuptools | |
33 | %if %{with tests} | |
34 | BuildRequires: python3-pytest | |
35 | %endif | |
36 | %endif | |
37 | %if %{with doc} | |
38 | BuildRequires: python3-pallets-sphinx-themes >= 1.1.0 | |
39 | # docs/requirements.txt says 1.8.0, but 1.7.6 also works | |
40 | #BuildRequires: sphinx-pdg-3 >= 1.8.0 | |
41 | BuildRequires: sphinx-pdg-3 >= 1.7.0 | |
42 | %endif | |
43 | Requires: python-modules >= 1:2.7 | |
44 | Provides: python-MarkupSafe = %{version}-%{release} | |
45 | Obsoletes: python-MarkupSafe < 0.15-2 | |
46 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
47 | ||
48 | %description | |
49 | MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python. | |
50 | ||
51 | %description -l pl.UTF-8 | |
52 | MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego | |
53 | pod kątem znaczników XML/HTML/XHTML. | |
54 | ||
55 | %package -n python3-markupsafe | |
56 | Summary: Implements a XML/HTML/XHTML Markup safe string for Python 3 | |
57 | Summary(pl.UTF-8): MarkupSafe - łańcuch dla Pythona 3 bezpieczny pod kątem znaczników XML/HTML/XHTML | |
58 | Group: Development/Languages | |
59 | Requires: python3-modules >= 1:3.4 | |
60 | ||
61 | %description -n python3-markupsafe | |
62 | MarkupSafe implements a XML/HTML/XHTML Markup safe string for Python. | |
63 | ||
64 | %description -n python3-markupsafe -l pl.UTF-8 | |
65 | MarkupSafe to implementacja łańcucha znaków dla Pythona bezpiecznego | |
66 | pod kątem znaczników XML/HTML/XHTML. | |
67 | ||
68 | %package apidocs | |
69 | Summary: API documentation for Python MarkupSafe module | |
70 | Summary(pl.UTF-8): Dokumentacja API modułu Pythona MarkupSafe | |
71 | Group: Documentation | |
72 | ||
73 | %description apidocs | |
74 | API documentation for Python MarkupSafe module. | |
75 | ||
76 | %description apidocs -l pl.UTF-8 | |
77 | Dokumentacja API modułu Pythona MarkupSafe. | |
78 | ||
79 | %prep | |
80 | %setup -q -n MarkupSafe-%{version} | |
81 | ||
82 | %build | |
83 | %if %{with python2} | |
84 | %py_build | |
85 | ||
86 | %if %{with tests} | |
87 | PYTHONPATH=$(pwd)/$(echo build-2/lib.*) \ | |
88 | %{__python} -m pytest tests | |
89 | %endif | |
90 | %endif | |
91 | ||
92 | %if %{with python3} | |
93 | %py3_build | |
94 | ||
95 | %if %{with tests} | |
96 | PYTHONPATH=$(pwd)/$(echo build-3/lib.*) \ | |
97 | %{__python3} -m pytest tests | |
98 | %endif | |
99 | %endif | |
100 | ||
101 | %if %{with doc} | |
102 | %{__make} -C docs html \ | |
103 | SPHINXBUILD=sphinx-build-3 | |
104 | %endif | |
105 | ||
106 | %install | |
107 | rm -rf $RPM_BUILD_ROOT | |
108 | ||
109 | %if %{with python2} | |
110 | %py_install | |
111 | ||
112 | %py_postclean | |
113 | # C code errantly gets installed | |
114 | %{__rm} $RPM_BUILD_ROOT%{py_sitedir}/markupsafe/_speedups.c | |
115 | %endif | |
116 | ||
117 | %if %{with python3} | |
118 | %py3_install | |
119 | ||
120 | %{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/markupsafe/_speedups.c | |
121 | %endif | |
122 | ||
123 | %clean | |
124 | rm -rf $RPM_BUILD_ROOT | |
125 | ||
126 | %if %{with python2} | |
127 | %files | |
128 | %defattr(644,root,root,755) | |
129 | %doc CHANGES.rst LICENSE.rst README.rst | |
130 | %dir %{py_sitedir}/markupsafe | |
131 | %{py_sitedir}/markupsafe/*.py[co] | |
132 | %attr(755,root,root) %{py_sitedir}/markupsafe/_speedups.so | |
133 | %{py_sitedir}/MarkupSafe-%{version}-py*.egg-info | |
134 | %endif | |
135 | ||
136 | %if %{with python3} | |
137 | %files -n python3-markupsafe | |
138 | %defattr(644,root,root,755) | |
139 | %doc CHANGES.rst LICENSE.rst README.rst | |
140 | %dir %{py3_sitedir}/markupsafe | |
141 | %{py3_sitedir}/markupsafe/*.py | |
142 | %{py3_sitedir}/markupsafe/__pycache__ | |
143 | %attr(755,root,root) %{py3_sitedir}/markupsafe/_speedups.cpython-*.so | |
144 | %{py3_sitedir}/MarkupSafe-%{version}-py*.egg-info | |
145 | %endif | |
146 | ||
147 | %if %{with doc} | |
148 | %files apidocs | |
149 | %defattr(644,root,root,755) | |
150 | %doc docs/_build/html/{_static,*.html,*.js} | |
151 | %endif |