1 # there are sphinx.spec, sphinx2.spec... Sphinx.spec is too confusing
2 # therefore the name for this package is sphinx-pdg (pdg - python
3 # documentation generator)
4 # NOTE: for last python2 version see python-Sphinx.spec
8 %bcond_without doc # documentation
9 %bcond_with tests # unit tests (some need network)
11 Summary: Sphinx - Python documentation generator
12 Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona
17 Group: Development/Languages/Python
18 #Source0Download: https://pypi.org/simple/Sphinx/
19 Source0: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz
20 # Source0-md5: ed63e60d798d212c1afdecf8acda690e
21 Patch0: float-ver.patch
22 Patch1: Sphinx-docutils.patch
23 URL: http://www.sphinx-doc.org/
24 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
25 BuildRequires: glibc-localedb-all
27 BuildRequires: python3-babel >= 1.3
28 BuildRequires: python3-devel >= 1:3.6
29 BuildRequires: python3-modules >= 1:3.6
30 BuildRequires: python3-setuptools >= 1:7.0
32 BuildRequires: python3-Cython
33 BuildRequires: python3-alabaster >= 0.7
34 BuildRequires: python3-alabaster < 0.8
35 BuildRequires: python3-docutils >= 0.14
36 BuildRequires: python3-docutils < 0.19
37 # for lint only (mypy)
38 #BuildRequires: python3-docutils-stubs
39 # for lint, not run by pytest
40 #BuildRequires: python3-flake8 >= 3.5.0
41 BuildRequires: python3-html5lib
43 #BuildRequires: python3-isort
44 BuildRequires: python3-imagesize
45 %if "%{_ver_lt '%{py3_ver}' '3.10'}" == "1"
46 BuildRequires: python3-importlib_metadata >= 4.4
48 BuildRequires: python3-jinja2 >= 2.3
49 # for lint only, not run by pytest
50 #BuildRequires: python3-mypy >= 0.931
51 BuildRequires: python3-packaging
52 BuildRequires: python3-pygments >= 2.0
53 BuildRequires: python3-pytest >= 3.0
54 # for coverage tests only
55 #BuildRequires: python3-pytest-cov
56 BuildRequires: python3-requests >= 2.5.0
57 BuildRequires: python3-six >= 1.5
58 BuildRequires: python3-snowballstemmer >= 1.1
59 BuildRequires: python3-sphinxcontrib-applehelp
60 BuildRequires: python3-sphinxcontrib-devhelp
61 BuildRequires: python3-sphinxcontrib-jsmath
62 BuildRequires: python3-sphinxcontrib-htmlhelp >= 2.0.0
63 BuildRequires: python3-sphinxcontrib-serializinghtml >= 1.1.5
64 BuildRequires: python3-sphinxcontrib-qthelp
65 %if "%{_ver_lt '%{py3_ver}' '3.8'}" == "1"
66 BuildRequires: python3-typed_ast
70 BuildRequires: python3-docutils >= 0.14
71 BuildRequires: python3-docutils < 0.19
72 %if "%{_ver_lt '%{py3_ver}' '3.10'}" == "1"
73 BuildRequires: python3-importlib_metadata >= 4.4
75 BuildRequires: python3-sphinxcontrib-applehelp
76 BuildRequires: python3-sphinxcontrib-devhelp
77 BuildRequires: python3-sphinxcontrib-htmlhelp >= 2.0.0
78 BuildRequires: python3-sphinxcontrib-qthelp
79 BuildRequires: python3-sphinxcontrib-serializinghtml >= 1.1.5
80 BuildRequires: python3-sphinxcontrib-websupport
82 BuildRequires: rpm-pythonprov
83 BuildRequires: rpmbuild(macros) >= 1.749
84 BuildRequires: sed >= 4.0
86 # for test_build_latex.py (disabled now)
87 #BuildRequires: texlive-luatex
88 #BuildRequires: texlive-xetex
90 Provides: sphinx-pdg-3 = %{version}-%{release}
91 Requires: python3-Sphinx = %{version}-%{release}
92 Obsoletes: sphinx-pdg-3 < 3
94 BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
97 Sphinx is a tool that makes it easy to create intelligent and
98 beautiful documentation for Python projects (or other documents
99 consisting of multiple reStructuredText sources), written by Georg
100 Brandl. It was originally created to translate the new Python
101 documentation, but has now been cleaned up in the hope that it will be
102 useful to many other projects.
104 %description -l pl.UTF-8
105 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
106 dokumentacji dla projektów w Pythonie (lub innych dokumentów
107 składających się z wielu źródeł w formacie reStructuredText), napisane
108 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
109 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
110 będzie przydatne dla wielu innych projektów.
112 %package -n python3-Sphinx
113 Summary: Sphinx Python documentation generator (Python 3.x modules)
114 Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 3.x)
115 Group: Development/Languages/Python
116 Requires: python3-alabaster >= 0.7
117 Requires: python3-docutils >= 0.14
118 Requires: python3-modules >= 1:3.5
119 Requires: python3-devel-tools
120 Conflicts: python3-sphinxcontrib-asyncio < 0.3.0
121 Conflicts: sphinx-pdg-3 < 1.0.7-2
123 %description -n python3-Sphinx
124 Sphinx Python documentation generator (Python 3.x modules).
126 For command-line utilities, see sphinx-pdg-3 package.
128 %description -n python3-Sphinx -l pl.UTF-8
129 Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły
132 Narzędzia działające z linii poleceń znajdują się w pakiecie
136 Summary: Documentation for Sphinx Python documentation generator
137 Summary(pl.UTF-8): Dokumentacja do generatora dokumentacji pythonowej Sphinx
141 Documentation for Sphinx Python documentation generator.
143 %description doc -l pl.UTF-8
144 Dokumentacja do generatora dokumentacji pythonowej Sphinx.
147 %setup -q -n Sphinx-%{version}
151 # needs python-babel with at least de,en,ja locales installed
152 %{__rm} tests/test_util_i18n.py
153 # requires various latex variants, fails in a ways difficult to diagnose
154 %{__rm} tests/test_build_latex.py
158 %{__rm} -r sphinx/__pycache__
163 %{__python3} -m pytest tests
168 %{__make} -C doc -j1 html man
172 rm -rf $RPM_BUILD_ROOT
176 %{__rm} -r sphinx/__pycache__
178 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
179 %{__mv} "${f}" "${f}-3"
180 ln -sf "$(basename "$f")-3" "$f"
184 install -d $RPM_BUILD_ROOT%{_mandir}/man1
185 cp -p doc/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
186 for f in $RPM_BUILD_ROOT%{_mandir}/man1/*.1 ; do
187 ln "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename "$f" .1)-3.1
192 rm -rf $RPM_BUILD_ROOT
195 %defattr(644,root,root,755)
196 %attr(755,root,root) %{_bindir}/sphinx-apidoc
197 %attr(755,root,root) %{_bindir}/sphinx-autogen
198 %attr(755,root,root) %{_bindir}/sphinx-build
199 %attr(755,root,root) %{_bindir}/sphinx-quickstart
200 %attr(755,root,root) %{_bindir}/sphinx-apidoc-3
201 %attr(755,root,root) %{_bindir}/sphinx-autogen-3
202 %attr(755,root,root) %{_bindir}/sphinx-build-3
203 %attr(755,root,root) %{_bindir}/sphinx-quickstart-3
205 %{_mandir}/man1/sphinx-all.1*
206 %{_mandir}/man1/sphinx-apidoc.1*
207 %{_mandir}/man1/sphinx-autogen.1*
208 %{_mandir}/man1/sphinx-build.1*
209 %{_mandir}/man1/sphinx-quickstart.1*
210 %{_mandir}/man1/sphinx-all-3.1*
211 %{_mandir}/man1/sphinx-apidoc-3.1*
212 %{_mandir}/man1/sphinx-autogen-3.1*
213 %{_mandir}/man1/sphinx-build-3.1*
214 %{_mandir}/man1/sphinx-quickstart-3.1*
217 %files -n python3-Sphinx
218 %defattr(644,root,root,755)
219 %doc AUTHORS CHANGES EXAMPLES LICENSE README.rst
220 %{py3_sitescriptdir}/sphinx
221 %{py3_sitescriptdir}/Sphinx-%{version}-py*.egg-info
225 %defattr(644,root,root,755)
226 %doc doc/_build/html/{_downloads,_images,_modules,_static,development,extdev,man,usage,*.html,*.js}