forked from lua/lua-macros
Compare commits
8 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
|
bb5f958d9b
|
|||
|
af1439d522
|
|||
|
ac17f4cf3e
|
|||
|
e5f755e16c
|
|||
|
7d61c4bc5b
|
|||
|
801cef32c6
|
|||
|
095740495a
|
|||
|
a281d195cb
|
@@ -1,3 +1,35 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Feb 28 01:36:22 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Don't double escape, just once is enough.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Feb 27 07:46:29 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Define %alternatives_requires_exclude macro.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Feb 26 01:34:55 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Macro lua_exec for testing
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 25 22:27:05 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- %lua_value should return just a replaced string, not a tuple
|
||||
like :gsub() method does.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jan 29 20:20:41 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
- Add %lua_value macro, useful for alternatives.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Nov 6 19:08:52 UTC 2025 - Michal Suchanek <msuchanek@suse.de>
|
||||
|
||||
- macros.lua: Fix parsing on older SLE releases. Older RPM
|
||||
versions don't like blank lines in lua macros.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 3 00:20:49 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
|
||||
|
||||
|
||||
29
macros.lua
29
macros.lua
@@ -13,6 +13,16 @@ print(ver)
|
||||
local nodots = ver:gsub("%.", "")
|
||||
print(nodots)
|
||||
}
|
||||
|
||||
%lua_value %{lua:
|
||||
local flavor = rpm.expand("%{flavor}")
|
||||
if flavor == "luajit" then
|
||||
print("52")
|
||||
else
|
||||
print((flavor:gsub("lua", "")))
|
||||
end
|
||||
}
|
||||
|
||||
# compiled modules should go here
|
||||
%lua_archdir %{lua:
|
||||
local handle = io.popen("pkgconf --variable=INSTALL_CMOD lua 2>/dev/null")
|
||||
@@ -21,6 +31,7 @@ print(ver)
|
||||
result = result:gsub("^%s*(.-)%s*$", "%1")
|
||||
print(result)
|
||||
}
|
||||
|
||||
# pure Lua modules should go here
|
||||
%lua_noarchdir %{lua:
|
||||
local output = ""
|
||||
@@ -35,6 +46,7 @@ if output:len() > 0 then
|
||||
end
|
||||
print(rpm.expand("%{_datadir}/lua/%{lua_version}"))
|
||||
}
|
||||
|
||||
# lua includes folder
|
||||
%lua_incdir %{lua:
|
||||
local handle = io.popen("pkgconf --variable=includedir lua 2>/dev/null")
|
||||
@@ -43,6 +55,7 @@ print(rpm.expand("%{_datadir}/lua/%{lua_version}"))
|
||||
result = result:gsub("^%s*(.-)%s*$", "%1")
|
||||
print(result)
|
||||
}
|
||||
|
||||
%lua_version_default %{lua:
|
||||
local result = "5.4"
|
||||
local ver = rpm.expand("%{?suse_version}")
|
||||
@@ -56,12 +69,23 @@ if #ver > 0 then
|
||||
end
|
||||
print(result)
|
||||
}
|
||||
|
||||
# Define a conditional that evaluates true when building for the default Lua version
|
||||
%lua_version_default_nodots %{lua:
|
||||
local ver = rpm.expand("%{lua_version_default}")
|
||||
local nodots = ver:gsub("%.", "")
|
||||
print(nodots)
|
||||
}
|
||||
|
||||
%lua_exec %{lua:
|
||||
local flavor = rpm.expand("%{flavor}")
|
||||
if flavor == "luajit" then
|
||||
print("luajit")
|
||||
else
|
||||
print("lua" .. rpm.expand("%{lua_version}"))
|
||||
end
|
||||
}
|
||||
|
||||
# Lua default version
|
||||
# This REQUIRES macro %%{mod_name} to be defined.
|
||||
# -e: Exclude lua prefix
|
||||
@@ -72,6 +96,7 @@ if mod_name == "" or mod_name == "%{?mod_name}" then
|
||||
print("-- Error: %%{mod_name} is not defined!")
|
||||
return
|
||||
end
|
||||
|
||||
--
|
||||
local lua_ver_nodots = rpm.expand("%{lua_version_nodots}")
|
||||
local lua_ver_default_nodots = rpm.expand("%{lua_version_default_nodots}")
|
||||
@@ -106,3 +131,7 @@ luarocks --lua-version "%{lua_version}" make --deps-mode none --pack-binary-rock
|
||||
|
||||
%luarocks_install \
|
||||
%{_rpmconfigdir}/install-lua-rock.sh "%{lua_version}" "%{buildroot}%{_prefix}" "%{buildroot}%{luarocks_treedir}/%{mod_name}"
|
||||
|
||||
%alternatives_requires_exclude() %{global __requires_exclude ^/usr/bin/lua(5\\.[1-9]|jit)?$}
|
||||
|
||||
# vi: ft=spec
|
||||
|
||||
Reference in New Issue
Block a user