]> git.pld-linux.org Git - packages/python-Sphinx.git/blob - python-Sphinx.spec
- release 2 (by relup.sh)
[packages/python-Sphinx.git] / python-Sphinx.spec
1 # NOTE: for newer, python3 only versions, see sphinx-pdg.spec
2 #
3 # Conditional build:
4 %bcond_without  python2         # CPython 2.x version
5 %bcond_with     python3         # CPython 3.x version
6 %bcond_without  doc             # documentation
7 %bcond_with     tests           # unit tests (some fail on import of existing module???)
8
9 Summary:        Sphinx Python documentation generator (Python 2.x modules)
10 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 2.x)
11 Name:           python-Sphinx
12 # note: keep 1.x here, Sphinx 2+ doesn't support Python 2
13 Version:        1.8.5
14 Release:        2
15 License:        BSD
16 Group:          Development/Languages/Python
17 #Source0Download: https://pypi.org/simple/Sphinx/
18 Source0:        https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
19 # Source0-md5:  554f7a4e752f48b2601e5ef5ab463346
20 Patch0:         %{name}-float-ver.patch
21 Patch1:         %{name}-mock.patch
22 URL:            http://www.sphinx-doc.org/
23 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
24 BuildRequires:  glibc-localedb-all
25 %endif
26 %if %{with python2}
27 BuildRequires:  python-babel >= 1.3
28 BuildRequires:  python-devel >= 1:2.7
29 BuildRequires:  python-modules >= 1:2.7
30 BuildRequires:  python-setuptools >= 1:7.0
31 %if %{with tests}
32 BuildRequires:  python-alabaster >= 0.7
33 BuildRequires:  python-alabaster < 0.8
34 BuildRequires:  python-docutils >= 0.11
35 BuildRequires:  python-enum34
36 # for style checks, not run by pytest
37 #BuildRequires: python-flake8 >= 3.5.0
38 #BuildRequires: python-flake8-import-order
39 BuildRequires:  python-html5lib
40 BuildRequires:  python-imagesize
41 BuildRequires:  python-jinja2 >= 2.3
42 BuildRequires:  python-mock
43 BuildRequires:  python-packaging
44 BuildRequires:  python-pygments >= 2.0
45 BuildRequires:  python-pytest >= 3.0
46 # for coverage tests only
47 #BuildRequires: python-pytest-cov
48 BuildRequires:  python-requests >= 2.0.0
49 BuildRequires:  python-six >= 1.5
50 BuildRequires:  python-snowballstemmer >= 1.1
51 BuildRequires:  python-sphinxcontrib-websupport
52 BuildRequires:  python-typing
53 %endif
54 %endif
55 %if %{with python3}
56 BuildRequires:  python3-babel >= 1.3
57 BuildRequires:  python3-devel >= 1:3.4
58 BuildRequires:  python3-modules >= 1:3.4
59 BuildRequires:  python3-setuptools >= 1:7.0
60 %if %{with tests}
61 BuildRequires:  python3-alabaster >= 0.7
62 BuildRequires:  python3-alabaster < 0.8
63 BuildRequires:  python3-docutils >= 0.11
64 # for style checks, not run by pytest
65 #BuildRequires: python3-flake8 >= 3.5.0
66 #BuildRequires: python3-flake8-import-order
67 BuildRequires:  python3-html5lib
68 BuildRequires:  python3-imagesize
69 BuildRequires:  python3-jinja2 >= 2.3
70 # for type checks only, not run by pytest
71 #BuildRequires: python3-mypy
72 BuildRequires:  python3-packaging
73 BuildRequires:  python3-pygments >= 2.0
74 BuildRequires:  python3-pytest >= 3.0
75 # for coverage tests only
76 #BuildRequires: python3-pytest-cov
77 BuildRequires:  python3-requests >= 2.0.0
78 BuildRequires:  python3-six >= 1.5
79 BuildRequires:  python3-snowballstemmer >= 1.1
80 BuildRequires:  python3-sphinxcontrib-websupport
81 BuildRequires:  python3-typed_ast
82 %if "%{py3_ver}" < "3.5"
83 BuildRequires:  python3-typing
84 %endif
85 %endif
86 %endif
87 BuildRequires:  rpm-pythonprov
88 BuildRequires:  rpmbuild(macros) >= 1.714
89 BuildRequires:  sed >= 4.0
90 %if %{with tests}
91 # for test_build_latex.py (disabled now)
92 #BuildRequires: texlive-luatex
93 #BuildRequires: texlive-xetex
94 %endif
95 Requires:       python-modules >= 1:2.7
96 Conflicts:      sphinx-pdg < 1.0.7-2
97 BuildArch:      noarch
98 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
99
100 %description
101 Sphinx is a tool that makes it easy to create intelligent and
102 beautiful documentation for Python projects (or other documents
103 consisting of multiple reStructuredText sources), written by Georg
104 Brandl. It was originally created to translate the new Python
105 documentation, but has now been cleaned up in the hope that it will be
106 useful to many other projects.
107
108 This package contains Python 2.x modules. For command-line utilities,
109 see sphinx-pdg-2 package.
110
111 %description -l pl.UTF-8
112 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
113 dokumentacji dla projektów w Pythonie (lub innych dokumentów
114 składających się z wielu źródeł w formacie reStructuredText), napisane
115 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
116 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
117 będzie przydatne dla wielu innych projektów.
118
119 Ten pakiet zawiera moduły Pythona 2.x. Narzędzia działające z linii
120 poleceń znajdują się w pakiecie sphinx-pdg-2.
121
122 %package -n sphinx-pdg-2
123 Summary:        Sphinx Python documentation generator (Python 2 version)
124 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (wersja dla Pythona 2)
125 Group:          Development/Languages/Python
126 Requires:       python-Sphinx = %{version}-%{release}
127 Conflicts:      sphinx-pdg < 1.3.2
128
129 %description -n sphinx-pdg-2
130 Sphinx is a tool that makes it easy to create intelligent and
131 beautiful documentation for Python projects (or other documents
132 consisting of multiple reStructuredText sources), written by Georg
133 Brandl. It was originally created to translate the new Python
134 documentation, but has now been cleaned up in the hope that it will be
135 useful to many other projects.
136
137 %description -n sphinx-pdg-2 -l pl.UTF-8
138 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
139 dokumentacji dla projektów w Pythonie (lub innych dokumentów
140 składających się z wielu źródeł w formacie reStructuredText), napisane
141 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
142 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
143 będzie przydatne dla wielu innych projektów.
144
145 %package -n python3-Sphinx
146 Summary:        Sphinx Python documentation generator (Python 3.x modules)
147 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 3.x)
148 Group:          Development/Languages/Python
149 Requires:       python3-modules >= 1:3.4
150 Conflicts:      sphinx-pdg-3 < 1.0.7-2
151
152 %description -n python3-Sphinx
153 Sphinx is a tool that makes it easy to create intelligent and
154 beautiful documentation for Python projects (or other documents
155 consisting of multiple reStructuredText sources), written by Georg
156 Brandl. It was originally created to translate the new Python
157 documentation, but has now been cleaned up in the hope that it will be
158 useful to many other projects.
159
160 This package contains Python 3.x modules. For command-line utilities,
161 see sphinx-pdg-3 package.
162
163 %description -n python3-Sphinx -l pl.UTF-8
164 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
165 dokumentacji dla projektów w Pythonie (lub innych dokumentów
166 składających się z wielu źródeł w formacie reStructuredText), napisane
167 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
168 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
169 będzie przydatne dla wielu innych projektów.
170
171 Ten pakiet zawiera moduły Pythona 3.x. Narzędzia działające z linii
172 poleceń znajdują się w pakiecie sphinx-pdg-3.
173
174 %package -n sphinx-pdg-3
175 Summary:        Sphinx Python documentation generator (Python 3 version)
176 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (wersja dla Pythona 3)
177 Group:          Development/Languages/Python
178 Requires:       python3-Sphinx = %{version}-%{release}
179 Conflicts:      sphinx-pdg < 1.3.2
180
181 %description -n sphinx-pdg-3
182 Sphinx is a tool that makes it easy to create intelligent and
183 beautiful documentation for Python projects (or other documents
184 consisting of multiple reStructuredText sources), written by Georg
185 Brandl. It was originally created to translate the new Python
186 documentation, but has now been cleaned up in the hope that it will be
187 useful to many other projects.
188
189 %description -n sphinx-pdg-3 -l pl.UTF-8
190 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
191 dokumentacji dla projektów w Pythonie (lub innych dokumentów
192 składających się z wielu źródeł w formacie reStructuredText), napisane
193 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
194 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
195 będzie przydatne dla wielu innych projektów.
196
197 %package doc
198 Summary:        Documentation for Sphinx Python documentation generator
199 Summary(pl.UTF-8):      Dokumentacja do generatora dokumentacji pythonowej Sphinx
200 Group:          Documentation
201
202 %description doc
203 Documentation for Sphinx Python documentation generator.
204
205 %description doc -l pl.UTF-8
206 Dokumentacja do generatora dokumentacji pythonowej Sphinx.
207
208 %prep
209 %setup -q -n Sphinx-%{version}
210 %patch0 -p1
211 %patch1 -p1
212
213 # needs python-babel with at least de,en,ja locales installed
214 %{__rm} tests/test_util_i18n.py
215 # requires various latex variants, fails in a ways difficult to diagnose
216 %{__rm} tests/test_build_latex.py
217
218 %build
219 %if %{with python2}
220 %py_build
221 %{__rm} sphinx/__init__.pyc
222
223 %if %{with tests}
224 LC_ALL=C.UTF-8 \
225 PYTHONPATH=$(pwd) \
226 %{__python} -m pytest tests
227 %endif
228 %endif
229
230 %if %{with python3}
231 %py3_build
232 %{__rm} -r sphinx/__pycache__
233
234 %if %{with tests}
235 LC_ALL=C.UTF-8 \
236 PYTHONPATH=$(pwd) \
237 %{__python3} -m pytest tests
238 %endif
239 %endif
240
241 %if %{with doc}
242 PYTHONPATH=$(pwd) \
243 %{__make} -C doc -j1 html man
244 %endif
245
246 %install
247 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT%{_mandir}/man1
249
250 %if %{with python2}
251 %py_install
252
253 %{__rm} sphinx/__init__.pyc
254 %py_postclean
255
256 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
257         %{__mv} "${f}" "${f}-2"
258 done
259 %if %{with doc}
260 for f in doc/_build/man/*.1 ; do
261         cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $f .1)-2.1
262 done
263 %endif
264 %endif
265
266 %if %{with python3}
267 %py3_install
268 %{__rm} -r sphinx/__pycache__
269
270 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
271         [ "${f%%-2}" == "$f" ] || continue
272         %{__mv} "${f}" "${f}-3"
273 done
274 %if %{with doc}
275 for f in doc/_build/man/*.1 ; do
276         cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $f .1)-3.1
277 done
278 %endif
279 %endif
280
281 %clean
282 rm -rf $RPM_BUILD_ROOT
283
284 %if %{with python2}
285 %files
286 %defattr(644,root,root,755)
287 %doc AUTHORS CHANGES EXAMPLES LICENSE README.rst
288 %{py_sitescriptdir}/sphinx
289 %{py_sitescriptdir}/Sphinx-%{version}-py*.egg-info
290
291 %files -n sphinx-pdg-2
292 %defattr(644,root,root,755)
293 %attr(755,root,root) %{_bindir}/sphinx-apidoc-2
294 %attr(755,root,root) %{_bindir}/sphinx-autogen-2
295 %attr(755,root,root) %{_bindir}/sphinx-build-2
296 %attr(755,root,root) %{_bindir}/sphinx-quickstart-2
297 %if %{with doc}
298 %{_mandir}/man1/sphinx-all-2.1*
299 %{_mandir}/man1/sphinx-apidoc-2.1*
300 %{_mandir}/man1/sphinx-autogen-2.1*
301 %{_mandir}/man1/sphinx-build-2.1*
302 %{_mandir}/man1/sphinx-quickstart-2.1*
303 %endif
304 %endif
305
306 %if %{with python3}
307 %files -n python3-Sphinx
308 %defattr(644,root,root,755)
309 %doc AUTHORS CHANGES EXAMPLES LICENSE README.rst
310 %{py3_sitescriptdir}/sphinx
311 %{py3_sitescriptdir}/Sphinx-%{version}-py*.egg-info
312
313 %files -n sphinx-pdg-3
314 %defattr(644,root,root,755)
315 %attr(755,root,root) %{_bindir}/sphinx-apidoc-3
316 %attr(755,root,root) %{_bindir}/sphinx-autogen-3
317 %attr(755,root,root) %{_bindir}/sphinx-build-3
318 %attr(755,root,root) %{_bindir}/sphinx-quickstart-3
319 %if %{with doc}
320 %{_mandir}/man1/sphinx-all-3.1*
321 %{_mandir}/man1/sphinx-apidoc-3.1*
322 %{_mandir}/man1/sphinx-autogen-3.1*
323 %{_mandir}/man1/sphinx-build-3.1*
324 %{_mandir}/man1/sphinx-quickstart-3.1*
325 %endif
326 %endif
327
328 %if %{with doc}
329 %files doc
330 %defattr(644,root,root,755)
331 %doc doc/_build/html/{_images,_static,extdev,man,usage,web,*.html,*.js}
332 %endif
This page took 0.108312 seconds and 4 git commands to generate.