2020-04-01 11:54:32 +00:00
|
|
|
%__python_provides() %{lua:
|
|
|
|
-- Match buildroot/payload paths of the form
|
|
|
|
-- /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
|
|
|
|
-- generating a line of the form
|
|
|
|
-- python(abi) = MAJOR.MINOR
|
|
|
|
-- (Don't match against -config tools e.g. /usr/bin/python2.6-config)
|
|
|
|
local path = rpm.expand('%1')
|
|
|
|
if path:match('/usr/bin/python%d+%.%d+$') then
|
2020-04-28 12:47:32 +00:00
|
|
|
local provides = path:gsub('.*/usr/bin/python(%d+%.%d+)', 'python(abi) = %1')
|
2020-04-01 11:54:32 +00:00
|
|
|
print(provides)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
|
|
|
%__python_requires() %{lua:
|
|
|
|
-- Match buildroot paths of the form
|
|
|
|
-- /PATH/OF/BUILDROOT/usr/lib/pythonMAJOR.MINOR/ and
|
|
|
|
-- /PATH/OF/BUILDROOT/usr/lib64/pythonMAJOR.MINOR/
|
|
|
|
-- generating a line of the form:
|
|
|
|
-- python(abi) = MAJOR.MINOR
|
|
|
|
local path = rpm.expand('%1')
|
|
|
|
if path:match('/usr/lib%d*/python%d+%.%d+/.*') then
|
2020-04-28 12:47:32 +00:00
|
|
|
local requires = path:gsub('.*/usr/lib%d*/python(%d+%.%d+)/.*', 'python(abi) = %1')
|
2020-04-01 11:54:32 +00:00
|
|
|
print(requires)
|
|
|
|
end
|
|
|
|
}
|
|
|
|
|
2020-04-07 12:41:51 +00:00
|
|
|
%__python_path ^((%{_prefix}/lib(64)?/python[[:digit:]]+\\.[[:digit:]]+/.*\\.(py[oc]?|so))|(%{_bindir}/python[[:digit:]]+\\.[[:digit:]]+))$
|
2020-04-01 13:57:00 +00:00
|
|
|
%__python_magic [Pp]ython.*(executable|byte-compiled)
|