From 8737e1aad79b22d87749178b0649d01a0a426de9e8f714c61e2e66edccad6c72 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Fri, 11 Jun 2021 10:24:56 +0000 Subject: [PATCH] Accepting request 899419 from home:gmbr3:Lua - Add -n (name) option to %lua_provides - Use lua instead of perl for %lua_version_nodots OBS-URL: https://build.opensuse.org/request/show/899419 OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-macros?expand=0&rev=16 --- lua-macros.changes | 6 ++++++ macros.lua | 10 ++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lua-macros.changes b/lua-macros.changes index ba5dc1c..7480255 100644 --- a/lua-macros.changes +++ b/lua-macros.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Jun 10 16:58:39 UTC 2021 - Callum Farmer + +- Add -n (name) option to %lua_provides +- Use lua instead of perl for %lua_version_nodots + ------------------------------------------------------------------- Fri Apr 9 10:03:41 UTC 2021 - Callum Farmer diff --git a/macros.lua b/macros.lua index 53084ef..f71651d 100644 --- a/macros.lua +++ b/macros.lua @@ -2,7 +2,7 @@ # The major.minor version of Lua %lua_version %(lua -e 'print(_VERSION)' | cut -d ' ' -f 2) -%lua_version_nodots %(perl -e "print %{lua_version}*10") +%lua_version_nodots %(lua -e 'print(math.floor((%{lua_version}*10)))') # compiled modules should go here %lua_archdir %{_libdir}/lua/%{lua_version} @@ -15,8 +15,13 @@ # Lua default version # -e: Exclude lua prefix -%lua_provides(e) \ +# -n: Specify name +%lua_provides(en:) \ %if "%{flavor}" == "lua54" \ +%if 0%{?-n:1} \ +Provides: %{-n*} = %{version}-%{release} \ +Obsoletes: %{-n*} < %{version}-%{release} \ +%else \ %if 0%{?-e:1} \ Provides: %{mod_name} = %{version}-%{release} \ Obsoletes: %{mod_name} < %{version}-%{release} \ @@ -25,4 +30,5 @@ Provides: lua-%{mod_name} = %{version}-%{release} \ Obsoletes: lua-%{mod_name} < %{version}-%{release} \ %endif \ %endif \ +%endif \ %{nil}