From: Michael Tremer Date: Thu, 8 Dec 2022 15:12:50 +0000 (+0000) Subject: macros: Call better things for Python 3 X-Git-Tag: 0.9.28~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08e5e9940923f69354dab94f3dd71b1f3ed6723e;p=pakfire.git macros: Call better things for Python 3 Signed-off-by: Michael Tremer --- diff --git a/macros/python.macro b/macros/python.macro index 15c1209ec..19e6067ae 100644 --- a/macros/python.macro +++ b/macros/python.macro @@ -1,13 +1,9 @@ -# A bunch of predefined things for Python. -python_bytecompile_script = /usr/lib/pakfire/py-compile - -# Python 3 constants. +# Python 3 constants python3 = /usr/bin/python3 -python3_bytecompile = %{python_bytecompile_script} --python=%{python3} -python3_sitearch = %(%{python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") -python3_sitelib = %(%{python3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())") -python3_version = %(%{python3} -c "import sys; sys.stdout.write(sys.version[:3])") +python3_sitearch = %(%{python3} -c "import sysconfig; print(sysconfig.get_path('platlib', vars={'platbase': '%{prefix}', 'base': '%{prefix}'}))") +python3_sitelib = %(%{python3} -c "import sysconfig; print(sysconfig.get_path('purelib', vars={'platbase': '%{prefix}', 'base': '%{prefix}'}))") +python3_version = %(%{python3} -c "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))" 2>&1) # Python 2 constants. python = /usr/bin/python2