diff options
| author | CoprDistGit <infra@openeuler.org> | 2024-09-28 15:18:49 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2024-09-28 15:18:49 +0000 |
| commit | 28fa671ba5c309440ba99f69b154b82d7eebe278 (patch) | |
| tree | 967ca223a79b4388bc021f074d756bcb6c051732 /lua.attr | |
| parent | 420bee8246806ff3b8267afa80720da4f8861180 (diff) | |
automatic import of lua
Diffstat (limited to 'lua.attr')
| -rw-r--r-- | lua.attr | 19 |
1 files changed, 19 insertions, 0 deletions
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:]]+/.+ |
