From 6e7d7d058fabe7a87a7d0775b7affde240ffd6983b3632535beb5ff5083018ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Wed, 15 Oct 2025 01:16:16 +0200 Subject: [PATCH] Fix %luarocks_* macros. --- lua-macros.changes | 5 +++++ macros.lua | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lua-macros.changes b/lua-macros.changes index 048b9fa..ad782d3 100644 --- a/lua-macros.changes +++ b/lua-macros.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Oct 14 23:16:09 UTC 2025 - Matej Cepl + +- Fix %luarocks_* macros. + ------------------------------------------------------------------- Mon Oct 13 20:24:01 UTC 2025 - Matej Cepl diff --git a/macros.lua b/macros.lua index 71a71d9..bef1151 100644 --- a/macros.lua +++ b/macros.lua @@ -89,11 +89,15 @@ Obsoletes: lua-%{mod_name} < %{version}-%{release} %endif ]]) } + # LuaRocks %luarocks_build \ -luarocks --lua-version "%{lua_version}" \\\ -make --deps-mode none -%luarocks_install \ -luarocks --lua-version="%{lua_version}" --tree="%{buildroot}%{_prefix}" \\\ -install --deps-mode=none --no-manifest +luarocks --lua-version "%{lua_version}" make --deps-mode none --pack-binary-rock + %luarocks_treedir %{_prefix}/lib/luarocks/rocks-%{lua_version} + +%luarocks_install \ + /bin/sh -c 'luarocks --lua-version="%{lua_version}" --tree="%{buildroot}%{_prefix}" install --deps-mode=none --no-manifest "$@" && \ + source_dir="%{buildroot}%{luarocks_treedir}/%{mod_name}/%{rock_version}" && \ + [ -d "${source_dir}" ] && [ "$(ls -A "${source_dir}" | wc -l)" -gt 0 ] && \ + mv -v "${source_dir}" __rocktree' --