diff contrib/packaging/buildrpm @ 43342:a6dcac6454c1 stable

packaging: introduce Python3 support as buildrpm --python3 Just overrule the HGPYTHON3 warning.
author Mads Kiilerich <mads@kiilerich.com>
date Sun, 27 Oct 2019 21:28:26 +0100
parents e0812b032bcc
children 825f8f42333a
line wrap: on
line diff
--- a/contrib/packaging/buildrpm	Sun Oct 27 21:40:21 2019 +0100
+++ b/contrib/packaging/buildrpm	Sun Oct 27 21:28:26 2019 +0100
@@ -11,6 +11,7 @@
 
 BUILD=1
 RPMBUILDDIR="$PWD/rpmbuild"
+PYTHONEXE=python2
 
 while [ "$1" ]; do
     case "$1" in
@@ -18,6 +19,10 @@
         shift
         BUILD=
         ;;
+    --python3)
+        shift
+        PYTHONEXE=python3
+        ;;
     --withpython | --with-python)
         shift
         PYTHONVER=2.7.16
@@ -96,6 +101,7 @@
 
 sed -e "s,^Version:.*,Version: $version," \
     -e "s,^Release:.*,Release: $release," \
+    -e "s/^%global pythonexe .*/%global pythonexe $PYTHONEXE/" \
     $specfile > $rpmspec
 
 echo >> $rpmspec