forked from pool/lua-macros
Compare commits
2 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
d1f0f1035b
|
|||
|
60b20c88fb
|
15
install-lua-rock.sh
Executable file
15
install-lua-rock.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
set -ex
|
||||
|
||||
# 1. %{lua_version}
|
||||
# 2. %{buildroot}%{_prefix}
|
||||
# 3. %{buildroot}%{luarocks_treedir}/%{mod_name}
|
||||
|
||||
SOURCE_DIR="$3"
|
||||
luarocks --lua-version="$1" --tree="$2" install --deps-mode=none --no-manifest "${*:$#}"
|
||||
|
||||
if [ -d "${SOURCE_DIR}" ] && [ "$(find "${SOURCE_DIR}" -type f | wc -l)" -gt 0 ]
|
||||
then
|
||||
mkdir -p __rocktree
|
||||
mv -v "${SOURCE_DIR}"/*/* __rocktree
|
||||
fi
|
||||
@@ -1,3 +1,9 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Oct 20 21:30:36 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Rewrite %luarocks_install to use a shell script
|
||||
install-lua-rock.sh, which is packaged as well.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Tue Oct 14 23:16:09 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ License: MIT
|
||||
Group: Development/Languages/Other
|
||||
URL: https://www.lua.org
|
||||
Source0: macros.lua
|
||||
Source1: install-lua-rock.sh
|
||||
%if 0%{?suse_version} > 1600
|
||||
Requires: lua-interpreter
|
||||
%elif 0%{?suse_version} >= 1500
|
||||
@@ -46,9 +47,11 @@ cp -p %{SOURCE0} .
|
||||
:
|
||||
|
||||
%install
|
||||
install -Dm644 macros.lua %{buildroot}%{_rpmmacrodir}/macros.lua
|
||||
install -Dm644 %{SOURCE0} %{buildroot}%{_rpmmacrodir}/macros.lua
|
||||
install -Dm755 %{SOURCE1} %{buildroot}%{_rpmconfigdir}/install-lua-rock.sh
|
||||
|
||||
%files
|
||||
%{_rpmmacrodir}/macros.lua
|
||||
%{_rpmconfigdir}/install-lua-rock.sh
|
||||
|
||||
%changelog
|
||||
|
||||
@@ -97,7 +97,4 @@ 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' --
|
||||
%{_rpmconfigdir}/install-lua-rock.sh "%{lua_version}" "%{buildroot}%{_prefix}" "%{buildroot}%{luarocks_treedir}/%{mod_name}"
|
||||
|
||||
Reference in New Issue
Block a user