Define %python, but make it work only if %__python is redefined
This commit is contained in:
parent
936fd1dd8c
commit
4559c0e65f
2 changed files with 14 additions and 1 deletions
|
|
@ -11,6 +11,16 @@
|
|||
%python2 %__python2
|
||||
%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\
|
||||
}
|
||||
|
||||
# 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue