From 28fa671ba5c309440ba99f69b154b82d7eebe278 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sat, 28 Sep 2024 15:18:49 +0000 Subject: automatic import of lua --- lua.attr | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lua.attr (limited to 'lua.attr') diff --git a/lua.attr b/lua.attr new file mode 100644 index 0000000..a433266 --- /dev/null +++ b/lua.attr @@ -0,0 +1,19 @@ +%__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:]]+/.+ -- cgit v1.2.3