Switch to python3 by default

- Python 2.7 is planned to be the last of the 2.x releases
- It's generally advised to use Python 3
- Majority of python/ scripts are already switched python3
- Users with python 2 only can still use:

$ make PYTHON=/usr/bin/python ....

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
Petr Lautrbach 2019-02-18 17:27:44 +01:00
parent 3b868abd2e
commit 1952be65dc
10 changed files with 10 additions and 10 deletions

View File

@ -1,7 +1,7 @@
# Support building the Python bindings multiple times, against various Python # Support building the Python bindings multiple times, against various Python
# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build # runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
# targets with "PYPREFIX": # targets with "PYPREFIX":
PYTHON ?= python PYTHON ?= python3
PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])') PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])')
RUBY ?= ruby RUBY ?= ruby
RUBYPREFIX ?= $(notdir $(RUBY)) RUBYPREFIX ?= $(notdir $(RUBY))

View File

@ -1,7 +1,7 @@
# Support building the Python bindings multiple times, against various Python # Support building the Python bindings multiple times, against various Python
# runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build # runtimes (e.g. Python 2 vs Python 3) by optionally prefixing the build
# targets with "PYPREFIX": # targets with "PYPREFIX":
PYTHON ?= python PYTHON ?= python3
PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])') PYPREFIX ?= $(shell $(PYTHON) -c 'import sys;print("python-%d.%d" % sys.version_info[:2])')
RUBY ?= ruby RUBY ?= ruby
RUBYPREFIX ?= $(notdir $(RUBY)) RUBYPREFIX ?= $(notdir $(RUBY))

View File

@ -1,4 +1,4 @@
PYTHON ?= python PYTHON ?= python3
SECILC ?= secilc SECILC ?= secilc
# Installation directories. # Installation directories.

View File

@ -1,4 +1,4 @@
PYTHON ?= python PYTHON ?= python3
# Installation directories. # Installation directories.
LINGUAS ?= ru LINGUAS ?= ru

View File

@ -1,5 +1,5 @@
PREFIX ?= /usr PREFIX ?= /usr
PYTHON ?= python PYTHON ?= python3
PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(prefix='$(PREFIX)'))") PYTHONLIBDIR ?= $(shell $(PYTHON) -c "from distutils.sysconfig import *; print(get_python_lib(prefix='$(PREFIX)'))")
PACKAGEDIR ?= /$(PYTHONLIBDIR)/sepolgen PACKAGEDIR ?= /$(PYTHONLIBDIR)/sepolgen

View File

@ -1,4 +1,4 @@
PYTHON ?= python PYTHON ?= python3
clean: clean:
rm -f *~ *.pyc rm -f *~ *.pyc

View File

@ -1,4 +1,4 @@
PYTHON ?= python PYTHON ?= python3
# Installation directories. # Installation directories.
LINGUAS ?= ru LINGUAS ?= ru

View File

@ -1,4 +1,4 @@
PYTHON ?= python PYTHON ?= python3
# Installation directories. # Installation directories.
LINGUAS ?= ru LINGUAS ?= ru

View File

@ -25,7 +25,7 @@ export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH" export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
# shellcheck disable=SC2155 # shellcheck disable=SC2155
export PYTHONPATH="$DESTDIR$(${PYTHON:-python} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")" export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
# shellcheck disable=SC2155 # shellcheck disable=SC2155
export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')" export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"

View File

@ -17,7 +17,7 @@ fi
# Make sure to use the newly-installed libraries when running tests # Make sure to use the newly-installed libraries when running tests
export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib" export LD_LIBRARY_PATH="$DESTDIR/usr/lib:$DESTDIR/lib"
export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH" export PATH="$DESTDIR/usr/sbin:$DESTDIR/usr/bin:$DESTDIR/sbin:$DESTDIR/bin:$PATH"
export PYTHONPATH="$DESTDIR$(${PYTHON:-python} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")" export PYTHONPATH="$DESTDIR$(${PYTHON:-python3} -c "from distutils.sysconfig import *;print(get_python_lib(prefix='/usr'))")"
export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')" export RUBYLIB="$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorlibdir"]'):$DESTDIR/$(${RUBY:-ruby} -e 'puts RbConfig::CONFIG["vendorarchdir"]')"
# Build and analyze # Build and analyze