From 536b2efe4eb604493cc53b7c4617a34ac261d290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Wed, 12 Jun 2019 11:26:03 +0200 Subject: [PATCH] Move %__python definition to the srpm macros, so it is always present --- macros.python | 2 +- macros.python-srpm | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/macros.python b/macros.python index 6f81850..0e9c419 100644 --- a/macros.python +++ b/macros.python @@ -1,5 +1,5 @@ # unversioned macros: used with user defined __python, no longer part of rpm >= 4.15 -%__python %{error:attempt to use unversioned python, define %%__python to %{_bindir}/python2 or %{_bindir}/python3 explicitly} +# __python is defined to error by default in the srpm macros %python_sitelib %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib())") %python_sitearch %(%{__python} -Esc "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))") %python_version %(%{__python} -Esc "import sys; sys.stdout.write('{0.major}.{0.minor}'.format(sys.version_info))") diff --git a/macros.python-srpm b/macros.python-srpm index 514a449..f25189b 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -5,6 +5,10 @@ %__python2 /usr/bin/python2 %__python3 /usr/bin/python3 +# This now errors unless redefined to user provided value +%__python %{error:attempt to use unversioned python, define %%__python to /usr/bin/python2 or /usr/bin/python3 explicitly} + + # python3_pkgversion specifies the version of Python 3 in the distro. It can be # a specific version (e.g. 34 in Fedora EPEL7) %python3_pkgversion 3