]> git.ipfire.org Git - pakfire.git/commitdiff
macros: Call better things for Python 3
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 15:12:50 +0000 (15:12 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 8 Dec 2022 15:12:50 +0000 (15:12 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
macros/python.macro

index 15c1209eceded2ef65093fcc4ee643fae0514c6b..19e6067aed042d8eb9e9f8de1a9e90a075d12912 100644 (file)
@@ -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