[X2Go-Commits] [python-x2go] 02/02: python-x2go.spec: call a more specialized version of sphinx-apidoc depending on the Python version we're building against.

git-admin at x2go.org git-admin at x2go.org
Tue Dec 31 19:52:44 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository python-x2go.

commit b00ab6e16f4d80b12e9f1068398582dd0eb7ba6e
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Tue Dec 31 19:52:06 2019 +0100

    python-x2go.spec: call a more specialized version of sphinx-apidoc depending on the Python version we're building against.
    
    When building for Python 3, use the specific Python-3-version
    corresponding to %{python3_version}.
    
    Otherwise, try to auto-detect the correct version by scanning for either
    sphinx-apidoc-%{python2_version}, sphinx-apidoc-2 or just defaulting to
    sphinx-apidoc (and hoping very hard that this is actually the
    Python-2-version).
---
 debian/changelog |  8 ++++++++
 python-x2go.spec | 24 +++++++++++++++++++++++-
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index 9014983..625a28e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,14 @@ python-x2go (0.6.1.3-0x2go1) UNRELEASED; urgency=medium
   [ Mihai Moldovan ]
   * New upstream version (0.6.1.3):
     - Makefile.docupload: make sphinx-apidoc overridable/configurable.
+  * python-x2go.spec:
+    + Call a more specialized version of sphinx-apidoc depending on the Python
+      version we're building against. When building for Python 3, use the
+      specific Python-3-version corresponding to %{python3_version}.
+      Otherwise, try to auto-detect the correct version by scanning for either
+      sphinx-apidoc-%{python2_version}, sphinx-apidoc-2 or just defaulting to
+      sphinx-apidoc (and hoping very hard that this is actually the
+      Python-2-version).
 
  -- X2Go Release Manager <git-admin at x2go.org>  Thu, 26 Dec 2019 10:37:02 +0100
 
diff --git a/python-x2go.spec b/python-x2go.spec
index 6595189..121dc07 100644
--- a/python-x2go.spec
+++ b/python-x2go.spec
@@ -269,7 +269,29 @@ python3 setup.py build
 # with_python3
 
 # Build the docs
-make -f Makefile.docupload docbuild
+%if %{?with_python3}
+# If we build for Python 3, let's assume that the binary always includes the python 3 version.
+make -f Makefile.docupload docbuild SPHINX_APIDOC='sphinx-apidoc-%{python3_version}'
+%else
+# Python-2-builds are a bit tricky.
+# Sometimes the Python-2-binary doesn't have any postfix, sometimes the unpostfixed one is
+# the Python-3-version.
+# We'll try to guess and select the most appropriate, if possible.
+sphinx_apidoc_bin='sphinx-apidoc'
+sphinx_apidoc_bin_guessed='0'
+if [ -n '%{python2_version}' ]; then
+  if [ -x "/usr/bin/${sphinx_apidoc_bin}-%{python2_version}" ]; then
+    sphinx_apidoc_bin="/usr/bin/${sphinx_apidoc_bin}-%{python2_version}"
+    sphinx_apidoc_bin_guessed='1'
+  fi
+fi
+if [ '0' = "${sphinx_apidoc_bin_guessed}" ] && [ -x "/usr/bin/${sphinx_apidoc_bin}-2" ]; then
+  sphinx_apidoc_bin="/usr/bin/${sphinx_apidoc_bin}-2"
+  sphinx_apidoc_bin_guessed='1'
+fi
+# Otherwise just use the default and hope very hard that it is the Python-2-version.
+make -f Makefile.docupload docbuild SPHINX_APIDOC="${sphinx_apidoc_bin}"
+%endif
 
 
 %install

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/python-x2go.git


More information about the x2go-commits mailing list