lua-rpm-macros/lua.attr
Petr Šabata 119183b383 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/lua-rpm-macros#2165bb7a44bd3cd71eee2c053e38cc7482b81661
2020-10-15 18:45:25 +02:00

20 lines
713 B
Plaintext

%__lua_requires() %{lua:
-- Match buildroot paths of the form
-- /PATH/OF/BUILDROOT/usr/lib(64)/lua/MAJOR.MINOR/ and
-- /PATH/OF/BUILDROOT/usr/share/pythonMAJOR.MINOR/
-- generating a line of the form:
-- lua(abi) = MAJOR.MINOR
local path = rpm.expand('%1')
local datadir = rpm.expand('%_datadir')
local libdir = rpm.expand('%_libdir')
for i, dir in ipairs({datadir, libdir}) do
if path:match(dir .. '/lua/%d+%.%d+/.*') then
local requires = path:gsub('.*' .. dir .. '/lua/(%d+%.%d+)/.*', 'lua(abi) = %1')
print(requires)
break
end
end
}
%__lua_path ^(%{_datadir}|%{_libdir})/lua/[[:digit:]]+\\.[[:digit:]]+/.+