3
0
forked from pool/lua-macros

Accepting request 1038260 from Kernel:tools

- Make macros usable with older releases (boo#1205611).

OBS-URL: https://build.opensuse.org/request/show/1038260
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua-macros?expand=0&rev=24
This commit is contained in:
Matej Cepl 2022-11-30 13:46:45 +00:00 committed by Git OBS Bridge
parent 21b379c736
commit f8ba8ced93
3 changed files with 23 additions and 2 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Nov 25 19:15:41 UTC 2022 - Michal Suchanek <msuchanek@suse.com>
- Make macros usable with older releases (boo#1205611).
-------------------------------------------------------------------
Fri Sep 2 15:13:06 UTC 2022 - Callum Farmer <gmbr3@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package lua-macros
#
# Copyright (c) 2020 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,6 +15,7 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if %{undefined _rpmmacrodir}
%define _rpmmacrodir %{_rpmconfigdir}/macros.d
%endif
@ -26,7 +27,10 @@ License: MIT
Group: Development/Languages/Other
URL: https://www.lua.org
Source0: macros.lua
%if 0%{?suse_version} >= 1500
# on SLE 12 lua is lua5.2 unconditionally, avoid
Requires: lua
%endif
BuildArch: noarch
%description

View File

@ -13,7 +13,19 @@
# lua includes folder
%lua_incdir %{_includedir}/lua%{lua_version}
%lua_version_default 5.4
%lua_version_default %{lua:
local result = 5.4
local ver = rpm.expand("%{?suse_version}")
if #ver > 0 then
ver = tonumber(ver)
if ver < 1500 then
result = 5.1
elseif ver == 1500 then
result = 5.3
end
end
print(result)
}
%lua_version_default_nodots %(lua -e 'print((string.gsub("%{lua_version_default}", "%.", "")))')
%ifluadefault \