]>
Commit | Line | Data |
---|---|---|
992edea4 | 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) | |
c0d66e02 | 4 | # NOTE: for last python2 version see python-Sphinx.spec |
660f45af | 5 | |
b9b9d288 JK |
6 | # |
7 | # Conditional build: | |
8bf2bcef | 8 | %bcond_without doc # documentation |
26c0d5c1 | 9 | %bcond_with tests # unit tests (some need network) |
b9b9d288 | 10 | |
79af714d JB |
11 | Summary: Sphinx - Python documentation generator |
12 | Summary(pl.UTF-8): Sphinx - narzędzie do tworzenia dokumentacji dla Pythona | |
4acf166f | 13 | Name: sphinx-pdg |
815460ea JB |
14 | Version: 4.5.0 |
15 | Release: 1 | |
4acf166f | 16 | License: BSD |
17 | Group: Development/Languages/Python | |
24b8cdef JB |
18 | #Source0Download: https://pypi.org/simple/Sphinx/ |
19 | Source0: https://files.pythonhosted.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz | |
815460ea | 20 | # Source0-md5: ed63e60d798d212c1afdecf8acda690e |
8cbf9e72 | 21 | Patch0: float-ver.patch |
815460ea | 22 | Patch1: Sphinx-docutils.patch |
24b8cdef JB |
23 | URL: http://www.sphinx-doc.org/ |
24 | %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?) | |
4c3893b4 JB |
25 | BuildRequires: glibc-localedb-all |
26 | %endif | |
19a39066 | 27 | BuildRequires: python3-babel >= 1.3 |
815460ea JB |
28 | BuildRequires: python3-devel >= 1:3.6 |
29 | BuildRequires: python3-modules >= 1:3.6 | |
8bf2bcef | 30 | BuildRequires: python3-setuptools >= 1:7.0 |
4c3893b4 | 31 | %if %{with tests} |
64028e9c | 32 | BuildRequires: python3-Cython |
4c3893b4 JB |
33 | BuildRequires: python3-alabaster >= 0.7 |
34 | BuildRequires: python3-alabaster < 0.8 | |
815460ea JB |
35 | BuildRequires: python3-docutils >= 0.14 |
36 | BuildRequires: python3-docutils < 0.19 | |
64028e9c | 37 | # for lint only (mypy) |
af1b5d40 | 38 | #BuildRequires: python3-docutils-stubs |
64028e9c | 39 | # for lint, not run by pytest |
8bf2bcef | 40 | #BuildRequires: python3-flake8 >= 3.5.0 |
4c3893b4 | 41 | BuildRequires: python3-html5lib |
64028e9c JB |
42 | # for lint |
43 | #BuildRequires: python3-isort | |
4c3893b4 | 44 | BuildRequires: python3-imagesize |
815460ea JB |
45 | %if "%{_ver_lt '%{py3_ver}' '3.10'}" == "1" |
46 | BuildRequires: python3-importlib_metadata >= 4.4 | |
47 | %endif | |
4c3893b4 | 48 | BuildRequires: python3-jinja2 >= 2.3 |
64028e9c | 49 | # for lint only, not run by pytest |
815460ea | 50 | #BuildRequires: python3-mypy >= 0.931 |
24b8cdef | 51 | BuildRequires: python3-packaging |
4c3893b4 JB |
52 | BuildRequires: python3-pygments >= 2.0 |
53 | BuildRequires: python3-pytest >= 3.0 | |
8bf2bcef JB |
54 | # for coverage tests only |
55 | #BuildRequires: python3-pytest-cov | |
c0d66e02 | 56 | BuildRequires: python3-requests >= 2.5.0 |
4c3893b4 JB |
57 | BuildRequires: python3-six >= 1.5 |
58 | BuildRequires: python3-snowballstemmer >= 1.1 | |
c0d66e02 JB |
59 | BuildRequires: python3-sphinxcontrib-applehelp |
60 | BuildRequires: python3-sphinxcontrib-devhelp | |
61 | BuildRequires: python3-sphinxcontrib-jsmath | |
815460ea JB |
62 | BuildRequires: python3-sphinxcontrib-htmlhelp >= 2.0.0 |
63 | BuildRequires: python3-sphinxcontrib-serializinghtml >= 1.1.5 | |
c0d66e02 | 64 | BuildRequires: python3-sphinxcontrib-qthelp |
815460ea | 65 | %if "%{_ver_lt '%{py3_ver}' '3.8'}" == "1" |
24b8cdef | 66 | BuildRequires: python3-typed_ast |
4c3893b4 | 67 | %endif |
64028e9c | 68 | %endif |
c0d66e02 | 69 | %if %{with doc} |
815460ea JB |
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 | |
74 | %endif | |
c0d66e02 JB |
75 | BuildRequires: python3-sphinxcontrib-applehelp |
76 | BuildRequires: python3-sphinxcontrib-devhelp | |
815460ea | 77 | BuildRequires: python3-sphinxcontrib-htmlhelp >= 2.0.0 |
c0d66e02 | 78 | BuildRequires: python3-sphinxcontrib-qthelp |
815460ea | 79 | BuildRequires: python3-sphinxcontrib-serializinghtml >= 1.1.5 |
c0d66e02 | 80 | BuildRequires: python3-sphinxcontrib-websupport |
19a39066 | 81 | %endif |
d6f62011 | 82 | BuildRequires: rpm-pythonprov |
815460ea | 83 | BuildRequires: rpmbuild(macros) >= 1.749 |
24b8cdef | 84 | BuildRequires: sed >= 4.0 |
4c3893b4 JB |
85 | %if %{with tests} |
86 | # for test_build_latex.py (disabled now) | |
87 | #BuildRequires: texlive-luatex | |
88 | #BuildRequires: texlive-xetex | |
89 | %endif | |
64028e9c JB |
90 | Provides: sphinx-pdg-3 = %{version}-%{release} |
91 | Requires: python3-Sphinx = %{version}-%{release} | |
92 | Obsoletes: sphinx-pdg-3 < 3 | |
4acf166f | 93 | BuildArch: noarch |
94 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
95 | ||
96 | %description | |
d6f62011 | 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. | |
4acf166f | 103 | |
79af714d JB |
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. | |
111 | ||
8dffcc23 JB |
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 | |
86f61ef5 | 116 | Requires: python3-alabaster >= 0.7 |
815460ea | 117 | Requires: python3-docutils >= 0.14 |
c0d66e02 | 118 | Requires: python3-modules >= 1:3.5 |
8470b33b | 119 | Requires: python3-devel-tools |
ec1d9b7f | 120 | Conflicts: python3-sphinxcontrib-asyncio < 0.3.0 |
8dffcc23 JB |
121 | Conflicts: sphinx-pdg-3 < 1.0.7-2 |
122 | ||
123 | %description -n python3-Sphinx | |
124 | Sphinx Python documentation generator (Python 3.x modules). | |
125 | ||
126 | For command-line utilities, see sphinx-pdg-3 package. | |
127 | ||
128 | %description -n python3-Sphinx -l pl.UTF-8 | |
129 | Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły | |
130 | Pythona 3.x). | |
131 | ||
132 | Narzędzia działające z linii poleceń znajdują się w pakiecie | |
133 | sphinx-pdg-3. | |
134 | ||
8bf2bcef JB |
135 | %package doc |
136 | Summary: Documentation for Sphinx Python documentation generator | |
137 | Summary(pl.UTF-8): Dokumentacja do generatora dokumentacji pythonowej Sphinx | |
138 | Group: Documentation | |
139 | ||
140 | %description doc | |
141 | Documentation for Sphinx Python documentation generator. | |
142 | ||
143 | %description doc -l pl.UTF-8 | |
144 | Dokumentacja do generatora dokumentacji pythonowej Sphinx. | |
145 | ||
4acf166f | 146 | %prep |
147 | %setup -q -n Sphinx-%{version} | |
8cbf9e72 | 148 | %patch0 -p1 |
d1b48898 | 149 | %patch1 -p1 |
4c3893b4 JB |
150 | |
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 | |
4acf166f | 155 | |
156 | %build | |
b9b9d288 | 157 | %py3_build |
3d438c82 | 158 | %{__rm} -r sphinx/__pycache__ |
4c3893b4 JB |
159 | |
160 | %if %{with tests} | |
24b8cdef | 161 | LC_ALL=C.UTF-8 \ |
8bf2bcef | 162 | PYTHONPATH=$(pwd) \ |
24b8cdef | 163 | %{__python3} -m pytest tests |
4c3893b4 | 164 | %endif |
4acf166f | 165 | |
8bf2bcef JB |
166 | %if %{with doc} |
167 | PYTHONPATH=$(pwd) \ | |
168 | %{__make} -C doc -j1 html man | |
169 | %endif | |
170 | ||
4acf166f | 171 | %install |
172 | rm -rf $RPM_BUILD_ROOT | |
4acf166f | 173 | |
b9b9d288 | 174 | %py3_install |
c0d66e02 | 175 | |
3d438c82 | 176 | %{__rm} -r sphinx/__pycache__ |
e7b5373a | 177 | |
178 | for f in $RPM_BUILD_ROOT%{_bindir}/*; do | |
19a39066 | 179 | %{__mv} "${f}" "${f}-3" |
c0d66e02 | 180 | ln -sf "$(basename "$f")-3" "$f" |
e7b5373a | 181 | done |
24b8cdef | 182 | |
8bf2bcef JB |
183 | %if %{with doc} |
184 | install -d $RPM_BUILD_ROOT%{_mandir}/man1 | |
185 | cp -p doc/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1 | |
c0d66e02 JB |
186 | for f in $RPM_BUILD_ROOT%{_mandir}/man1/*.1 ; do |
187 | ln "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename "$f" .1)-3.1 | |
188 | done | |
8bf2bcef JB |
189 | %endif |
190 | ||
4acf166f | 191 | %clean |
192 | rm -rf $RPM_BUILD_ROOT | |
193 | ||
194 | %files | |
195 | %defattr(644,root,root,755) | |
1f35fc81 | 196 | %attr(755,root,root) %{_bindir}/sphinx-apidoc |
19a39066 | 197 | %attr(755,root,root) %{_bindir}/sphinx-autogen |
79af714d JB |
198 | %attr(755,root,root) %{_bindir}/sphinx-build |
199 | %attr(755,root,root) %{_bindir}/sphinx-quickstart | |
64028e9c JB |
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 | |
8bf2bcef JB |
204 | %if %{with doc} |
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* | |
c0d66e02 JB |
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* | |
b9b9d288 | 215 | %endif |
8dffcc23 | 216 | |
8dffcc23 JB |
217 | %files -n python3-Sphinx |
218 | %defattr(644,root,root,755) | |
24b8cdef | 219 | %doc AUTHORS CHANGES EXAMPLES LICENSE README.rst |
e7b5373a | 220 | %{py3_sitescriptdir}/sphinx |
79af714d | 221 | %{py3_sitescriptdir}/Sphinx-%{version}-py*.egg-info |
8bf2bcef JB |
222 | |
223 | %if %{with doc} | |
224 | %files doc | |
225 | %defattr(644,root,root,755) | |
c0d66e02 | 226 | %doc doc/_build/html/{_downloads,_images,_modules,_static,development,extdev,man,usage,*.html,*.js} |
8bf2bcef | 227 | %endif |