From 2e84a7d85142fc395cfba41e0fbb89e9ffc08ca727e0d8d89bc3116c282dd32b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 16 Jul 2020 12:58:08 +0000 Subject: [PATCH] Better version OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-Sphinx?expand=0&rev=155 --- python-Sphinx.spec | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/python-Sphinx.spec b/python-Sphinx.spec index f25a605..5d8c3cb 100644 --- a/python-Sphinx.spec +++ b/python-Sphinx.spec @@ -227,6 +227,14 @@ sed -i 's/\r$//' sphinx/themes/basic/static/jquery.js # Fix wrong end-of-line en %if %{with test} mkdir build.doc +%{python_expand +%if "%{$python_prefix}" == "python%{$python_version}" +%define __pydocprefix python%{$python_version} +%else +%define __pydocprefix %{$python_prefix} +%endif +} + # get its intersphinx_inventroy from python3-doc # instead of via network from https://docs.python.org/3/objects.inv # https://github.com/sphinx-doc/sphinx/pull/7616 @@ -236,9 +244,9 @@ mkdir build.doc # so use a copy from version 3.8.2-3.1 from Tumbleweed cp %{SOURCE2} doc/python3.inv %else -%python_expand cp %{_defaultdocdir}/python%{$python_version}/html/objects.inv doc/python%{$python_version}.inv +%python_expand cp %{_defaultdocdir}/%{__pydocprefix}/html/objects.inv doc/python%{$python_version}.inv %endif -%python_expand sed -i -e "s/\(intersphinx_mapping = ..python.: (.https:..docs.python.org.3.., \)None\()}\)/\1'python%{$python_version}.inv'\2/g" doc/conf.py +%python_expand sed -i -e "s/\(intersphinx_mapping = ..python.: (.https:..docs.python.org.3.., \)None\()}\)/\1'%{__pydocprefix}.inv'\2/g" doc/conf.py %python_exec setup.py build_sphinx && rm build/sphinx/html/.buildinfo %python_exec setup.py build_sphinx -b man