Define %python, but make it work only if %__python is redefined

epel9
Miro Hrončok 5 years ago
parent 7d7c796f7b
commit db76dd30b6

@ -1,6 +1,6 @@
Name: epel-rpm-macros Name: epel-rpm-macros
Version: 8 Version: 8
Release: 9 Release: 10
Summary: Extra Packages for Enterprise Linux RPM macros Summary: Extra Packages for Enterprise Linux RPM macros
Group: System Environment/Base Group: System Environment/Base
@ -58,6 +58,9 @@ install -Dpm 644 %{SOURCE3} \
%changelog %changelog
* Tue Apr 14 2020 Miro Hrončok <mhroncok@redhat.com> - 8-10
- Define %%python, but make it work only if %%__python is redefined
* Fri Apr 03 2020 Troy Dawson <tdawson@redhat.com> - 8-9 * Fri Apr 03 2020 Troy Dawson <tdawson@redhat.com> - 8-9
- Add %qt5_qtwebengine_arches to macros - Add %qt5_qtwebengine_arches to macros

@ -20,6 +20,16 @@
%python2 %__python2 %python2 %__python2
%python3 %__python3 %python3 %__python3
# 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\
}
# gpgverify verifies signed sources. There is documentation in the script. # gpgverify verifies signed sources. There is documentation in the script.
%gpgverify %{_rpmconfigdir}/gpgverify %gpgverify %{_rpmconfigdir}/gpgverify

Loading…
Cancel
Save