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