python-sphinx-vl.spec 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492
  1. %global upstream_name Sphinx
  2. %global py3_default 0
  3. Name: python-sphinx
  4. Version: 1.7.9
  5. Release: 1%{?_dist_release}
  6. Summary: Python documentation generator
  7. Group: Development/Tools
  8. # Unless otherwise noted, the license for code is BSD
  9. # sphinx/util/stemmer.py Public Domain
  10. # sphinx/pycode/pgen2 Python
  11. # jquery (MIT or GPLv2)
  12. License: BSD and Public Domain and Python and (MIT or GPLv2)
  13. URL: http://sphinx.pocoo.org/
  14. Vendor: Project Vine
  15. Distribution: Vine Linux
  16. Source0: http://pypi.python.org/packages/source/S/%{upstream_name}/%{upstream_name}-%{version}.tar.gz
  17. Source1: python2-sphinx
  18. Source2: python3-sphinx
  19. Source3: zz-modules-python-sphinx.sh
  20. Source4: zz-modules-python-sphinx.csh
  21. Source5: README.fedora
  22. # environment-modules file to select whether the py2 or py3 version of
  23. # python-sphinx execuitables is default
  24. Source6: default-sphinx-command.in
  25. # Make the test_latex_remote_images an expected failure
  26. # since it requires an active internet connection
  27. # to fetch images, which is not possible in koji or mock.
  28. Patch0: xfail-test_latex_remote_images.patch
  29. # Allow extra themes to exist. We pull in python[23]-sphinx-theme-alabaster
  30. # which causes that test to fail.
  31. Patch1: sphinx-test_theming.diff
  32. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
  33. BuildArch: noarch
  34. BuildRequires: python-rpm-macros
  35. BuildRequires: python-devel
  36. BuildRequires: python-setuptools
  37. BuildRequires: python-six
  38. BuildRequires: python-jinja2
  39. BuildRequires: python-pygments
  40. BuildRequires: python-docutils
  41. BuildRequires: python-snowballstemmer
  42. BuildRequires: python-babel
  43. BuildRequires: python-sphinx-theme-alabaster
  44. BuildRequires: python-imagesize
  45. BuildRequires: python-requests
  46. BuildRequires: python-packaging
  47. BuildRequires: python-typing
  48. BuildRequires: python-sphinxcontrib-websupport
  49. Requires: python-sphinx-locale = %{version}-%{release}
  50. Requires: python-six
  51. Requires: python-jinja2
  52. Requires: python-pygments
  53. Requires: python-docutils
  54. Requires: python-snowballstemmer
  55. Requires: python-babel
  56. Requires: python-sphinx-theme-alabaster
  57. Requires: python-imagesize
  58. Requires: python-requests
  59. Requires: python-packaging
  60. Requires: python-typing
  61. Requires: python3-sphinxcontrib-websupport
  62. %description
  63. Sphinx is a tool that makes it easy to create intelligent and
  64. beautiful documentation for Python projects (or other documents
  65. consisting of multiple reStructuredText sources), written by Georg
  66. Brandl. It was originally created to translate the new Python
  67. documentation, but has now been cleaned up in the hope that it will be
  68. useful to many other projects.
  69. Sphinx uses reStructuredText as its markup language, and many of its
  70. strengths come from the power and straightforwardness of
  71. reStructuredText and its parsing and translating suite, the Docutils.
  72. Although it is still under constant development, the following
  73. features are already present, work fine and can be seen "in action" in
  74. the Python docs:
  75. * Output formats: HTML (including Windows HTML Help) and LaTeX,
  76. for printable PDF versions
  77. * Extensive cross-references: semantic markup and automatic links
  78. for functions, classes, glossary terms and similar pieces of
  79. information
  80. * Hierarchical structure: easy definition of a document tree, with
  81. automatic links to siblings, parents and children
  82. * Automatic indices: general index as well as a module index
  83. * Code handling: automatic highlighting using the Pygments highlighter
  84. * Various extensions are available, e.g. for automatic testing of
  85. snippets and inclusion of appropriately formatted docstrings.
  86. %package -n python3-sphinx
  87. Summary: Python documentation generator
  88. Group: Development/Tools
  89. BuildRequires: python3-rpm-macros
  90. BuildRequires: python3-devel
  91. BuildRequires: python3-setuptools
  92. BuildRequires: python3-six
  93. BuildRequires: python3-jinja2
  94. BuildRequires: python3-pygments
  95. BuildRequires: python3-docutils
  96. BuildRequires: python3-snowballstemmer
  97. BuildRequires: python3-babel
  98. BuildRequires: python3-sphinx-theme-alabaster
  99. BuildRequires: python3-imagesize
  100. BuildRequires: python3-requests
  101. BuildRequires: python3-packaging
  102. BuildRequires: python3-sphinxcontrib-websupport
  103. Requires: python-sphinx-locale = %{version}-%{release}
  104. Requires: python3-six
  105. Requires: python3-jinja2
  106. Requires: python3-pygments
  107. Requires: python3-docutils
  108. Requires: python3-snowballstemmer
  109. Requires: python3-babel
  110. Requires: python3-sphinx-theme-alabaster
  111. Requires: python3-imagesize
  112. Requires: python3-requests
  113. Requires: python3-packaging
  114. Requires: python3-sphinxcontrib-websupport
  115. %description -n python3-sphinx
  116. Sphinx is a tool that makes it easy to create intelligent and
  117. beautiful documentation for Python projects (or other documents
  118. consisting of multiple reStructuredText sources), written by Georg
  119. Brandl. It was originally created to translate the new Python
  120. documentation, but has now been cleaned up in the hope that it will be
  121. useful to many other projects.
  122. Sphinx uses reStructuredText as its markup language, and many of its
  123. strengths come from the power and straightforwardness of
  124. reStructuredText and its parsing and translating suite, the Docutils.
  125. Although it is still under constant development, the following
  126. features are already present, work fine and can be seen "in action" in
  127. the Python docs:
  128. * Output formats: HTML (including Windows HTML Help) and LaTeX,
  129. for printable PDF versions
  130. * Extensive cross-references: semantic markup and automatic links
  131. for functions, classes, glossary terms and similar pieces of
  132. information
  133. * Hierarchical structure: easy definition of a document tree, with
  134. automatic links to siblings, parents and children
  135. * Automatic indices: general index as well as a module index
  136. * Code handling: automatic highlighting using the Pygments highlighter
  137. * Various extensions are available, e.g. for automatic testing of
  138. snippets and inclusion of appropriately formatted docstrings.
  139. %package locale
  140. Summary: Locale files for %{name}
  141. Group: Development/Tools
  142. License: BSD
  143. %description locale
  144. Sphinx is a tool that makes it easy to create intelligent and
  145. beautiful documentation for Python projects (or other documents
  146. consisting of multiple reStructuredText sources), written by Georg
  147. Brandl. It was originally created to translate the new Python
  148. documentation, but has now been cleaned up in the hope that it will be
  149. useful to many other projects.
  150. This package contains locale files for Sphinx
  151. %package doc
  152. Summary: Documentation for %{name}
  153. Group: Documentation
  154. License: BSD
  155. Requires: %{name} = %{version}-%{release}
  156. %description doc
  157. Sphinx is a tool that makes it easy to create intelligent and
  158. beautiful documentation for Python projects (or other documents
  159. consisting of multiple reStructuredText sources), written by Georg
  160. Brandl. It was originally created to translate the new Python
  161. documentation, but has now been cleaned up in the hope that it will be
  162. useful to many other projects.
  163. This package contains documentation in reST and HTML formats.
  164. %prep
  165. %autosetup -n %{upstream_name}-%{version} -p1
  166. cp %{SOURCE5} .
  167. # fix line encoding of bundled jquery.js
  168. perl -pi -e 's/\r//' ./sphinx/themes/basic/static/jquery.js
  169. %if 0%{?with_python3}
  170. rm -rf %{py3dir}
  171. cp -a . %{py3dir}
  172. %endif # with_python3
  173. %build
  174. %{py_build}
  175. %{py3_build}
  176. export PYTHONPATH=$PWD
  177. pushd doc
  178. export SPHINXBUILD="%{__python3} ../sphinx/cmd/build.py"
  179. make html SPHINXBUILD="$SPHINXBUILD"
  180. make man SPHINXBUILD="$SPHINXBUILD"
  181. rm -rf _build/html/.buildinfo
  182. mv _build/html ..
  183. popd
  184. %install
  185. %__rm -rf %{buildroot}
  186. %{py3_install}
  187. install -d %{buildroot}%{_libexecdir}/python3-sphinx
  188. for i in sphinx-{apidoc,autogen,build,quickstart}; do
  189. mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python3_version}
  190. ln -s $i-%{python3_version} %{buildroot}%{_bindir}/$i-3
  191. ln -s %{_bindir}/$i-3 %{buildroot}%{_libexecdir}/python3-sphinx/$i
  192. done
  193. %{py_install}
  194. install -d %{buildroot}%{_libexecdir}/python2-sphinx
  195. install -d %{buildroot}%{_libexecdir}/python2-sphinx
  196. for i in sphinx-{apidoc,autogen,build,quickstart}; do
  197. mv %{buildroot}%{_bindir}/$i %{buildroot}%{_bindir}/$i-%{python_version}
  198. ln -s $i-%{python_version} %{buildroot}%{_bindir}/$i-2
  199. ln -s %{_bindir}/$i-2 %{buildroot}%{_libexecdir}/python2-sphinx/$i
  200. done
  201. pushd doc
  202. # Deliver man pages
  203. install -d %{buildroot}%{_mandir}/man1
  204. for f in _build/man/sphinx-*.1;
  205. do
  206. ### TODO: these are all the same. Do we really need to ship them three
  207. ### times or is it fine to just ship them as e.g. sphinx-build.1
  208. cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f)
  209. cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f | sed -e "s|.1$|-%{python_version}.1|")
  210. cp -p $f %{buildroot}%{_mandir}/man1/$(basename $f | sed -e "s|.1$|-%{python3_version}.1|")
  211. done
  212. # Remove language files, they're identical to the ones from the
  213. # Python 2 build that will be moved to /usr/share below
  214. find %{buildroot}%{python3_sitelib}/sphinx/locale -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -exec rm -rf '{}' \;
  215. popd
  216. # Clean up non-python files
  217. rm -f %{buildroot}%{python_sitelib}/sphinx/locale/.DS_Store
  218. rm -rf %{buildroot}%{python_sitelib}/sphinx/locale/.tx
  219. rm -f %{buildroot}%{python3_sitelib}/sphinx/locale/.DS_Store
  220. rm -rf %{buildroot}%{python3_sitelib}/sphinx/locale/.tx
  221. # Deliver rst files
  222. rm -rf doc/_build
  223. sed -i 's|python ../sphinx-build.py|/usr/bin/sphinx-build|' doc/Makefile
  224. mv doc reST
  225. # Move language files to /usr/share;
  226. # patch to support this incorporated in 0.6.6
  227. pushd %{buildroot}%{python_sitelib}
  228. for lang in `find sphinx/locale -maxdepth 1 -mindepth 1 -type d -not -path '*/\.*' -printf "%f "`;
  229. do
  230. install -d %{buildroot}%{_datadir}/sphinx/locale/$lang
  231. install -d %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES
  232. mv sphinx/locale/$lang/LC_MESSAGES/sphinx.js \
  233. %{buildroot}%{_datadir}/sphinx/locale/$lang/
  234. mv sphinx/locale/$lang/LC_MESSAGES/sphinx.mo \
  235. %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/
  236. rm -rf sphinx/locale/$lang
  237. done
  238. popd
  239. #install -d %{buildroot}%{_modulesdir}/python-sphinx
  240. #install -m 0644 %{SOURCE1} %{buildroot}%{_modulesdir}/python-sphinx/
  241. #sed -i 's|@python2_sphinx_dir@|%{_libexecdir}/python2-sphinx|' %{buildroot}%{_modulesdir}/python-sphinx/python2-sphinx
  242. #install -m 0644 %{SOURCE2} %{buildroot}%{_modulesdir}/python-sphinx/
  243. #sed -i 's|@python3_sphinx_dir@|%{_libexecdir}/python3-sphinx|' %{buildroot}%{_modulesdir}/python-sphinx/python3-sphinx
  244. install -d %{buildroot}%{_sysconfdir}/profile.d
  245. install -m 0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh
  246. install -m 0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh
  247. %if %{py3_default}
  248. #sed 's/@PYTHONVER@/3/' < %{SOURCE6} > %{buildroot}%{_modulesdir}/python-sphinx/.version
  249. # These symlinks establish a default for when a package is first installed (and
  250. # therefore, environment modules is not loaded). The user can immediately
  251. # switch them by using module swap python-sphinx/python2-sphinx
  252. for filename in sphinx-{build,apidoc,autogen,quickstart} ; do
  253. ln -s %{_libexecdir}/python3-sphinx/$filename %{buildroot}%{_bindir}/$filename
  254. done
  255. %else
  256. #sed 's/@PYTHONVER@/2/' < %{SOURCE6} > %{buildroot}%{_modulesdir}/python-sphinx/.version
  257. # These symlinks establish a default for when a package is first installed (and
  258. # therefore, environment modules is not loaded). The user can immediately
  259. # switch them by using module swap python-sphinx/python3-sphinx
  260. for filename in sphinx-{build,apidoc,autogen,quickstart} ; do
  261. ln -s %{_libexecdir}/python2-sphinx/$filename %{buildroot}%{_bindir}/$filename
  262. done
  263. %endif
  264. %find_lang sphinx
  265. # Language files; Since these are javascript, it's not immediately obvious to
  266. # find_lang that they need to be marked with a language.
  267. (cd %{buildroot} && find . -name 'sphinx.js') | sed -e 's|^.||' | sed -e \
  268. 's:\(.*/locale/\)\([^/_]\+\)\(.*\.js$\):%lang(\2) \1\2\3:' \
  269. >> sphinx.lang
  270. %clean
  271. %__rm -rf %{buildroot}
  272. %check
  273. #__make test
  274. %files
  275. %defattr(-,root,root,-)
  276. %license LICENSE
  277. %doc AUTHORS CHANGES EXAMPLES README.*
  278. %{_bindir}/sphinx-*-2*
  279. %{_bindir}/sphinx-build
  280. %{_bindir}/sphinx-apidoc
  281. %{_bindir}/sphinx-autogen
  282. %{_bindir}/sphinx-quickstart
  283. %{python_sitelib}/sphinx/
  284. %{python_sitelib}/Sphinx-%{version}-py%{python_version}.egg-info/
  285. %exclude %{_mandir}/man1/sphinx-*-%{python3_version}.1*
  286. %{_mandir}/man1/*
  287. %{_libexecdir}/python2-sphinx/
  288. #{_modulesdir}/python-sphinx/python2-sphinx
  289. %if !%{py3_default}
  290. #{_modulesdir}/python-sphinx/.version
  291. %endif
  292. %config(noreplace) %{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh
  293. %config(noreplace) %{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh
  294. %files -n python3-sphinx
  295. %license LICENSE
  296. %doc AUTHORS CHANGES EXAMPLES README.*
  297. %{_bindir}/sphinx-*-3*
  298. %{python3_sitelib}/sphinx/
  299. %{python3_sitelib}/Sphinx-%{version}-py%{python3_version}.egg-info/
  300. %{_mandir}/man1/sphinx-*-%{python3_version}.1*
  301. %{_libexecdir}/python3-sphinx/
  302. #{_modulesdir}/python-sphinx/python3-sphinx
  303. %if %{py3_default}
  304. #{_modulesdir}/python-sphinx/.version
  305. %endif
  306. %config(noreplace) %{_sysconfdir}/profile.d/zz-modules-python-sphinx.sh
  307. %config(noreplace) %{_sysconfdir}/profile.d/zz-modules-python-sphinx.csh
  308. %files locale -f sphinx.lang
  309. %license LICENSE
  310. %dir %{_datadir}/sphinx/
  311. %dir %{_datadir}/sphinx/locale
  312. %dir %{_datadir}/sphinx/locale/*
  313. %files doc
  314. %defattr(-,root,root,-)
  315. %doc html reST
  316. %changelog
  317. * Wed Nov 28 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.7.9-1
  318. - new upstream release.
  319. - dropped Patch2.
  320. - imported Patch0-1 from rawhide.
  321. - added python3 support.
  322. * Wed May 09 2018 Toshiaki Ara <ara_t@384.jp> 1.1.3-3
  323. - added patch2 from RedHat
  324. * Thu Jul 2 2015 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.1.3-2
  325. - added patch0.
  326. * Sun Jun 30 2013 Toshiharu Kudoh <toshi.kd2@gmail.com> 1.1.3-1
  327. - new upstream release
  328. * Sun Feb 19 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.0.7-2
  329. - rebuild with python-2.7.2
  330. * Thu May 5 2011 IWAI, Masaharu <iwai@alib.jp> 1.0.7-1
  331. - new upstream release
  332. - add BuildRequires: python-simplejson for Vine5
  333. - add Vendor and Distribution tags
  334. * Wed Dec 01 2010 Shu KONNO <owa@bg.wakwak.com> 1.0.5-1
  335. - update sphinx to 1.0.5
  336. * Mon Aug 23 2010 Munehiro Yamamoto <munepi@vinelinux.org> 1.0-1.b2
  337. - initial build based on Fedora development
  338. * Thu Jul 22 2010 David Malcolm <dmalcolm@redhat.com> - 1.0-0.1.b2.1
  339. - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
  340. * Mon May 31 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 1.0-0.2.b2
  341. - Update to 1.0 beta 2
  342. - Fixes problem building html documentation in non-English locales
  343. * Wed May 26 2010 Michel Salim <salimma@fedoraproject.org> - 1.0-0.1.b1
  344. - Update to 1.0 beta 1
  345. * Tue May 25 2010 Michel Salim <salimma@fedoraproject.org> - 0.6.6-1
  346. - Update to 0.6.6
  347. * Fri May 21 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.5-2
  348. - Few minor tweaks to Gareth's spec file update
  349. * Mon May 10 2010 Gareth Armstrong <gareth.armstrong@hp.com> - 0.6.5-1.hp
  350. - Update to 0.6.5
  351. - Initial import of python-sphinx from Fedora Rawhide for use in HP CMS
  352. - Enforce that Sphinx requires Python 2.4 or later via an explicit BR
  353. - Minor tweaks to spec file
  354. - Move language files to %%{_datadir}, idea borrowed from Debian's sphinx
  355. package
  356. - Deliver man pages for sphinx-build & sphinx-quickstart
  357. - Deliver rst documentation files to reST directory in doc sub-package
  358. - Add %%check section for Python2 and add BR on python-nose
  359. * Wed Jan 13 2010 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.4-1
  360. - Update to 0.6.4
  361. - Fixes a problem using autodoc with pylons projects.
  362. * Fri Sep 4 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.3-1
  363. - Update to 0.6.3
  364. * Mon Aug 17 2009 Toshio Kuratomi <toshio@fedoraproject.org> - 0.6.2-1
  365. - Update to 0.6.2 -- upstream bugfix requested inside bz#512438
  366. * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.6.1-3
  367. - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
  368. * Fri Jun 05 2009 Luke Macken <lmacken@redhat.com> - 0.6.1-2
  369. - Add a patch to use our own setuptools package
  370. * Fri Apr 17 2009 Michel Salim <salimma@fedoraproject.org> - 0.6.1-1
  371. - Update to 0.6.1
  372. * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-2
  373. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  374. * Fri Jan 2 2009 Michel Salim <salimma@fedoraproject.org> - 0.5.1-1
  375. - Update to 0.5.1
  376. * Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.5-2
  377. - Rebuild for Python 2.6
  378. * Mon Nov 24 2008 Michel Salim <salimma@fedoraproject.org> - 0.5-1
  379. - Update to 0.5
  380. * Fri Oct 10 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.3-1
  381. - Update to 0.4.3
  382. * Wed Aug 27 2008 Toshio Kuratomi <toshio@fedoraproject.org> - 0.4.2-1.1
  383. - Fix for EL-5 build.
  384. * Mon Aug 25 2008 Michel Salim <salimma@fedoraproject.org> - 0.4.2-1
  385. - Update to 0.4.2
  386. * Mon May 26 2008 Michel Salim <salimma@fedoraproject.org> - 0.3-1
  387. - Update to 0.3
  388. * Fri May 2 2008 Michel Salim <salimma@fedoraproject.org> - 0.1.61950-3
  389. - Split documentation into subpackage
  390. - Exclude C files (not built by default anyway)
  391. * Wed Apr 16 2008 José Matos <jamatos@fc.up.pt> - 0.1.61950-2
  392. - Build html documentation, include it and include the rst
  393. documentation.
  394. * Thu Mar 27 2008 Michel Salim <michel.sylvan@gmail.com> 0.1.61950-1
  395. - Initial package