diff --git a/macros.python-srpm b/macros.python-srpm index 78bde41..9fa4f06 100644 --- a/macros.python-srpm +++ b/macros.python-srpm @@ -15,6 +15,15 @@ # See the comments in https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/22 %__python /usr/bin/python +# Users can use %%python only if they redefined %%__python (e.g. to %%__python3) +%python() %{lua:\ + __python = rpm.expand("%__python")\ + if __python == "/usr/bin/python" then\ + rpm.expand("%{error:Cannot use %%python if %%__python wasn't redefined to something other than /usr/bin/python.}")\ + else\ + print(__python)\ + end\ +} # python3_pkgversion specifies the version of Python 3 in the distro. It can be # a specific version (e.g. 34 in Fedora EPEL7) diff --git a/python-rpm-macros.spec b/python-rpm-macros.spec index 2ad43ea..3506e56 100644 --- a/python-rpm-macros.spec +++ b/python-rpm-macros.spec @@ -1,6 +1,6 @@ Name: python-rpm-macros Version: 3 -Release: 50%{?dist} +Release: 51%{?dist} Summary: The unversioned Python RPM macros # macros: MIT, compileall2.py: PSFv2 @@ -78,6 +78,9 @@ install -m 644 %{SOURCE5} \ %changelog +* Sat Dec 28 2019 Miro Hrončok - 3-51 +- Define %%python, but make it work only if %%__python is redefined + * Tue Nov 26 2019 Lumír Balhar - 3-50 - Update of bundled compileall2 module