packaging: allow choosing python version depending on centos version
Differential Revision: https://phab.mercurial-scm.org/D7217
--- a/contrib/packaging/Makefile Mon Nov 04 19:05:44 2019 +0000
+++ b/contrib/packaging/Makefile Mon Nov 04 07:40:32 2019 +0100
@@ -20,6 +20,7 @@
# Build a Python for these CentOS releases.
CENTOS_WITH_PYTHON_RELEASES := 5 6
+CENTOS_WITH_NONVERSIONED_PYTHON := 5 6 7
help:
@echo 'Packaging Make Targets'
@@ -110,13 +111,13 @@
.PHONY: centos$(1)
centos$(1):
mkdir -p $$(HGROOT)/packages/centos$(1)
- ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
+ ./buildrpm $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))
cp $$(HGROOT)/contrib/packaging/rpmbuild/RPMS/*/* $$(HGROOT)/packages/centos$(1)
cp $$(HGROOT)/contrib/packaging/rpmbuild/SRPMS/* $$(HGROOT)/packages/centos$(1)
.PHONY: docker-centos$(1)
docker-centos$(1):
- ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,--python python)
+ ./dockerrpm centos$(1) $$(if $$(filter $(1),$$(CENTOS_WITH_PYTHON_RELEASES)),--withpython,$$(if $$(filter $(1),$$(CENTOS_WITH_NONVERSIONED_PYTHON)),--python python,))
endef