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