Accepting request 865973 from home:gmbr3:Lua

- Move tests to separate build

OBS-URL: https://build.opensuse.org/request/show/865973
OBS-URL: https://build.opensuse.org/package/show/devel:languages:lua/lua54?expand=0&rev=21
This commit is contained in:
Callum Farmer 2021-01-22 12:44:02 +00:00 committed by Git OBS Bridge
parent d8bf7fc59c
commit e83266ea25
6 changed files with 41 additions and 15 deletions

3
_multibuild Normal file
View File

@ -0,0 +1,3 @@
<multibuild>
<package>test</package>
</multibuild>

View File

@ -1,5 +1,5 @@
--- a/lua-tests/attrib.lua
+++ b/lua-tests/attrib.lua
--- a/attrib.lua
+++ b/attrib.lua
@@ -269,7 +269,7 @@ local p = "" -- On Mac OS X, redefine
local st, err, when = package.loadlib(DC"lib1", "*")
if not st then

View File

@ -1,7 +1,7 @@
Index: lua/lua-tests/files.lua
Index: lua/files.lua
===================================================================
--- lua.orig/lua-tests/files.lua
+++ lua/lua-tests/files.lua
--- lua.orig/files.lua
+++ lua/files.lua
@@ -81,7 +81,7 @@ assert(io.output() ~= io.stdout)
if not _port then -- invalid seek

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jan 22 12:38:04 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Move tests to separate build
-------------------------------------------------------------------
Sat Dec 5 12:48:18 UTC 2020 - Callum Farmer <gmbr3@opensuse.org>

View File

@ -15,10 +15,15 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define name_ext -test
%else
%define name_ext %{nil}
%endif
%define major_version 5.4
%define libname liblua5_4-5
Name: lua54
Name: lua54%{name_ext}
Version: 5.4.2
Release: 0
Summary: Small Embeddable Language with Procedural Syntax
@ -37,10 +42,14 @@ Patch2: files_test.patch
Patch3: main_test.patch
# PATCH-FIX-UPSTREAM https://www.lua.org/bugs.html#5.4.2
#Patch4: upstream-bugs.patch
%if "%{flavor}" == "test"
BuildRequires: lua54
%else
BuildRequires: libtool
BuildRequires: lua-macros
BuildRequires: pkgconfig
BuildRequires: readline-devel
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
Provides: lua = %{version}
@ -123,11 +132,18 @@ scripting, and rapid prototyping. Lua is implemented as a small library
of C functions, written in ANSI C.
%prep
%setup -q -n lua-%{version} -a1
mv lua-%{version}-tests lua-tests
%autopatch -p1
%if "%{flavor}" == "test"
%setup -T -q -b1 -n lua-%{version}-tests
%patch1 -p1
%patch2 -p1
%patch3 -p1
%else
%setup -q -n lua-%{version}
%patch0 -p1
%endif
# manpage
%if "%{flavor}" != "test"
cat doc/lua.1 | sed 's/TH LUA 1/TH LUA%{major_version} 1/' > doc/lua%{major_version}.1
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1
@ -185,11 +201,12 @@ touch %{buildroot}%{_sysconfdir}/alternatives/liblua.so
ln -sf %{_sysconfdir}/alternatives/liblua.so %{buildroot}%{_libdir}/liblua.so
touch %{buildroot}%{_sysconfdir}/alternatives/lua.pc
ln -sf %{_sysconfdir}/alternatives/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
%else
%check
cd ./lua-tests/
LD_LIBRARY_PATH=%{buildroot}%{_libdir} %{buildroot}%{_bindir}/lua%{major_version} all.lua
LD_LIBRARY_PATH=%{_libdir} %{_bindir}/lua%{major_version} all.lua
%endif
%if "%{flavor}" != "test"
%post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig
@ -258,4 +275,5 @@ fi
%files doc
%doc doc/*
%endif
%changelog

View File

@ -1,5 +1,5 @@
--- a/lua-tests/main.lua
+++ b/lua-tests/main.lua
--- a/main.lua
+++ b/main.lua
@@ -307,11 +307,11 @@
]]
RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out)