]> git.pld-linux.org Git - packages/sphinx-pdg.git/blob - sphinx-pdg.spec
rebuild with python 3.10
[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:        3.5.4
15 Release:        3
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:  dd46088ebc01f6f721ee7618df680d68
21 Patch0:         float-ver.patch
22 Patch1:         Sphinx-jinja3.patch
23 Patch2:         Sphinx-docutils.patch
24 URL:            http://www.sphinx-doc.org/
25 %if %{with tests} && %(locale -a | grep -q '^C\.utf8$'; echo $?)
26 BuildRequires:  glibc-localedb-all
27 %endif
28 BuildRequires:  python3-babel >= 1.3
29 BuildRequires:  python3-devel >= 1:3.5
30 BuildRequires:  python3-modules >= 1:3.5
31 BuildRequires:  python3-setuptools >= 1:7.0
32 %if %{with tests}
33 BuildRequires:  python3-Cython
34 BuildRequires:  python3-alabaster >= 0.7
35 BuildRequires:  python3-alabaster < 0.8
36 BuildRequires:  python3-docutils >= 0.12
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 BuildRequires:  python3-jinja2 >= 2.3
46 # for lint only, not run by pytest
47 #BuildRequires: python3-mypy >= 0.800
48 BuildRequires:  python3-packaging
49 BuildRequires:  python3-pygments >= 2.0
50 BuildRequires:  python3-pytest >= 3.0
51 # for coverage tests only
52 #BuildRequires: python3-pytest-cov
53 BuildRequires:  python3-requests >= 2.5.0
54 BuildRequires:  python3-six >= 1.5
55 BuildRequires:  python3-snowballstemmer >= 1.1
56 BuildRequires:  python3-sphinxcontrib-applehelp
57 BuildRequires:  python3-sphinxcontrib-devhelp
58 BuildRequires:  python3-sphinxcontrib-jsmath
59 BuildRequires:  python3-sphinxcontrib-htmlhelp
60 BuildRequires:  python3-sphinxcontrib-serializinghtml
61 BuildRequires:  python3-sphinxcontrib-qthelp
62 %if "%{py3_ver}" < "3.8"
63 BuildRequires:  python3-typed_ast
64 %endif
65 %endif
66 %if %{with doc}
67 BuildRequires:  python3-sphinxcontrib-applehelp
68 BuildRequires:  python3-sphinxcontrib-devhelp
69 BuildRequires:  python3-sphinxcontrib-htmlhelp
70 BuildRequires:  python3-sphinxcontrib-qthelp
71 BuildRequires:  python3-sphinxcontrib-serializinghtml
72 BuildRequires:  python3-sphinxcontrib-websupport
73 %endif
74 BuildRequires:  rpm-pythonprov
75 BuildRequires:  rpmbuild(macros) >= 1.714
76 BuildRequires:  sed >= 4.0
77 %if %{with tests}
78 # for test_build_latex.py (disabled now)
79 #BuildRequires: texlive-luatex
80 #BuildRequires: texlive-xetex
81 %endif
82 Provides:       sphinx-pdg-3 = %{version}-%{release}
83 Requires:       python3-Sphinx = %{version}-%{release}
84 Obsoletes:      sphinx-pdg-3 < 3
85 BuildArch:      noarch
86 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
87
88 %description
89 Sphinx is a tool that makes it easy to create intelligent and
90 beautiful documentation for Python projects (or other documents
91 consisting of multiple reStructuredText sources), written by Georg
92 Brandl. It was originally created to translate the new Python
93 documentation, but has now been cleaned up in the hope that it will be
94 useful to many other projects.
95
96 %description -l pl.UTF-8
97 Sphinx to narzędzie ułatwiające tworzenie inteligentnej i ładnej
98 dokumentacji dla projektów w Pythonie (lub innych dokumentów
99 składających się z wielu źródeł w formacie reStructuredText), napisane
100 przez Georga Brandla. Pierwotnie powstało do tłumaczenia nowej
101 dokumentacji Pythona, ale potem zostało wyczyszczone w nadziei, że
102 będzie przydatne dla wielu innych projektów.
103
104 %package -n python3-Sphinx
105 Summary:        Sphinx Python documentation generator (Python 3.x modules)
106 Summary(pl.UTF-8):      Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły Pythona 3.x)
107 Group:          Development/Languages/Python
108 Requires:       python3-alabaster >= 0.7
109 Requires:       python3-docutils >= 0.12
110 Requires:       python3-modules >= 1:3.5
111 Requires:       python3-devel-tools
112 Conflicts:      sphinx-pdg-3 < 1.0.7-2
113
114 %description -n python3-Sphinx
115 Sphinx Python documentation generator (Python 3.x modules).
116
117 For command-line utilities, see sphinx-pdg-3 package.
118
119 %description -n python3-Sphinx -l pl.UTF-8
120 Sphinx - narzędzie do tworzenia dokumentacji dla Pythona (moduły
121 Pythona 3.x).
122
123 Narzędzia działające z linii poleceń znajdują się w pakiecie
124 sphinx-pdg-3.
125
126 %package doc
127 Summary:        Documentation for Sphinx Python documentation generator
128 Summary(pl.UTF-8):      Dokumentacja do generatora dokumentacji pythonowej Sphinx
129 Group:          Documentation
130
131 %description doc
132 Documentation for Sphinx Python documentation generator.
133
134 %description doc -l pl.UTF-8
135 Dokumentacja do generatora dokumentacji pythonowej Sphinx.
136
137 %prep
138 %setup -q -n Sphinx-%{version}
139 %patch0 -p1
140 %patch1 -p1
141 %patch2 -p1
142
143 # needs python-babel with at least de,en,ja locales installed
144 %{__rm} tests/test_util_i18n.py
145 # requires various latex variants, fails in a ways difficult to diagnose
146 %{__rm} tests/test_build_latex.py
147
148 %build
149 %py3_build
150 %{__rm} -r sphinx/__pycache__
151
152 %if %{with tests}
153 LC_ALL=C.UTF-8 \
154 PYTHONPATH=$(pwd) \
155 %{__python3} -m pytest tests
156 %endif
157
158 %if %{with doc}
159 PYTHONPATH=$(pwd) \
160 %{__make} -C doc -j1 html man
161 %endif
162
163 %install
164 rm -rf $RPM_BUILD_ROOT
165
166 %py3_install
167
168 %{__rm} -r sphinx/__pycache__
169
170 for f in $RPM_BUILD_ROOT%{_bindir}/*; do
171         %{__mv} "${f}" "${f}-3"
172         ln -sf "$(basename "$f")-3" "$f"
173 done
174
175 %if %{with doc}
176 install -d $RPM_BUILD_ROOT%{_mandir}/man1
177 cp -p doc/_build/man/*.1 $RPM_BUILD_ROOT%{_mandir}/man1
178 for f in $RPM_BUILD_ROOT%{_mandir}/man1/*.1 ; do
179         ln "$f" $RPM_BUILD_ROOT%{_mandir}/man1/$(basename "$f" .1)-3.1
180 done
181 %endif
182
183 %clean
184 rm -rf $RPM_BUILD_ROOT
185
186 %files
187 %defattr(644,root,root,755)
188 %attr(755,root,root) %{_bindir}/sphinx-apidoc
189 %attr(755,root,root) %{_bindir}/sphinx-autogen
190 %attr(755,root,root) %{_bindir}/sphinx-build
191 %attr(755,root,root) %{_bindir}/sphinx-quickstart
192 %attr(755,root,root) %{_bindir}/sphinx-apidoc-3
193 %attr(755,root,root) %{_bindir}/sphinx-autogen-3
194 %attr(755,root,root) %{_bindir}/sphinx-build-3
195 %attr(755,root,root) %{_bindir}/sphinx-quickstart-3
196 %if %{with doc}
197 %{_mandir}/man1/sphinx-all.1*
198 %{_mandir}/man1/sphinx-apidoc.1*
199 %{_mandir}/man1/sphinx-autogen.1*
200 %{_mandir}/man1/sphinx-build.1*
201 %{_mandir}/man1/sphinx-quickstart.1*
202 %{_mandir}/man1/sphinx-all-3.1*
203 %{_mandir}/man1/sphinx-apidoc-3.1*
204 %{_mandir}/man1/sphinx-autogen-3.1*
205 %{_mandir}/man1/sphinx-build-3.1*
206 %{_mandir}/man1/sphinx-quickstart-3.1*
207 %endif
208
209 %files -n python3-Sphinx
210 %defattr(644,root,root,755)
211 %doc AUTHORS CHANGES EXAMPLES LICENSE README.rst
212 %{py3_sitescriptdir}/sphinx
213 %{py3_sitescriptdir}/Sphinx-%{version}-py*.egg-info
214
215 %if %{with doc}
216 %files doc
217 %defattr(644,root,root,755)
218 %doc doc/_build/html/{_downloads,_images,_modules,_static,development,extdev,man,usage,*.html,*.js}
219 %endif
This page took 0.143733 seconds and 3 git commands to generate.