docs: Use either python3 or python
authorGuido Günther <agx@sigxcpu.org>
Fri, 28 May 2021 09:06:07 +0000 (11:06 +0200)
committerGuido Günther <agx@sigxcpu.org>
Fri, 28 May 2021 09:28:17 +0000 (11:28 +0200)
Some distros (such as Debian) don't ship a /usr/bin/python anymore

docs/Makefile

index 41f172b0900786e0d80296f2998f0a1e335e1b60..505d74b1b19e4edf8247e90d655ede7597087142 100644 (file)
@@ -40,6 +40,13 @@ MAN_DATE=$(shell dpkg-parsechangelog -l ../debian/changelog -SDate | TZ=UTC LC_A
 IMAGES=$(wildcard images/*png)
 DEST_IMAGES=$(subst images/,$(MANUAL)/images/,$(IMAGES))
 
+# Select python
+ifneq ($(strip $(shell which python3)),)
+       PYTHON=python3
+else
+       PYTHON=python
+endif
+
 # Select docbook-to-man tool
 ifeq ($(shell which docbook2x-man), )
        DOCBOOK_TO_MAN=docbook-to-man
@@ -79,7 +86,7 @@ git-pbuilder.1: ../bin/git-pbuilder
 manual.xml: $(VERSION_ENT)
 
 $(GBP_VERSION): ../debian/changelog
-       cd .. && python setup.py build --help >/dev/null
+       cd .. && $(PYTHON) setup.py build --help >/dev/null
 
 $(VERSION_ENT): $(GBP_VERSION)
        echo '<!ENTITY gbp-version "$(DEB_VERSION)">' > $(VERSION_ENT)