forked from rpms/python-rpm-macros
Implement %py_provides
This commit is contained in:
parent
125134cf84
commit
8fea79b1ec
@ -137,3 +137,24 @@
|
||||
\
|
||||
print(url .. first .. '/' .. src .. '/' .. src .. '-' .. ver .. '.' .. ext)
|
||||
}
|
||||
|
||||
%py_provides() %{lua:
|
||||
local python = require 'fedora.srpm.python'
|
||||
local name = rpm.expand('%1')
|
||||
if name == '%1' then
|
||||
rpm.expand('%{error:%%py_provides requires at least 1 argument, the name to provide}')
|
||||
end
|
||||
local evr = rpm.expand('%2')
|
||||
if evr == '%2' then
|
||||
evr = rpm.expand('%{?epoch:%{epoch}:}%{version}-%{release}')
|
||||
end
|
||||
print('Provides: ' .. name .. ' = ' .. evr .. '\\n')
|
||||
local provides = python.python_altprovides_once(name, evr)
|
||||
-- provides is either an array/table or nil
|
||||
-- nil means the function was already called with the same arguments
|
||||
if provides then
|
||||
for i, provide in ipairs(provides) do
|
||||
print('Provides: ' .. provide .. '\\n')
|
||||
end
|
||||
end
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
Name: python-rpm-macros
|
||||
Version: 3.8
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Summary: The common Python RPM macros
|
||||
|
||||
# macros and lua: MIT, compileall2.py: PSFv2
|
||||
@ -107,6 +107,9 @@ install -m 644 compileall2.py %{buildroot}%{_rpmconfigdir}/redhat/
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue May 05 2020 Miro Hrončok <mhroncok@redhat.com> - 3.8-5
|
||||
- Implement %%py_provides
|
||||
|
||||
* Mon May 04 2020 Tomas Hrnciar <thrnciar@redhat.com> - 3.8-4
|
||||
- Make %%py3_install_wheel macro remove direct_url.json file created by PEP 610.
|
||||
- https://discuss.python.org/t/pep-610-usage-guidelines-for-linux-distributions/4012
|
||||
|
Loading…
Reference in New Issue
Block a user