]> git.pld-linux.org Git - packages/sphinx-pdg.git/blob - sphinx-pdg.spec
- sphinxcontrib-asyncio before 0.3.0 is not ready for Sphinx 4
[packages/sphinx-pdg.git] / sphinx-pdg.spec
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
5
6 #
7 # Conditional build:
8 %bcond_without  doc             # documentation
9 %bcond_with     tests           # unit tests (some need network)
10
11 Summary:        Sphinx - Python documentation generator
12 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona
13 Name:           sphinx-pdg
14 Version:        4.5.0
15 Release:        1
16 License:        BSD
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
26 %endif
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
31 %if %{with tests}
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
42 # for lint
43 #BuildRequires: python3-isort
44 BuildRequires:  python3-imagesize
45 %if "%{_ver_lt '%{py3_ver}' '3.10'}" == "1"
46 BuildRequires:  python3-importlib_metadata >= 4.4
47 %endif
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
67 %endif
68 %endif
69 %if %{with doc}
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
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
81 %endif
82 BuildRequires:  rpm-pythonprov
83 BuildRequires:  rpmbuild(macros) >= 1.749
84 BuildRequires:  sed >= 4.0
85 %if %{with tests}
86 # for test_build_latex.py (disabled now)
87 #BuildRequires: texlive-luatex
88 #BuildRequires: texlive-xetex
89 %endif
90 Provides:       sphinx-pdg-3 = %{version}-%{release}
91 Requires:       python3-Sphinx = %{version}-%{release}
92 Obsoletes:      sphinx-pdg-3 < 3
93 BuildArch:      noarch
94 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
95
96 %description
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.
103
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
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
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
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
146 %prep
147 %setup -q -n Sphinx-%{version}
148 %patch0 -p1
149 %patch1 -p1
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
155
156 %build
157 %py3_build
158 %{__rm} -r sphinx/__pycache__
159
160 %if %{with tests}
161 LC_ALL=C.UTF-8 \
162 PYTHONPATH=$(pwd) \
163 %{__python3} -m pytest tests
164 %endif
165
166 %if %{with doc}
167 PYTHONPATH=$(pwd) \
168 %{__make} -C doc -j1 html man
169 %endif
170
171 %install
172 rm -rf $RPM_BUILD_ROOT
173
174 %py3_install
175
176 %{__rm} -r sphinx/__pycache__
177
178 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
179         %{__mv} "${f}" "${f}-3"
180         ln -sf "$(basename "$f")-3" "$f"
181 done
182
183 %if %{with doc}
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
188 done
189 %endif
190
191 %clean
192 rm -rf $RPM_BUILD_ROOT
193
194 %files
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
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*
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*
215 %endif
216
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
222
223 %if %{with doc}
224 %files doc
225 %defattr(644,root,root,755)
226 %doc doc/_build/html/{_downloads,_images,_modules,_static,development,extdev,man,usage,*.html,*.js}
227 %endif
This page took 0.480209 seconds and 3 git commands to generate.