You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
713 B
19 lines
713 B
%__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:]]+/.+
|
|
|