3
0
forked from pool/lua-macros

Accepting request 1039122 from devel:languages:lua

OBS-URL: https://build.opensuse.org/request/show/1039122
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-macros?expand=0&rev=9
This commit is contained in:
Dominique Leuenberger 2022-11-30 13:59:24 +00:00 committed by Git OBS Bridge
commit d00296369e
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> 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 # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -15,6 +15,7 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/ # Please submit bugfixes or comments via https://bugs.opensuse.org/
# #
%if %{undefined _rpmmacrodir} %if %{undefined _rpmmacrodir}
%define _rpmmacrodir %{_rpmconfigdir}/macros.d %define _rpmmacrodir %{_rpmconfigdir}/macros.d
%endif %endif
@ -26,7 +27,10 @@ License: MIT
Group: Development/Languages/Other Group: Development/Languages/Other
URL: https://www.lua.org URL: https://www.lua.org
Source0: macros.lua Source0: macros.lua
%if 0%{?suse_version} >= 1500
# on SLE 12 lua is lua5.2 unconditionally, avoid
Requires: lua Requires: lua
%endif
BuildArch: noarch BuildArch: noarch
%description %description

View File

@ -13,7 +13,19 @@
# lua includes folder # lua includes folder
%lua_incdir %{_includedir}/lua%{lua_version} %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}", "%.", "")))') %lua_version_default_nodots %(lua -e 'print((string.gsub("%{lua_version_default}", "%.", "")))')
%ifluadefault \ %ifluadefault \