3 Commits

6 changed files with 106 additions and 193 deletions

3
.gitattributes vendored
View File

@@ -1,4 +1,4 @@
## Default LFS *.changes merge=merge-changes
*.7z filter=lfs diff=lfs merge=lfs -text *.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text *.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text *.bz2 filter=lfs diff=lfs merge=lfs -text
@@ -12,6 +12,7 @@
*.pdf filter=lfs diff=lfs merge=lfs -text *.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text *.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text *.rpm filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text *.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text *.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text *.tgz filter=lfs diff=lfs merge=lfs -text

4
.gitignore vendored
View File

@@ -1,5 +1 @@
.osc .osc
_scmsync.obsinfo
_buildconfig-*
_buildinfo-*.xml
lua51-*-build/

View File

@@ -3,16 +3,14 @@ Date: Sun, 1 Mar 2015 16:13:52 +0100
Subject: build system Subject: build system
--- ---
Makefile | 26 +++++++++++++++----------- Makefile | 25 ++++++++++++++-----------
src/Makefile | 28 ++++++++++++++++------------ src/Makefile | 31 +++++++++++++++++++------------
src/luaconf.h | 8 ++++++-- 2 files changed, 33 insertions(+), 23 deletions(-)
testes/libs/makefile | 11 +++++++----
4 files changed, 44 insertions(+), 29 deletions(-)
Index: lua-5.1.5/Makefile Index: lua-5.1.5/Makefile
=================================================================== ===================================================================
--- lua-5.1.5.orig/Makefile 2012-02-10 10:50:23.000000000 +0100 --- lua-5.1.5.orig/Makefile
+++ lua-5.1.5/Makefile 2025-07-19 17:02:14.322726003 +0200 +++ lua-5.1.5/Makefile
@@ -2,6 +2,8 @@ @@ -2,6 +2,8 @@
# see INSTALL for installation instructions # see INSTALL for installation instructions
# see src/Makefile and src/luaconf.h for further customization # see src/Makefile and src/luaconf.h for further customization
@@ -22,7 +20,7 @@ Index: lua-5.1.5/Makefile
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values. # Your platform. See PLATS for possible values.
@@ -9,22 +11,23 @@ @@ -9,22 +11,23 @@ PLAT= none
# Where to install. The installation starts in the src and doc directories, # Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path. # so take care if INSTALL_TOP is not an absolute path.
@@ -50,7 +48,7 @@ Index: lua-5.1.5/Makefile
# #
# If you don't have install you can use cp instead. # If you don't have install you can use cp instead.
# INSTALL= cp -p # INSTALL= cp -p
@@ -41,10 +44,10 @@ @@ -41,10 +44,10 @@ RANLIB= ranlib
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install. # What to install.
@@ -64,7 +62,7 @@ Index: lua-5.1.5/Makefile
# Lua version and release. # Lua version and release.
V= 5.1 V= 5.1
@@ -53,16 +56,17 @@ @@ -53,16 +56,16 @@ R= 5.1.5
all: $(PLAT) all: $(PLAT)
$(PLATS) clean: $(PLATS) clean:
@@ -77,20 +75,18 @@ Index: lua-5.1.5/Makefile
install: dummy install: dummy
cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD) cd src && $(MKDIR) $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) $(INSTALL_LMOD) $(INSTALL_CMOD)
- cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN) cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
+ cd src && $(LIBTOOL) --mode=install $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC) cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB) - cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB) + cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB)
+ rm -f $(INSTALL_LIB)/liblua$(V).a
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN) cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
ranlib: ranlib:
Index: lua-5.1.5/src/Makefile Index: lua-5.1.5/src/Makefile
=================================================================== ===================================================================
--- lua-5.1.5.orig/src/Makefile 2012-02-13 21:41:22.000000000 +0100 --- lua-5.1.5.orig/src/Makefile
+++ lua-5.1.5/src/Makefile 2025-07-19 17:02:14.323016861 +0200 +++ lua-5.1.5/src/Makefile
@@ -8,32 +8,37 @@ @@ -8,7 +8,7 @@
PLAT= none PLAT= none
CC= gcc CC= gcc
@@ -99,8 +95,7 @@ Index: lua-5.1.5/src/Makefile
AR= ar rcu AR= ar rcu
RANLIB= ranlib RANLIB= ranlib
RM= rm -f RM= rm -f
LIBS= -lm $(MYLIBS) @@ -16,24 +16,28 @@ LIBS= -lm $(MYLIBS)
+LIBDIR=/usr/lib
MYCFLAGS= MYCFLAGS=
MYLDFLAGS= MYLDFLAGS=
@@ -115,7 +110,7 @@ Index: lua-5.1.5/src/Makefile
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a -LUA_A= liblua.a
+LUA_A= liblua$(V).la +LUA_A= liblua$(V).a
CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \ CORE_O= lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o \
lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \ lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o \
- lundump.o lvm.o lzio.o - lundump.o lvm.o lzio.o
@@ -135,29 +130,28 @@ Index: lua-5.1.5/src/Makefile
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O) ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
@@ -48,14 +53,13 @@ @@ -48,14 +52,13 @@ o: $(ALL_O)
a: $(ALL_A) a: $(ALL_A)
$(LUA_A): $(CORE_O) $(LIB_O) $(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files - $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
- $(RANLIB) $@ - $(RANLIB) $@
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath $(LIBDIR) -version-info 6:0:1 -o $(LUA_A) + $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath /usr/lib -version-info 6:0:1 -o liblua$(V).la
$(LUA_T): $(LUA_O) $(LUA_A) $(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS) - $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) $(LUA_A) -Wl,-E lua.lo -o $@ + $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) -static liblua$(V).la -Wl,-E lua.lo -o $@
-$(LUAC_T): $(LUAC_O) $(LUA_A) $(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS) - $(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUAC_T): $(LUAC_O) $(BASE_O) + $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -static liblua$(V).la luac.lo -o $@
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(BASE_O:.o=.lo) $(LIBS)
clean: clean:
$(RM) $(ALL_T) $(ALL_O) $(RM) $(ALL_T) $(ALL_O)
Index: lua-5.1.5/src/luaconf.h Index: lua-5.1.5/src/luaconf.h
=================================================================== ===================================================================
--- lua-5.1.5.orig/src/luaconf.h 2008-02-11 17:25:08.000000000 +0100 --- lua-5.1.5.orig/src/luaconf.h
+++ lua-5.1.5/src/luaconf.h 2025-07-19 17:02:14.323256121 +0200 +++ lua-5.1.5/src/luaconf.h
@@ -95,13 +95,17 @@ @@ -95,13 +95,17 @@
#else #else
@@ -178,31 +172,3 @@ Index: lua-5.1.5/src/luaconf.h
#endif #endif
Index: lua-5.1.5/testes/libs/makefile
===================================================================
--- lua-5.1.5.orig/testes/libs/makefile 2016-01-18 16:32:17.000000000 +0100
+++ lua-5.1.5/testes/libs/makefile 2025-07-19 19:41:44.657503160 +0200
@@ -1,16 +1,19 @@
+CFLAGS ?= -Wall -O2 -ansi -fPIC
+CC = gcc
+
all: lib1.so lib11.so lib2.so lib21.so -lib2.so
lib1.so: lib1.c
- gcc -Wall -O2 -I../../ -ansi -shared -o lib1.so lib1.c
+ $(CC) $(CFLAGS) -shared -o lib1.so lib1.c
lib11.so: lib11.c
- gcc -Wall -O2 -I../../ -ansi -shared -o lib11.so lib11.c
+ $(CC) $(CFLAGS) -shared -o lib11.so lib11.c
lib2.so: lib2.c
- gcc -Wall -O2 -I../../ -ansi -shared -o lib2.so lib2.c
+ $(CC) $(CFLAGS) -shared -o lib2.so lib2.c
lib21.so: lib21.c
- gcc -Wall -O2 -I../../ -ansi -shared -o lib21.so lib21.c
+ $(CC) $(CFLAGS) -shared -o lib21.so lib21.c
-lib2.so: lib2.so
cp lib2.so ./-lib2.so

Binary file not shown.

View File

@@ -1,16 +1,13 @@
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Aug 5 07:21:48 UTC 2025 - Matej Cepl <mcepl@cepl.eu> Fri Feb 19 16:42:08 UTC 2021 - Victor Zhestkov <victor.zhestkov@suse.com>
- interpreter should only provide, not conflict lua symbol - Using right path for update-alternatives for Debian and Ubuntu
(bsc#1247521) - Requirement alignments for Debian and Ubuntu
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Jul 19 09:23:33 UTC 2025 - Matej Cepl <mcepl@cepl.eu> Fri Feb 19 11:38:37 UTC 2021 - Victor Zhestkov <victor.zhestkov@suse.com>
- Switch from update-alternatives to libalternatives (and - Add missing libncurses5 devel build requires for Ubuntu and Debian
dependency on lua-interpreter)
- improve .gitignore and overall improve the packaging.
- this package also provides devel symlink directly and conflicts other -devel packages
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Aug 2 08:12:52 UTC 2019 - Martin Liška <mliska@suse.cz> Fri Aug 2 08:12:52 UTC 2019 - Martin Liška <mliska@suse.cz>
@@ -78,27 +75,27 @@ Thu May 1 06:59:04 UTC 2014 - mailaender@opensuse.org
Mon Apr 14 06:56:18 UTC 2014 - pgajdos@suse.com Mon Apr 14 06:56:18 UTC 2014 - pgajdos@suse.com
- revert last change: breaks builds of dependent packages. - revert last change: breaks builds of dependent packages.
They include lua51-devel and expects rpm macros to be available. They include lua51-devel and expects rpm macros to be available.
rpm macros use the interpreter. rpm macros use the interpreter.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 18 10:06:55 UTC 2014 - Rene.vanPaassen@gmail.com Tue Mar 18 10:06:55 UTC 2014 - Rene.vanPaassen@gmail.com
- correct dependency of lua51-devel, to be on the lib package, not - correct dependency of lua51-devel, to be on the lib package, not
on the interpreter binary on the interpreter binary
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Oct 22 12:24:49 UTC 2013 - peter.trommler@ohm-hochschule.de Tue Oct 22 12:24:49 UTC 2013 - peter.trommler@ohm-hochschule.de
- fix patch lua51-5.1.5-pkgconfig.patch - fix patch lua51-5.1.5-pkgconfig.patch
* libdl is required not librt * libdl is required not librt
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Oct 21 18:19:08 UTC 2013 - peter.trommler@ohm-hochschule.de Mon Oct 21 18:19:08 UTC 2013 - peter.trommler@ohm-hochschule.de
- refresh patch lua51-5.1.5-module-path.diff - refresh patch lua51-5.1.5-module-path.diff
- new patch lua51-5.1.5-pkgconfig.patch - new patch lua51-5.1.5-pkgconfig.patch
* fix libraries in pkgconfig file * fix libraries in pkgconfig file
------------------------------------------------------------------- -------------------------------------------------------------------
Thu May 16 07:19:10 UTC 2013 - pgajdos@suse.com Thu May 16 07:19:10 UTC 2013 - pgajdos@suse.com
@@ -109,7 +106,7 @@ Thu May 16 07:19:10 UTC 2013 - pgajdos@suse.com
------------------------------------------------------------------- -------------------------------------------------------------------
Sun May 5 21:47:35 UTC 2013 - mrdocs@opensuse.org Sun May 5 21:47:35 UTC 2013 - mrdocs@opensuse.org
- move the lua rpm macros to the devel package to avoid conflict - move the lua rpm macros to the devel package to avoid conflict
with lua 5.2 with lua 5.2
------------------------------------------------------------------- -------------------------------------------------------------------
@@ -129,7 +126,7 @@ Mon Jun 18 12:59:24 UTC 2012 - pgajdos@suse.com
------------------------------------------------------------------- -------------------------------------------------------------------
Sat Mar 31 07:51:59 UTC 2012 - joop.boonen@opensuse.org Sat Mar 31 07:51:59 UTC 2012 - joop.boonen@opensuse.org
- Correction in Provides and Obsolete for lua-libs - Correction in Provides and Obsolete for lua-libs
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Feb 13 10:49:58 UTC 2012 - coolo@suse.com Mon Feb 13 10:49:58 UTC 2012 - coolo@suse.com
@@ -224,18 +221,18 @@ Tue Feb 19 10:37:22 CET 2008 - pgajdos@suse.cz
- created -doc package - created -doc package
- updated to version 5.1.3, bug fix release. Fixed bugs: - updated to version 5.1.3, bug fix release. Fixed bugs:
* wrong error message in some concatenations * wrong error message in some concatenations
* too many variables in an assignment may cause a C stack * too many variables in an assignment may cause a C stack
overflow overflow
* an error in a module loaded through the '-l' option shows no * an error in a module loaded through the '-l' option shows no
traceback traceback
* gsub may go wild when wrongly called without its third * gsub may go wild when wrongly called without its third
argument and with a large subject argument and with a large subject
* table.remove removes last element of a table when given * table.remove removes last element of a table when given
an out-of-bound index an out-of-bound index
* lua_setfenv may crash if called over an invalid object * lua_setfenv may crash if called over an invalid object
* stand-alone interpreter shows incorrect error message when * stand-alone interpreter shows incorrect error message when
the "message" is a coroutine. the "message" is a coroutine.
* debug.sethook/gethook may overflow the thread's stack * debug.sethook/gethook may overflow the thread's stack
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Jul 24 14:31:30 CEST 2007 - pgajdos@suse.cz Tue Jul 24 14:31:30 CEST 2007 - pgajdos@suse.cz

View File

@@ -1,7 +1,7 @@
# #
# spec file for package lua51 # spec file for package lua51
# #
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (c) 2021 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
@@ -18,10 +18,10 @@
%define major_version 5.1 %define major_version 5.1
%define libname liblua5_1-5 %define libname liblua5_1-5
%if 0%{?suse_version} > 1500 %if "%{_vendor}" == "debbuild"
%bcond_without libalternatives %define _upd_alt_dir %{_bindir}
%else %else
%bcond_with libalternatives %define _upd_alt_dir %{_sbindir}
%endif %endif
Name: lua51 Name: lua51
Version: 5.1.5 Version: 5.1.5
@@ -29,29 +29,28 @@ Release: 0
Summary: Small Embeddable Language with Procedural Syntax Summary: Small Embeddable Language with Procedural Syntax
License: MIT License: MIT
Group: Development/Languages/Other Group: Development/Languages/Other
URL: https://www.lua.org URL: http://www.lua.org
Source0: https://www.lua.org/ftp/lua-%{version}.tar.gz Source: http://www.lua.org/ftp/lua-%{version}.tar.gz
Source1: https://www.lua.org/tests/lua%{major_version}-tests.tar.gz
Source99: baselibs.conf Source99: baselibs.conf
# PATCH-FIX-SUSE tweak the buildsystem to produce what is needed for SUSE # PATCH-FIX-SUSE tweak the buildsystem to produce what is needed for SUSE
Patch0: lua-build-system.patch Patch0: lua-build-system.patch
# Yes, Lua is from Brasil, we need pt_BR locale %if "%_vendor" == "debbuild"
BuildRequires: glibc-locale BuildRequires: debbuild
%endif
BuildRequires: libtool BuildRequires: libtool
BuildRequires: lua-macros BuildRequires: lua-macros
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: readline-devel BuildRequires: readline-devel
Provides: lua = %{version} %if "%{_vendor}" == "debbuild"
Obsoletes: lua < %{version} BuildRequires: libncurses5-dev
Provides: Lua(API) = %{major_version} %endif
%if %{with libalternatives}
BuildRequires: alts
BuildRequires: lua-interpreter
Requires: alts
Requires: lua-interpreter
%else
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun):update-alternatives
Provides: lua = %{version}
Provides: Lua(API) = %{major_version}
%if "%_vendor" != "debbuild"
ExclusiveArch: do_not_build
%endif %endif
%description %description
@@ -69,10 +68,16 @@ of C functions, written in ANSI C.
%package devel %package devel
Summary: Development files for lua Summary: Development files for lua
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
%if "%{_vendor}" == "debbuild"
Requires: %{libname} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%else
Requires: %{libname} = %{version} Requires: %{libname} = %{version}
Requires: %{name} = %{version} Requires: %{name} = %{version}
%endif
Requires: lua-macros Requires: lua-macros
Conflicts: lua-devel Requires(post): update-alternatives
Requires(postun):update-alternatives
Provides: lua-devel = %{version} Provides: lua-devel = %{version}
Provides: Lua(devel) = %{major_version} Provides: Lua(devel) = %{major_version}
Provides: pkgconfig(lua) = %{version} Provides: pkgconfig(lua) = %{version}
@@ -87,17 +92,11 @@ application.
%package -n %{libname} %package -n %{libname}
Summary: The Lua integration library Summary: The Lua integration library
# Compat as libtool changes the soname
Group: System/Libraries Group: System/Libraries
Provides: liblua5_1 = %{version}-%{release}
Obsoletes: liblua5_1 < %{version}-%{release}
Provides: %{name}-libs = %{version} Provides: %{name}-libs = %{version}
Obsoletes: %{name}-libs < %{version} Obsoletes: %{name}-libs < %{version}
%ifarch aarch64 x86_64 ppc64 ppc64le s390x riscv64 Provides: liblua5_1 = %{version}-%{release}
Provides: liblua.so.5.1()(64bit) Obsoletes: liblua5_1 < %{version}-%{release}
%else
Provides: liblua.so.5.1
%endif
%description -n %{libname} %description -n %{libname}
Lua is a programming language originally designed for extending Lua is a programming language originally designed for extending
@@ -115,9 +114,6 @@ of C functions, written in ANSI C.
Summary: Documentation for Lua, a small embeddable language Summary: Documentation for Lua, a small embeddable language
Group: Documentation/HTML Group: Documentation/HTML
BuildArch: noarch BuildArch: noarch
%if 0%{?suse_version} > 1315
Supplements: (lua51 and patterns-base-documentation)
%endif
%description doc %description doc
Lua is a programming language originally designed for extending Lua is a programming language originally designed for extending
@@ -132,8 +128,7 @@ scripting, and rapid prototyping. Lua is implemented as a small library
of C functions, written in ANSI C. of C functions, written in ANSI C.
%prep %prep
%setup -q -n lua-%{version} -a1 %setup -q -n lua-%{version}
mv lua%{major_version}-tests testes
%autopatch -p1 %autopatch -p1
# manpage # manpage
@@ -141,22 +136,21 @@ cat doc/lua.1 | sed 's/TH LUA 1/TH LUA%{major_version} 1/' > doc/lua%{major_ver
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1 cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC%{major_version} 1/' > doc/luac%{major_version}.1
%build %build
%global _lto_cflags %{nil} %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
%make_build all -C src \ export LIBTOOL="libtool --quiet"
make %{?_smp_mflags} -C src \
CC="cc" \ CC="cc" \
MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" \ MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" \
MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \ MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \
V=%{major_version} \ V=%{major_version} \
LIBTOOL="libtool --quiet" all
%install %install
%make_install \ make install \
LIBTOOL="libtool --quiet" \
V=%{major_version} \ V=%{major_version} \
INSTALL_TOP="%{buildroot}%{_prefix}" \ INSTALL_TOP="%{buildroot}%{_prefix}" \
INSTALL_LIB="%{buildroot}%{_libdir}" \ INSTALL_LIB="%{buildroot}%{_libdir}"
INSTALL_MAN="%{buildroot}%{_mandir}/man1"
find %{buildroot} -type f -name "*.la" -delete -print find %{buildroot} -type f -name "*.la" -delete -print
@@ -165,7 +159,7 @@ cat > lua%{major_version}.pc <<-EOF
prefix=%{_prefix} prefix=%{_prefix}
exec_prefix=%{_prefix} exec_prefix=%{_prefix}
libdir=%{_libdir} libdir=%{_libdir}
includedir=%{_includedir}/lua%{major_version} includedir=%{_prefix}/include/lua%{major_version}
INSTALL_LMOD=%{_datadir}/lua/%{major_version} INSTALL_LMOD=%{_datadir}/lua/%{major_version}
INSTALL_CMOD=%{_libdir}/lua/%{major_version} INSTALL_CMOD=%{_libdir}/lua/%{major_version}
@@ -175,21 +169,8 @@ Version: %{version}
Libs: -llua%{major_version} -lm Libs: -llua%{major_version} -lm
Cflags: -I\${includedir} Cflags: -I\${includedir}
EOF EOF
install -D -m 644 lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua%{major_version}.pc install -D -m 644 lua%{major_version}.pc %{buildroot}/%{_libdir}/pkgconfig/lua%{major_version}.pc
%if %{with libalternatives}
# alternatives - create configuration file
mkdir -p %{buildroot}%{_datadir}/libalternatives/lua
cat > %{buildroot}%{_datadir}/libalternatives/lua/51.conf <<EOF
binary=%{_bindir}/lua5.1
man=lua5.1
EOF
mkdir -p %{buildroot}%{_datadir}/libalternatives/luac
cat > %{buildroot}%{_datadir}/libalternatives/luac/51.conf <<EOF
binary=%{_bindir}/luac5.1
man=luac5.1
EOF
%else
# update-alternatives # update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for file in lua luac ; do for file in lua luac ; do
@@ -198,59 +179,26 @@ for file in lua luac ; do
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}" touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}"
ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}" ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}"
done done
%endif
# Compat link with older unprefixed library and with soname 0 from deb/etc # Compat link with older unprefixed library and with soname 0 from deb/etc
chmod +x %{buildroot}%{_libdir}/*
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.%{major_version} ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.%{major_version}
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.0 ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua%{major_version}.so.0
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version} ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version}
# Library devel alternatives
# We dont create alternatives for -devel content, just conflict those touch %{buildroot}%{_sysconfdir}/alternatives/liblua.so
ln -s %{_libdir}/liblua%{major_version}.so %{buildroot}%{_libdir}/liblua.so ln -sf %{_sysconfdir}/alternatives/liblua.so %{buildroot}%{_libdir}/liblua.so
ln -s %{_libdir}/pkgconfig/lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc touch %{buildroot}%{_sysconfdir}/alternatives/lua.pc
ln -sf %{_sysconfdir}/alternatives/lua.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
%check %check
# WARNING: this whole check section is incredibly interdependent and brittle, don't change anything cd src
# unless you really thought through what you would be doing. LD_LIBRARY_PATH=`pwd` ./lua%{major_version} -e 'print(0)' > /dev/null
# The distributed binary of the Lua interpreter is (correctly) build without LUA_USE_APICHECK option,
# we have to build a special interpreter just for the testing.
mkdir -p build-test
cp -r src build-test/
cp Makefile build-test/
pushd build-test
%make_build clean -C src
%make_build all -C src \
CC="cc" \
MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE -DLUA_USE_APICHECK" \
MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \
V=%{major_version} \
LIBTOOL="libtool --quiet"
popd
cd testes
pushd libs
%make_build all CFLAGS="-fPIC -std=gnu99 -D_GNU_SOURCE -I../../build-test/src"
cp -- *.so ..
popd
# Yes, Lua is from Brasil
export LANG=pt_BR.utf8
export LD_LIBRARY_PATH=../build-test/src/.libs
# I haven't found a way how to run FULL all.lua test suite, so we are just running
# what we can for checking the sanity of the build.
for testFile in api.lua attrib.lua calls.lua closure.lua \
code.lua constructs.lua db.lua errors.lua events.lua files.lua \
gc.lua checktable.lua literals.lua locals.lua math.lua nextvar.lua \
pm.lua sort.lua strings.lua vararg.lua verybig.lua
do
../build-test/src/.libs/lua%{major_version} $testFile
done
%post -n %{libname} -p /sbin/ldconfig %post -n %{libname} -p /sbin/ldconfig
%postun -n %{libname} -p /sbin/ldconfig %postun -n %{libname} -p /sbin/ldconfig
%if %{without libalternatives}
%post %post
%{_sbindir}/update-alternatives --install \ %{_upd_alt_dir}/update-alternatives --install \
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 51 \ %{_bindir}/lua lua %{_bindir}/lua%{major_version} 51 \
--slave %{_bindir}/luac luac %{_bindir}/luac%{major_version} \ --slave %{_bindir}/luac luac %{_bindir}/luac%{major_version} \
--slave %{_mandir}/man1/lua.1%{ext_man} lua.1%{ext_man} %{_mandir}/man1/lua%{major_version}.1%{ext_man} \ --slave %{_mandir}/man1/lua.1%{ext_man} lua.1%{ext_man} %{_mandir}/man1/lua%{major_version}.1%{ext_man} \
@@ -258,9 +206,18 @@ done
%postun %postun
if [ "$1" = 0 ] ; then if [ "$1" = 0 ] ; then
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version} %{_upd_alt_dir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
fi
%post devel
%{_upd_alt_dir}/update-alternatives --install \
%{_libdir}/liblua.so liblua.so %{_libdir}/liblua%{major_version}.so 51 \
--slave %{_libdir}/pkgconfig/lua.pc lua.pc %{_libdir}/pkgconfig/lua%{major_version}.pc
%postun devel
if [ "$1" = 0 ] ; then
%{_upd_alt_dir}/update-alternatives --remove liblua.so %{_libdir}/liblua%{major_version}.so
fi fi
%endif
%files %files
%doc README %doc README
@@ -270,22 +227,17 @@ fi
%dir %{_datadir}/lua/%{major_version} %dir %{_datadir}/lua/%{major_version}
%{_bindir}/lua%{major_version} %{_bindir}/lua%{major_version}
%{_bindir}/luac%{major_version} %{_bindir}/luac%{major_version}
%{_mandir}/man1/lua%{major_version}.1%{?ext_man} %{_mandir}/man1/lua%{major_version}.1%{ext_man}
%{_mandir}/man1/luac%{major_version}.1%{?ext_man} %{_mandir}/man1/luac%{major_version}.1%{ext_man}
%if %{with libalternatives}
%{_datadir}/libalternatives/lua/51.conf
%{_datadir}/libalternatives/luac/51.conf
%else
# alternatives # alternatives
%{_bindir}/lua %{_bindir}/lua
%{_bindir}/luac %{_bindir}/luac
%{_mandir}/man1/lua.1%{?ext_man} %{_mandir}/man1/lua.1%{ext_man}
%{_mandir}/man1/luac.1%{?ext_man} %{_mandir}/man1/luac.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/lua %ghost %{_sysconfdir}/alternatives/lua
%ghost %{_sysconfdir}/alternatives/luac %ghost %{_sysconfdir}/alternatives/luac
%ghost %{_sysconfdir}/alternatives/lua.1%{ext_man} %ghost %{_sysconfdir}/alternatives/lua.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/luac.1%{ext_man} %ghost %{_sysconfdir}/alternatives/luac.1%{ext_man}
%endif
%files -n %{libname} %files -n %{libname}
%{_libdir}/liblua%{major_version}.so.* %{_libdir}/liblua%{major_version}.so.*
@@ -298,10 +250,14 @@ fi
%{_includedir}/lua%{major_version}/lua.hpp %{_includedir}/lua%{major_version}/lua.hpp
%{_includedir}/lua%{major_version}/luaconf.h %{_includedir}/lua%{major_version}/luaconf.h
%{_includedir}/lua%{major_version}/lualib.h %{_includedir}/lua%{major_version}/lualib.h
%{_libdir}/liblua%{major_version}.a
%{_libdir}/liblua%{major_version}.so %{_libdir}/liblua%{major_version}.so
%{_libdir}/pkgconfig/lua%{major_version}.pc %{_libdir}/pkgconfig/lua%{major_version}.pc
# alternatives
%{_libdir}/liblua.so %{_libdir}/liblua.so
%{_libdir}/pkgconfig/lua.pc %{_libdir}/pkgconfig/lua.pc
%ghost %{_sysconfdir}/alternatives/liblua.so
%ghost %{_sysconfdir}/alternatives/lua.pc
%files doc %files doc
%doc doc/* %doc doc/*