SHA256
7
0
forked from pool/lua51

7 Commits

Author SHA256 Message Date
d3e7fcca4b Accepting request 1297890 from devel:languages:lua
interpreter should only provide, not conflict lua symbol (bsc#1247521)

OBS-URL: https://build.opensuse.org/request/show/1297890
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=19
2025-08-06 12:30:51 +00:00
e61d50374d Accepting request 1295837 from devel:languages:lua
- Switch from update-alternatives to libalternatives (and
  dependency on lua-interpreter)
- improve .gitignore and overall improve the packaging.
- this package also provides devel symlink directly and conflicts other -devel packages

  They include lua51-devel and expects rpm macros to be available.
  on the interpreter binary
* libdl is required not librt
* fix libraries in pkgconfig file
- move the lua rpm macros to the devel package to avoid conflict
- Correction in Provides and Obsolete for lua-libs
  * too many variables in an assignment may cause a C stack
    overflow
  * an error in a module loaded through the '-l' option shows no
  * gsub may go wild when wrongly called without its third
    argument and with a large subject
  * table.remove removes last element of a table when given
    an out-of-bound index
  * stand-alone interpreter shows incorrect error message when
  * debug.sethook/gethook may overflow the thread's stack

OBS-URL: https://build.opensuse.org/request/show/1295837
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=18
2025-08-03 11:35:47 +00:00
795929b13f Accepting request 720490 from devel:languages:lua
OBS-URL: https://build.opensuse.org/request/show/720490
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=17
2019-09-05 10:02:04 +00:00
385c0a6ace Accepting request 512558 from devel:languages:lua
pkgconf provide

OBS-URL: https://build.opensuse.org/request/show/512558
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=16
2017-08-14 10:34:58 +00:00
Stephan Kulow
ad2461abd2 Accepting request 329248 from devel:languages:lua
1

OBS-URL: https://build.opensuse.org/request/show/329248
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=15
2015-09-19 04:52:25 +00:00
Stephan Kulow
b03b38a860 Accepting request 248967 from devel:languages:lua
- fix update-alternatives

- fix /etc/rpm/macros.lua51 perms

OBS-URL: https://build.opensuse.org/request/show/248967
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=14
2014-09-15 15:39:52 +00:00
Stephan Kulow
e5f1280440 Accepting request 232395 from devel:languages:lua
I expect this to fix many "Linux" games that were created and designed for Ubuntu and friends. They will then work outside the Steam runtime with native libraries on SUSE, too. (forwarded request 232302 from Mailaender)

OBS-URL: https://build.opensuse.org/request/show/232395
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua51?expand=0&rev=12
2014-05-03 14:51:35 +00:00
7 changed files with 196 additions and 105 deletions

3
.gitattributes vendored
View File

@@ -1,4 +1,4 @@
*.changes merge=merge-changes
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
@@ -12,7 +12,6 @@
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png 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
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text

5
_scmsync.obsinfo Normal file
View File

@@ -0,0 +1,5 @@
mtime: 1754410547
commit: 955a9b64ac434fa658040772b2d71aee10e5d7fe9c3a74281150f639e00bf3a7
url: https://src.opensuse.org/lua/lua51.git
revision: 955a9b64ac434fa658040772b2d71aee10e5d7fe9c3a74281150f639e00bf3a7
projectscmsync: https://src.opensuse.org/lua/_ObsPrj.git

3
build.specials.obscpio Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ef05576b310af92224aff9bc4242cb3aeb413a6330df5a1de29c6d87672e6b48
size 320

View File

@@ -3,14 +3,16 @@ Date: Sun, 1 Mar 2015 16:13:52 +0100
Subject: build system
---
Makefile | 25 ++++++++++++++-----------
src/Makefile | 31 +++++++++++++++++++------------
2 files changed, 33 insertions(+), 23 deletions(-)
Makefile | 26 +++++++++++++++-----------
src/Makefile | 28 ++++++++++++++++------------
src/luaconf.h | 8 ++++++--
testes/libs/makefile | 11 +++++++----
4 files changed, 44 insertions(+), 29 deletions(-)
Index: lua-5.1.5/Makefile
===================================================================
--- lua-5.1.5.orig/Makefile
+++ lua-5.1.5/Makefile
--- lua-5.1.5.orig/Makefile 2012-02-10 10:50:23.000000000 +0100
+++ lua-5.1.5/Makefile 2025-07-19 17:02:14.322726003 +0200
@@ -2,6 +2,8 @@
# see INSTALL for installation instructions
# see src/Makefile and src/luaconf.h for further customization
@@ -20,7 +22,7 @@ Index: lua-5.1.5/Makefile
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
@@ -9,22 +11,23 @@ PLAT= none
@@ -9,22 +11,23 @@
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path.
@@ -48,7 +50,7 @@ Index: lua-5.1.5/Makefile
#
# If you don't have install you can use cp instead.
# INSTALL= cp -p
@@ -41,10 +44,10 @@ RANLIB= ranlib
@@ -41,10 +44,10 @@
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
@@ -62,7 +64,7 @@ Index: lua-5.1.5/Makefile
# Lua version and release.
V= 5.1
@@ -53,16 +56,16 @@ R= 5.1.5
@@ -53,16 +56,17 @@
all: $(PLAT)
$(PLATS) clean:
@@ -75,18 +77,20 @@ Index: lua-5.1.5/Makefile
install: dummy
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_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)
ranlib:
Index: lua-5.1.5/src/Makefile
===================================================================
--- lua-5.1.5.orig/src/Makefile
+++ lua-5.1.5/src/Makefile
@@ -8,7 +8,7 @@
--- lua-5.1.5.orig/src/Makefile 2012-02-13 21:41:22.000000000 +0100
+++ lua-5.1.5/src/Makefile 2025-07-19 17:02:14.323016861 +0200
@@ -8,32 +8,37 @@
PLAT= none
CC= gcc
@@ -95,7 +99,8 @@ Index: lua-5.1.5/src/Makefile
AR= ar rcu
RANLIB= ranlib
RM= rm -f
@@ -16,24 +16,28 @@ LIBS= -lm $(MYLIBS)
LIBS= -lm $(MYLIBS)
+LIBDIR=/usr/lib
MYCFLAGS=
MYLDFLAGS=
@@ -110,7 +115,7 @@ Index: lua-5.1.5/src/Makefile
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua$(V).a
+LUA_A= liblua$(V).la
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 \
- lundump.o lvm.o lzio.o
@@ -130,28 +135,29 @@ Index: lua-5.1.5/src/Makefile
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
@@ -48,14 +52,13 @@ o: $(ALL_O)
@@ -48,14 +53,13 @@
a: $(ALL_A)
$(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
- $(RANLIB) $@
+ $(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
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath $(LIBDIR) -version-info 6:0:1 -o $(LUA_A)
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(MYLDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) -static liblua$(V).la -Wl,-E lua.lo -o $@
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) $(LUA_A) -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)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -static liblua$(V).la luac.lo -o $@
+$(LUAC_T): $(LUAC_O) $(BASE_O)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -o $@ $(LUAC_O:.o=.lo) $(BASE_O:.o=.lo) $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
Index: lua-5.1.5/src/luaconf.h
===================================================================
--- lua-5.1.5.orig/src/luaconf.h
+++ 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/src/luaconf.h 2025-07-19 17:02:14.323256121 +0200
@@ -95,13 +95,17 @@
#else
@@ -172,3 +178,31 @@ Index: lua-5.1.5/src/luaconf.h
#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

BIN
lua5.1-tests.tar.gz LFS Normal file

Binary file not shown.

View File

@@ -1,13 +1,16 @@
-------------------------------------------------------------------
Fri Feb 19 16:42:08 UTC 2021 - Victor Zhestkov <victor.zhestkov@suse.com>
Tue Aug 5 07:21:48 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Using right path for update-alternatives for Debian and Ubuntu
- Requirement alignments for Debian and Ubuntu
- interpreter should only provide, not conflict lua symbol
(bsc#1247521)
-------------------------------------------------------------------
Fri Feb 19 11:38:37 UTC 2021 - Victor Zhestkov <victor.zhestkov@suse.com>
Sat Jul 19 09:23:33 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Add missing libncurses5 devel build requires for Ubuntu and Debian
- Switch from update-alternatives to libalternatives (and
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>
@@ -75,27 +78,27 @@ Thu May 1 06:59:04 UTC 2014 - mailaender@opensuse.org
Mon Apr 14 06:56:18 UTC 2014 - pgajdos@suse.com
- 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.
-------------------------------------------------------------------
Tue Mar 18 10:06:55 UTC 2014 - Rene.vanPaassen@gmail.com
- 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
- 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
- refresh patch lua51-5.1.5-module-path.diff
- 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
@@ -106,7 +109,7 @@ Thu May 16 07:19:10 UTC 2013 - pgajdos@suse.com
-------------------------------------------------------------------
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
-------------------------------------------------------------------
@@ -126,7 +129,7 @@ Mon Jun 18 12:59:24 UTC 2012 - pgajdos@suse.com
-------------------------------------------------------------------
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
@@ -221,18 +224,18 @@ Tue Feb 19 10:37:22 CET 2008 - pgajdos@suse.cz
- created -doc package
- updated to version 5.1.3, bug fix release. Fixed bugs:
* wrong error message in some concatenations
* too many variables in an assignment may cause a C stack
overflow
* an error in a module loaded through the '-l' option shows no
* too many variables in an assignment may cause a C stack
overflow
* an error in a module loaded through the '-l' option shows no
traceback
* gsub may go wild when wrongly called without its third
argument and with a large subject
* table.remove removes last element of a table when given
an out-of-bound index
* gsub may go wild when wrongly called without its third
argument and with a large subject
* table.remove removes last element of a table when given
an out-of-bound index
* 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.
* 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

View File

@@ -1,7 +1,7 @@
#
# spec file for package lua51
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,10 +18,10 @@
%define major_version 5.1
%define libname liblua5_1-5
%if "%{_vendor}" == "debbuild"
%define _upd_alt_dir %{_bindir}
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%define _upd_alt_dir %{_sbindir}
%bcond_with libalternatives
%endif
Name: lua51
Version: 5.1.5
@@ -29,28 +29,29 @@ Release: 0
Summary: Small Embeddable Language with Procedural Syntax
License: MIT
Group: Development/Languages/Other
URL: http://www.lua.org
Source: http://www.lua.org/ftp/lua-%{version}.tar.gz
URL: https://www.lua.org
Source0: https://www.lua.org/ftp/lua-%{version}.tar.gz
Source1: https://www.lua.org/tests/lua%{major_version}-tests.tar.gz
Source99: baselibs.conf
# PATCH-FIX-SUSE tweak the buildsystem to produce what is needed for SUSE
Patch0: lua-build-system.patch
%if "%_vendor" == "debbuild"
BuildRequires: debbuild
%endif
# Yes, Lua is from Brasil, we need pt_BR locale
BuildRequires: glibc-locale
BuildRequires: libtool
BuildRequires: lua-macros
BuildRequires: pkgconfig
BuildRequires: readline-devel
%if "%{_vendor}" == "debbuild"
BuildRequires: libncurses5-dev
%endif
Requires(post): update-alternatives
Requires(postun):update-alternatives
Provides: lua = %{version}
Obsoletes: lua < %{version}
Provides: Lua(API) = %{major_version}
%if "%_vendor" != "debbuild"
ExclusiveArch: do_not_build
%if %{with libalternatives}
BuildRequires: alts
BuildRequires: lua-interpreter
Requires: alts
Requires: lua-interpreter
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
%description
@@ -68,16 +69,10 @@ of C functions, written in ANSI C.
%package devel
Summary: Development files for lua
Group: Development/Libraries/C and C++
%if "%{_vendor}" == "debbuild"
Requires: %{libname} = %{version}-%{release}
Requires: %{name} = %{version}-%{release}
%else
Requires: %{libname} = %{version}
Requires: %{name} = %{version}
%endif
Requires: lua-macros
Requires(post): update-alternatives
Requires(postun):update-alternatives
Conflicts: lua-devel
Provides: lua-devel = %{version}
Provides: Lua(devel) = %{major_version}
Provides: pkgconfig(lua) = %{version}
@@ -92,11 +87,17 @@ application.
%package -n %{libname}
Summary: The Lua integration library
# Compat as libtool changes the soname
Group: System/Libraries
Provides: %{name}-libs = %{version}
Obsoletes: %{name}-libs < %{version}
Provides: liblua5_1 = %{version}-%{release}
Obsoletes: liblua5_1 < %{version}-%{release}
Provides: %{name}-libs = %{version}
Obsoletes: %{name}-libs < %{version}
%ifarch aarch64 x86_64 ppc64 ppc64le s390x riscv64
Provides: liblua.so.5.1()(64bit)
%else
Provides: liblua.so.5.1
%endif
%description -n %{libname}
Lua is a programming language originally designed for extending
@@ -114,6 +115,9 @@ of C functions, written in ANSI C.
Summary: Documentation for Lua, a small embeddable language
Group: Documentation/HTML
BuildArch: noarch
%if 0%{?suse_version} > 1315
Supplements: (lua51 and patterns-base-documentation)
%endif
%description doc
Lua is a programming language originally designed for extending
@@ -128,7 +132,8 @@ scripting, and rapid prototyping. Lua is implemented as a small library
of C functions, written in ANSI C.
%prep
%setup -q -n lua-%{version}
%setup -q -n lua-%{version} -a1
mv lua%{major_version}-tests testes
%autopatch -p1
# manpage
@@ -136,21 +141,22 @@ 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
%build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%global _lto_cflags %{nil}
sed -i -e "s@lib/lua/@%{_lib}/lua/@g" src/luaconf.h
export LIBTOOL="libtool --quiet"
make %{?_smp_mflags} -C src \
%make_build all -C src \
CC="cc" \
MYCFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE -fPIC -DLUA_USE_LINUX -DLUA_COMPAT_MODULE" \
MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses" \
V=%{major_version} \
all
LIBTOOL="libtool --quiet"
%install
make install \
%make_install \
LIBTOOL="libtool --quiet" \
V=%{major_version} \
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
@@ -159,7 +165,7 @@ cat > lua%{major_version}.pc <<-EOF
prefix=%{_prefix}
exec_prefix=%{_prefix}
libdir=%{_libdir}
includedir=%{_prefix}/include/lua%{major_version}
includedir=%{_includedir}/lua%{major_version}
INSTALL_LMOD=%{_datadir}/lua/%{major_version}
INSTALL_CMOD=%{_libdir}/lua/%{major_version}
@@ -169,8 +175,21 @@ Version: %{version}
Libs: -llua%{major_version} -lm
Cflags: -I\${includedir}
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
mkdir -p %{buildroot}%{_sysconfdir}/alternatives
for file in lua luac ; do
@@ -179,26 +198,59 @@ for file in lua luac ; do
touch "%{buildroot}%{_sysconfdir}/alternatives/${file}.1%{ext_man}"
ln -sf "%{_sysconfdir}/alternatives/${file}.1%{ext_man}" "%{buildroot}%{_mandir}/man1/${file}.1%{ext_man}"
done
%endif
# 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.0
ln -s %{_libdir}/liblua%{major_version}.so.%{major_version}.0 %{buildroot}%{_libdir}/liblua.so.%{major_version}
# Library devel alternatives
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
# We dont create alternatives for -devel content, just conflict those
ln -s %{_libdir}/liblua%{major_version}.so %{buildroot}%{_libdir}/liblua.so
ln -s %{_libdir}/pkgconfig/lua%{major_version}.pc %{buildroot}%{_libdir}/pkgconfig/lua.pc
%check
cd src
LD_LIBRARY_PATH=`pwd` ./lua%{major_version} -e 'print(0)' > /dev/null
# WARNING: this whole check section is incredibly interdependent and brittle, don't change anything
# unless you really thought through what you would be doing.
# 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
%postun -n %{libname} -p /sbin/ldconfig
%if %{without libalternatives}
%post
%{_upd_alt_dir}/update-alternatives --install \
%{_sbindir}/update-alternatives --install \
%{_bindir}/lua lua %{_bindir}/lua%{major_version} 51 \
--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} \
@@ -206,18 +258,9 @@ LD_LIBRARY_PATH=`pwd` ./lua%{major_version} -e 'print(0)' > /dev/null
%postun
if [ "$1" = 0 ] ; then
%{_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
%{_sbindir}/update-alternatives --remove lua %{_bindir}/lua%{major_version}
fi
%endif
%files
%doc README
@@ -227,17 +270,22 @@ fi
%dir %{_datadir}/lua/%{major_version}
%{_bindir}/lua%{major_version}
%{_bindir}/luac%{major_version}
%{_mandir}/man1/lua%{major_version}.1%{ext_man}
%{_mandir}/man1/luac%{major_version}.1%{ext_man}
%{_mandir}/man1/lua%{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
%{_bindir}/lua
%{_bindir}/luac
%{_mandir}/man1/lua.1%{ext_man}
%{_mandir}/man1/luac.1%{ext_man}
%{_mandir}/man1/lua.1%{?ext_man}
%{_mandir}/man1/luac.1%{?ext_man}
%ghost %{_sysconfdir}/alternatives/lua
%ghost %{_sysconfdir}/alternatives/luac
%ghost %{_sysconfdir}/alternatives/lua.1%{ext_man}
%ghost %{_sysconfdir}/alternatives/luac.1%{ext_man}
%endif
%files -n %{libname}
%{_libdir}/liblua%{major_version}.so.*
@@ -250,14 +298,10 @@ fi
%{_includedir}/lua%{major_version}/lua.hpp
%{_includedir}/lua%{major_version}/luaconf.h
%{_includedir}/lua%{major_version}/lualib.h
%{_libdir}/liblua%{major_version}.a
%{_libdir}/liblua%{major_version}.so
%{_libdir}/pkgconfig/lua%{major_version}.pc
# alternatives
%{_libdir}/liblua.so
%{_libdir}/pkgconfig/lua.pc
%ghost %{_sysconfdir}/alternatives/liblua.so
%ghost %{_sysconfdir}/alternatives/lua.pc
%files doc
%doc doc/*