1 # NOTE: for newer, python3 only versions, see sphinx-pdg.spec
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???)
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)
12 # note: keep 1.x here, Sphinx 2+ doesn't support Python 2
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
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
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
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
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
87 BuildRequires: rpm-pythonprov
88 BuildRequires: rpmbuild(macros) >= 1.714
89 BuildRequires: sed >= 4.0
91 # for test_build_latex.py (disabled now)
92 #BuildRequires: texlive-luatex
93 #BuildRequires: texlive-xetex
95 Requires: python-modules >= 1:2.7
96 Conflicts: sphinx-pdg < 1.0.7-2
98 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
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.
108 This package contains Python 2.x modules. For command-line utilities,
109 see sphinx-pdg-2 package.
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.
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.
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
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.
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.
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
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.
160 This package contains Python 3.x modules. For command-line utilities,
161 see sphinx-pdg-3 package.
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.
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.
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
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.
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.
198 Summary: Documentation for Sphinx Python documentation generator
199 Summary(pl.UTF-8): Dokumentacja do generatora dokumentacji pythonowej Sphinx
203 Documentation for Sphinx Python documentation generator.
205 %description doc -l pl.UTF-8
206 Dokumentacja do generatora dokumentacji pythonowej Sphinx.
209 %setup -q -n Sphinx-%{version}
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
221 %{__rm} sphinx/__init__.pyc
226 %{__python} -m pytest tests
232 %{__rm} -r sphinx/__pycache__
237 %{__python3} -m pytest tests
243 %{__make} -C doc -j1 html man
247 rm -rf $RPM_BUILD_ROOT
248 install -d $RPM_BUILD_ROOT%{_mandir}/man1
253 %{__rm} sphinx/__init__.pyc
256 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
257 %{__mv} "${f}" "${f}-2"
260 for f in doc/_build/man/*.1 ; do
261 cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $f .1)-2.1
268 %{__rm} -r sphinx/__pycache__
270 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
271 [ "${f%%-2}" == "$f" ] || continue
272 %{__mv} "${f}" "${f}-3"
275 for f in doc/_build/man/*.1 ; do
276 cp -p "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename $f .1)-3.1
282 rm -rf $RPM_BUILD_ROOT
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
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
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*
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
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
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*
330 %defattr(644,root,root,755)
331 %doc doc/_build/html/{_images,_static,extdev,man,usage,web,*.html,*.js}