Import Debian changes 5.2.4-ok1

lua5.2 (5.2.4-ok1) yangtze; urgency=medium

  * Build for openKylin.
This commit is contained in:
openKylinBot 2022-04-25 22:03:04 +08:00 committed by Lu zhiping
parent ff6a34fb8b
commit 75a347d66b
33 changed files with 876 additions and 0 deletions

5
debian/changelog vendored Normal file
View File

@ -0,0 +1,5 @@
lua5.2 (5.2.4-ok1) yangtze; urgency=medium
* Build for openKylin.
-- openKylinBot <openKylinBot@openkylin.com> Mon, 25 Apr 2022 22:03:04 +0800

1
debian/compat vendored Normal file
View File

@ -0,0 +1 @@
9

81
debian/control vendored Normal file
View File

@ -0,0 +1,81 @@
Source: lua5.2
Section: interpreters
Priority: optional
Maintainer: Enrico Tassi <gareuselesinge@debian.org>
Uploaders: John V. Belmonte <jbelmonte@debian.org>
Build-Depends: debhelper (>= 9), quilt (>= 0.40), libtool-bin, libreadline-dev
Standards-Version: 3.9.3
Vcs-Git: git://git.debian.org/git/pkg-lua/lua5.2.git
Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua5.2.git
Homepage: http://www.lua.org
Package: lua5.2-doc
Architecture: all
Section: doc
Depends: ${misc:Depends}
Description: Documentation for the Lua language version 5.2
Lua is a powerful, light-weight programming language designed for extending
applications. The language engine is accessible as a library, having a C
API which allows the application to exchange data with Lua programs and also
to extend Lua with C functions. Lua is also used as a general-purpose,
stand-alone language through the simple command line interpreter provided.
.
This package contains the official manual covering the Lua language and C API,
examples, etc.
Package: lua5.2
Architecture: any
Multi-Arch: foreign
Provides: lua
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Simple, extensible, embeddable programming language
Lua is a powerful, light-weight programming language designed for extending
applications. The language engine is accessible as a library, having a C
API which allows the application to exchange data with Lua programs and also
to extend Lua with C functions. Lua is also used as a general-purpose,
stand-alone language through the simple command line interpreter provided.
.
This package contains the Lua command line interpreter and bytecode compiler.
Install it if you are developing or using Lua scripts.
Package: liblua5.2-dev
Architecture: any
Multi-Arch: same
Depends: liblua5.2-0 (= ${binary:Version}), libc6-dev|libc-dev, libreadline-dev, ${misc:Depends}
Recommends: pkg-config, libtool-bin
Section: libdevel
Description: Development files for the Lua language version 5.2
Lua is a powerful, light-weight programming language designed for extending
applications. The language engine is accessible as a library, having a C
API which allows the application to exchange data with Lua programs and also
to extend Lua with C functions. Lua is also used as a general-purpose,
stand-alone language through the simple command line interpreter provided.
.
This package contains developer resources for using the Lua library.
Install it if you are developing programs which use the Lua C API.
Package: liblua5.2-0
Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
Section: libs
Description: Shared library for the Lua interpreter version 5.2
Lua is a powerful, light-weight programming language designed for extending
applications. The language engine is accessible as a library, having a C
API which allows the application to exchange data with Lua programs and also
to extend Lua with C functions. Lua is also used as a general-purpose,
stand-alone language through the simple command line interpreter provided.
.
This package contains runtime libraries. You shouldn't need to install it
explicitly.
Package: liblua5.2-0-dbg
Architecture: any
Multi-Arch: same
Depends: ${shlibs:Depends}, liblua5.2-0 (= ${binary:Version}), ${misc:Depends}
Section: debug
Priority: extra
Description: Debug symbols for the Lua shared library interpreter
This package contains the debugging symbols for liblua5.2 and lua5.2

26
debian/copyright vendored Normal file
View File

@ -0,0 +1,26 @@
Format: http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=markup&pathrev=174
Upstream-Name: Lua team
Upstream-Contact: team@lua.org
Source: http://www.lua.org/ftp
Files: *
Copyright: Copyright 1994-2011 Lua.org, PUC-Rio.
License: Expat
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

9
debian/examples/debian/Makefile vendored Normal file
View File

@ -0,0 +1,9 @@
SUBDIRS = script static_app binary_module
.PHONY: $(SUBDIRS)
%:: $(SUBDIRS)
@:
$(SUBDIRS)::
$(MAKE) -C $(SUBDIR) $@ $(MAKECMDGOALS)

11
debian/examples/debian/README vendored Normal file
View File

@ -0,0 +1,11 @@
Index of examples:
script - how to create an executable script
static_app - how to build an app which uses the Lua C library
binary_module - how to build static and shared binary modules
To build and run all examples:
$ make test
For a quieter run use the "-s" option. Another useful target is "clean".

View File

@ -0,0 +1,60 @@
LIBTOOL = libtool --silent --tag=CC
LUA_CFLAGS := $(shell pkg-config lua5.2 --cflags)
LUA_LDFLAGS := $(shell pkg-config lua5.2 --libs)
LUA_LDSFLAGS := $(shell pkg-config lua5.2 --static --libs)
# this is the path where you'll eventually install the module
RPATH=$(shell pkg-config lua5.2 --define-variable=prefix=/usr/local \
--variable=INSTALL_CMOD)
# Following is a build and use example for a binary Lua module "foo". The
# implementation is in "lua-foo.c". To support dynamic loading conventions
# it will need to have an open function named "luaopen_foo" which registers
# the global module "foo".
test: test-dynamic test-static test-static-all
# compile source to make objects for static and dynamic link
lua-foo.lo: lua-foo.c
$(LIBTOOL) --mode=compile $(CC) -c -Wall -O2 $(LUA_CFLAGS) lua-foo.c
# link objects to make static and dynamic libraries. The .so will be
# left in "./.libs/". Note that the Lua library and its dependencies are
# not called out on the link line since they are assumed to be part of
# whatever our library is linked to. We want to avoid duplicate library
# copies, which is a waste of space and can cause run-time problems.
liblua-foo.la foo.so: lua-foo.lo
$(LIBTOOL) --mode=link $(CC) \
-rpath $(RPATH) $(LUA_LDSFLAGS) -o liblua-foo.la lua-foo.lo
ln -sf ./.libs/liblua-foo.so foo.so
# If all went well, we can dynamically load the module into Lua. The
# following will load the library into the interpreter and call a function.
test-dynamic: foo.so
lua5.2 -l foo -e 'print(foo.get_greeting())'
app: app.c liblua-foo.la
$(LIBTOOL) --mode=link $(CC) -Wall -O2 $(LUA_CFLAGS) \
-static $(LUA_LDFLAGS) -o app app.c liblua-foo.la
app-s: app.c liblua-foo.la
$(LIBTOOL) --mode=link $(CC) -Wall -O2 $(LUA_CFLAGS) \
-static -Wc,-static $(LUA_LDSFLAGS) -o app-s app.c liblua-foo.la
test-static: app
./app
ldd app
test-static-all: app-s
./app-s
ldd app-s || true
# install static and dynamic libraries for module to global location
install: liblua-foo.la
mkdir -p $(RPATH)
$(LIBTOOL) --mode=install install liblua-foo.la $(RPATH)/liblua-foo.la
rm $(RPATH)/liblua-foo.la
clean:
$(RM) *.o *.lo *.la *.so app app-s
$(RM) -r ./.libs/

View File

@ -0,0 +1,30 @@
Binary Lua modules: best practices for Unix
Key points
----------
* don't hard-code Lua header, library, or module paths in your build script
* use pkg-config tool
* use libtool, especially for modules to be loaded dynamically
* for general modules which are to be published for use by various apps:
* provide both static and dynamic library files
Real example
------------
In this directory is a minimal binary Lua module called "foo" which has
a single function "get_greeting" which returns a string. The purpose
is to show how to build and use both dynamic and static modules in a
portable way (as far as Unix goes).
If you don't have libtool installed, try:
$ apt-get install libtool
Build and run the dynamic test with:
$ make test-dynamic
or the static test with:
$ make test-dynamic

View File

@ -0,0 +1,17 @@
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
int luaopen_foo(lua_State* L);
int main(void)
{
int result;
lua_State* L = luaL_newstate();
luaL_openlibs(L);
result = luaL_dostring(L, "foo = require 'foo'");
if (result != 0) return 1;
result = luaL_dostring(L, "print(foo.get_greeting())");
lua_close(L);
return (result != 0);
}

View File

@ -0,0 +1,21 @@
#define LUA_LIB
#include <lua.h>
#include <lauxlib.h>
static int get_greeting(lua_State* L)
{
lua_pushstring(L, "hello from Lua");
return 1;
}
static const luaL_Reg funcs[] = {
{ "get_greeting", get_greeting },
{ NULL, NULL }
};
int luaopen_foo(lua_State* L)
{
lua_newtable(L);
luaL_setfuncs(L, funcs, 0);
return 1;
}

View File

@ -0,0 +1,6 @@
all: test
test:
./hello
clean: ;

9
debian/examples/debian/script/README vendored Normal file
View File

@ -0,0 +1,9 @@
This is just a minimal example of an executable Lua script. Main points:
* use the "env" tool to avoid hard-coding the Lua interpreter path. This
allows programs calling your script to control the interpreter run via PATH.
* don't use the ".lua" suffix on executable scripts. You may want to
change the implementation language later (e.g. to C, LuaJIT, etc.). Your
editor should be smart enough to detect a script's language by looking at
the first line of the file, so that is not a valid excuse.

3
debian/examples/debian/script/hello vendored Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env lua5.2
print 'hello from Lua 5.2'

View File

@ -0,0 +1,14 @@
CFLAGS += -Wall
LUA_CFLAGS := $(shell pkg-config lua5.1 --cflags)
LUA_LINK_FLAGS := $(shell pkg-config lua5.1 --libs)
all: test
app: CFLAGS += $(LUA_CFLAGS) $(LUA_LINK_FLAGS)
test: app
./app
clean:
$(RM) *.o app

View File

@ -0,0 +1,4 @@
This is a minimal example of an application binary linked to the Lua library.
The main points are to show the proper way to include a Lua header (e.g.
"#include <lua.h>") and how to use pkg-config to avoid hard-coding Lua header
paths, library names, and dependent libraries.

13
debian/examples/debian/static_app/app.c vendored Normal file
View File

@ -0,0 +1,13 @@
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
int main(void)
{
int result;
lua_State* L = lua_open();
luaL_openlibs(L);
result = luaL_dostring(L, "print 'hello from Lua'");
lua_close(L);
return (result != 0);
}

1
debian/liblua5.2-0.install vendored Normal file
View File

@ -0,0 +1 @@
usr/lib/*/*.so.*

5
debian/liblua5.2-dev.install vendored Normal file
View File

@ -0,0 +1,5 @@
usr/include
usr/lib/*/*.a
usr/lib/*/*.so
usr/lib/*/pkgconfig/*.pc
usr/share/*/version-script

25
debian/lua-c++.pc.in vendored Normal file
View File

@ -0,0 +1,25 @@
#prefix=/usr
#major_version=5.1
#version=5.1.0
#deb_host_multiarch=x86_64-linux-gnu
lib_name=lua${major_version}-c++
libdir=${prefix}/lib/${deb_host_multiarch}
includedir=${prefix}/include
#
# The following are intended to be used via "pkg-config --variable".
# Install paths for Lua modules. For example, if a package wants to install
# Lua source modules to the /usr/local tree, call pkg-config with
# "--define-variable=prefix=/usr/local" and "--variable=INSTALL_LMOD".
INSTALL_LMOD=${prefix}/share/lua/${major_version}
INSTALL_CMOD=${prefix}/lib/${deb_host_multiarch}/lua/${major_version}
Name: Lua
Description: Lua language engine
Version: ${version}
Requires:
Libs: -L${libdir} -l${lib_name}
Libs.private: -lm -ldl
Cflags: -I${includedir}/${lib_name_include}

25
debian/lua.pc.in vendored Normal file
View File

@ -0,0 +1,25 @@
#prefix=/usr
#major_version=5.1
#version=5.1.0
#deb_host_multiarch=x86_64-linux-gnu
lib_name=lua${major_version}
libdir=${prefix}/lib/${deb_host_multiarch}
includedir=${prefix}/include
#
# The following are intended to be used via "pkg-config --variable".
# Install paths for Lua modules. For example, if a package wants to install
# Lua source modules to the /usr/local tree, call pkg-config with
# "--define-variable=prefix=/usr/local" and "--variable=INSTALL_LMOD".
INSTALL_LMOD=${prefix}/share/lua/${major_version}
INSTALL_CMOD=${prefix}/lib/${deb_host_multiarch}/lua/${major_version}
Name: Lua
Description: Lua language engine
Version: ${version}
Requires:
Libs: -L${libdir} -l${lib_name}
Libs.private: -lm -ldl
Cflags: -I${includedir}/${lib_name_include}

4
debian/lua5.2-doc.docs vendored Normal file
View File

@ -0,0 +1,4 @@
doc/*.html
doc/*.css
doc/*.png
doc/*.gif

1
debian/lua5.2.install vendored Normal file
View File

@ -0,0 +1 @@
usr/bin

2
debian/lua5.2.manpages vendored Normal file
View File

@ -0,0 +1,2 @@
lua5.2.1
luac5.2.1

16
debian/lua5.2.postinst vendored Normal file
View File

@ -0,0 +1,16 @@
#!/bin/sh -e
case "$1" in
configure)
update-alternatives \
--install /usr/bin/lua lua-interpreter /usr/bin/lua5.2 120 \
--slave /usr/share/man/man1/lua.1.gz lua-manual \
/usr/share/man/man1/lua5.2.1.gz
update-alternatives \
--install /usr/bin/luac lua-compiler /usr/bin/luac5.2 120 \
--slave /usr/share/man/man1/luac.1.gz lua-compiler-manual \
/usr/share/man/man1/luac5.2.1.gz
;;
esac
#DEBHELPER#

10
debian/lua5.2.prerm vendored Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh -e
case "$1" in
remove)
update-alternatives --remove lua-interpreter /usr/bin/lua5.2
update-alternatives --remove lua-compiler /usr/bin/luac5.2
;;
esac
#DEBHELPER#

170
debian/patches/0001-debian-make.patch vendored Normal file
View File

@ -0,0 +1,170 @@
From: Enrico Tassi <gareuselesinge@debian.org>
Date: Sun, 30 Jun 2013 22:55:45 +0200
Subject: debian-make
===================================================================
---
Makefile | 27 +++++++++++++++------------
src/Makefile | 35 ++++++++++++++++++++++-------------
2 files changed, 37 insertions(+), 25 deletions(-)
diff --git a/Makefile b/Makefile
index b2a62cf..0351522 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,8 @@
# Makefile for installing Lua
# See doc/readme.html for installation and customization instructions.
+export LIBTOOL=libtool --quiet
+
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
@@ -10,19 +12,20 @@ PLAT= none
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= $(DESTDIR)/usr
INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
-INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
-INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
-INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
+INSTALL_INC= $(INSTALL_TOP)/include/lua$(V)
+INSTALL_LIB= $(INSTALL_TOP)/lib/$(DEB_HOST_MULTIARCH)
+INSTALL_MAN= $(INSTALL_TOP)/share/man/man1
+INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$(V)
+INSTALL_CMOD= $(INSTALL_TOP)/lib/$(DEB_HOST_MULTIARCH)/lua/$(V)
# How to install. If your install program does not support "-p", then
# you may have to run ranlib on the installed liblua.a.
-INSTALL= install -p
+INSTALL= libtool --quiet --mode=install install -p
INSTALL_EXEC= $(INSTALL) -m 0755
INSTALL_DATA= $(INSTALL) -m 0644
+INSTALL_LIBTOOL= $(LIBTOOL) --mode=install install -m 0644
#
# If you don't have "install" you can use "cp" instead.
# INSTALL= cp -p
@@ -39,9 +42,9 @@ RM= rm -f
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
-TO_BIN= lua luac
+TO_BIN= lua$(V) luac$(V)
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua$(V).la liblua$(V)-c++.la
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -52,16 +55,16 @@ R= $V.4
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) $@ INSTALL_LIB=$(INSTALL_LIB)
test: dummy
- src/lua -v
+ $(LIBTOOL) --mode=execute -dlopen src/liblua$(V).la src/lua$(V) -v
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_DATA) $(TO_INC) $(INSTALL_INC)
- cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
+ cd src && $(INSTALL_LIBTOOL) $(TO_LIB) $(INSTALL_LIB)
cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
uninstall:
diff --git a/src/Makefile b/src/Makefile
index 7b4b2b7..8a18266 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -4,10 +4,18 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
-PLAT= none
+PLAT=
+
+CC= $(CCACHE)gcc -std=gnu99
+CXX= $(CCACHE)g++
+CFLAGS= -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+CXXFLAGS= -Wall -Wextra -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCXXFLAGS)
+
+MYCFLAGS=$(shell dpkg-buildflags --get CFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
+MYCXXFLAGS=$(shell dpkg-buildflags --get CXXFLAGS) $(shell dpkg-buildflags --get CPPFLAGS)
+MYLDFLAGS=$(shell dpkg-buildflags --get LDFLAGS)
+MYLIBS=-ldl
-CC= gcc
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -19,16 +27,13 @@ SYSCFLAGS=
SYSLDFLAGS=
SYSLIBS=
-MYCFLAGS=
-MYLDFLAGS=
-MYLIBS=
MYOBJS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua5.2.la liblua5.2-c++.la
CORE_O= lapi.o lcode.o lctype.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
@@ -36,10 +41,10 @@ LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o \
lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-LUA_T= lua
+LUA_T= lua5.2
LUA_O= lua.o
-LUAC_T= luac
+LUAC_T= luac5.2
LUAC_O= luac.o
ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
@@ -56,14 +61,14 @@ o: $(ALL_O)
a: $(ALL_A)
$(LUA_A): $(BASE_O)
- $(AR) $@ $(BASE_O)
- $(RANLIB) $@
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -lm -ldl $(BASE_O:.o=.lo) -rpath /usr/lib/$(DEB_HOST_MULTIARCH) -version-info 0:0:0 -Wl,--version-script,../debian/version-script -o liblua5.2.la
+ $(LIBTOOL) --mode=link --tag=CXX $(CXX) $(LDFLAGS) -lm -ldl $(BASE_O:.o=-c++.lo) -rpath /usr/lib/$(DEB_HOST_MULTIARCH) -version-info 0:0:0 -Wl,--version-script,../debian/version-script -o liblua5.2-c++.la
$(LUA_T): $(LUA_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) $(LIBS) -Wl,--version-script,../debian/version-script -static liblua5.2.la -Wl,-E lua.lo -o $@
$(LUAC_T): $(LUAC_O) $(LUA_A)
- $(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+ $(LIBTOOL) --mode=link --tag=CC $(CC) $(LDFLAGS) -Wl,--version-script,../debian/version-script -static liblua5.2.la luac.lo -o $@
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -125,6 +130,10 @@ solaris:
# DO NOT DELETE
+%.o:%.c
+ $(LIBTOOL) --mode=compile --tag=CC $(CC) $(CFLAGS) -c $< -o $@
+ $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(CFLAGS) -c $< -o $*-c++.o
+
lapi.o: lapi.c lua.h luaconf.h lapi.h llimits.h lstate.h lobject.h ltm.h \
lzio.h lmem.h ldebug.h ldo.h lfunc.h lgc.h lstring.h ltable.h lundump.h \
lvm.h

40
debian/patches/0002-debian-paths.patch vendored Normal file
View File

@ -0,0 +1,40 @@
From: Enrico Tassi <gareuselesinge@debian.org>
Date: Sun, 30 Jun 2013 22:55:45 +0200
Subject: debian-paths
===================================================================
---
src/luaconf.h | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/luaconf.h b/src/luaconf.h
index 1b0ff59..e0b1a13 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -98,16 +98,23 @@
LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll;" ".\\?.dll"
#else /* }{ */
-
+/* This defines DEB_HOST_MULTIARCH */
+#include "lua5.2-deb-multiarch.h"
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT2 "/usr/"
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
+#define LUA_LDIR2 LUA_ROOT2 "share/lua/" LUA_VDIR
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
+#define LUA_CDIR2 LUA_ROOT2 "lib/" DEB_HOST_MULTIARCH "/lua/" LUA_VDIR
+#define LUA_CDIR3 LUA_ROOT2 "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" "./?.lua"
+ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
+ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua;" "./?.lua"
#define LUA_CPATH_DEFAULT \
- LUA_CDIR"?.so;" LUA_CDIR"loadall.so;" "./?.so"
+ LUA_CDIR"?.so;" LUA_CDIR2"?.so;" \
+ LUA_CDIR3"?.so;" LUA_CDIR"loadall.so;" "./?.so"
#endif /* } */

24
debian/patches/0003-extern_C.patch vendored Normal file
View File

@ -0,0 +1,24 @@
From: Enrico Tassi <gareuselesinge@debian.org>
Date: Fri, 14 Aug 2015 10:16:57 +0200
Subject: extern_C
---
src/luaconf.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/luaconf.h b/src/luaconf.h
index e0b1a13..c323b7f 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -157,7 +157,11 @@
#else /* }{ */
+#ifdef __cplusplus
+#define LUA_API extern "C"
+#else
#define LUA_API extern
+#endif
#endif /* } */

3
debian/patches/series vendored Normal file
View File

@ -0,0 +1,3 @@
0001-debian-make.patch
0002-debian-paths.patch
0003-extern_C.patch

66
debian/rules vendored Executable file
View File

@ -0,0 +1,66 @@
#!/usr/bin/make -f
ifeq (hurd,$(shell dpkg-architecture -qDEB_HOST_ARCH_OS))
MYLIBS=-lpthread
endif
%:
dh $@
override_dh_auto_build:
$(MAKE) linux \
MYCFLAGS="$(CFLAGS)" \
MYLDFLAGS="$(LDFLAGS)" \
MYLIBS=$(MYLIBS)
PKG_DIR=debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/
PKG_CONFIG_FILE=$(PKG_DIR)/lua5.2.pc
PKG_CONFIG_FILE_FBSD=$(PKG_DIR)/lua-5.2.pc
PKG_CONFIG_FILE_NODOT=$(PKG_DIR)/lua52.pc
PKGPP_CONFIG_FILE=$(PKG_DIR)/lua5.2-c++.pc
PKGPP_CONFIG_FILE_FBSD=$(PKG_DIR)/lua-5.2-c++.pc
PKGPP_CONFIG_FILE_NODOT=$(PKG_DIR)/lua52-c++.pc
LUA_MULTIARCH_INCLUDE = debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/
LUA_MULTIARCH = lua5.2-deb-multiarch.h
override_dh_auto_configure:
echo "#ifndef _LUA_DEB_MULTIARCH_" > src/$(LUA_MULTIARCH)
echo "#define _LUA_DEB_MULTIARCH_" >> src/$(LUA_MULTIARCH)
echo "#define DEB_HOST_MULTIARCH \"$(DEB_HOST_MULTIARCH)\"" >> \
src/$(LUA_MULTIARCH)
echo "#endif" >> src/$(LUA_MULTIARCH)
override_dh_auto_install:
dh_auto_install
mkdir -p `dirname $(PKG_CONFIG_FILE)`
echo "prefix=/usr" > $(PKG_CONFIG_FILE)
echo "major_version=5.2" >> $(PKG_CONFIG_FILE)
echo "version=5.2.0" >> $(PKG_CONFIG_FILE)
echo "lib_name_include=lua5.2" >> $(PKG_CONFIG_FILE)
echo "deb_host_multiarch=$(DEB_HOST_MULTIARCH)" >> $(PKG_CONFIG_FILE)
cat debian/lua.pc.in >> $(PKG_CONFIG_FILE)
ln -s $(shell basename $(PKG_CONFIG_FILE)) $(PKG_CONFIG_FILE_FBSD)
ln -s $(shell basename $(PKG_CONFIG_FILE)) $(PKG_CONFIG_FILE_NODOT)
echo "prefix=/usr" > $(PKGPP_CONFIG_FILE)
echo "major_version=5.2" >> $(PKGPP_CONFIG_FILE)
echo "version=5.2.0" >> $(PKGPP_CONFIG_FILE)
echo "lib_name_include=lua5.2" >> $(PKGPP_CONFIG_FILE)
echo "deb_host_multiarch=$(DEB_HOST_MULTIARCH)" >> $(PKGPP_CONFIG_FILE)
cat debian/lua-c++.pc.in >> $(PKGPP_CONFIG_FILE)
ln -s $(shell basename $(PKGPP_CONFIG_FILE)) $(PKGPP_CONFIG_FILE_FBSD)
ln -s $(shell basename $(PKGPP_CONFIG_FILE)) $(PKGPP_CONFIG_FILE_NODOT)
cat doc/lua.1 | sed 's/TH LUA 1/TH LUA5.2 1/' > lua5.2.1
cat doc/luac.1 | sed 's/TH LUAC 1/TH LUAC5.2 1/' > luac5.2.1
mkdir -p $(LUA_MULTIARCH_INCLUDE)
cp src/$(LUA_MULTIARCH) $(LUA_MULTIARCH_INCLUDE)
mkdir -p debian/tmp/usr/share/lua5.2/
cp debian/version-script debian/tmp/usr/share/lua5.2/
override_dh_auto_clean:
dh_auto_clean
rm -f lua5.2.1 luac5.2.1
rm -f src/$(LUA_MULTIARCH)
override_dh_strip:
dh_strip --dbg-package=liblua5.2-0-dbg

1
debian/source/format vendored Normal file
View File

@ -0,0 +1 @@
3.0 (quilt)

168
debian/version-script vendored Normal file
View File

@ -0,0 +1,168 @@
LUA_5.2 {
global:
lua_absindex;
lua_arith;
lua_atpanic;
lua_callk;
lua_checkstack;
lua_close;
lua_compare;
lua_concat;
lua_copy;
lua_createtable;
lua_dump;
lua_error;
lua_gc;
lua_getallocf;
lua_getctx;
lua_getfield;
lua_getglobal;
lua_gethook;
lua_gethookcount;
lua_gethookmask;
lua_getinfo;
lua_getlocal;
lua_getmetatable;
lua_getstack;
lua_gettable;
lua_gettop;
lua_getupvalue;
lua_getuservalue;
lua_ident;
lua_insert;
lua_iscfunction;
lua_isnumber;
lua_isstring;
lua_isuserdata;
lua_len;
lua_load;
lua_newstate;
lua_newthread;
lua_newuserdata;
lua_next;
lua_pcallk;
lua_pushboolean;
lua_pushcclosure;
lua_pushfstring;
lua_pushinteger;
lua_pushlightuserdata;
lua_pushlstring;
lua_pushnil;
lua_pushnumber;
lua_pushstring;
lua_pushthread;
lua_pushunsigned;
lua_pushvalue;
lua_pushvfstring;
lua_rawequal;
lua_rawget;
lua_rawgeti;
lua_rawgetp;
lua_rawlen;
lua_rawset;
lua_rawseti;
lua_rawsetp;
lua_remove;
lua_replace;
lua_resume;
lua_setallocf;
lua_setfield;
lua_setglobal;
lua_sethook;
lua_setlocal;
lua_setmetatable;
lua_settable;
lua_settop;
lua_setupvalue;
lua_setuservalue;
lua_status;
lua_toboolean;
lua_tocfunction;
lua_tointegerx;
lua_tolstring;
lua_tonumberx;
lua_topointer;
lua_tothread;
lua_tounsignedx;
lua_touserdata;
lua_type;
lua_typename;
lua_upvalueid;
lua_upvaluejoin;
lua_version;
lua_xmove;
lua_yieldk;
luaL_addlstring;
luaL_addstring;
luaL_addvalue;
luaL_argerror;
luaL_buffinit;
luaL_buffinitsize;
luaL_callmeta;
luaL_checkany;
luaL_checkinteger;
luaL_checklstring;
luaL_checknumber;
luaL_checkoption;
luaL_checkstack;
luaL_checktype;
luaL_checkudata;
luaL_checkunsigned;
luaL_checkversion_;
luaL_error;
luaL_execresult;
luaL_fileresult;
luaL_getmetafield;
luaL_getsubtable;
luaL_gsub;
luaL_len;
luaL_loadbufferx;
luaL_loadfilex;
luaL_loadstring;
luaL_newmetatable;
luaL_newstate;
luaL_openlib;
luaL_openlibs;
luaL_optinteger;
luaL_optlstring;
luaL_optnumber;
luaL_optunsigned;
luaL_prepbuffsize;
luaL_pushmodule;
luaL_pushresult;
luaL_pushresultsize;
luaL_ref;
luaL_requiref;
luaL_setfuncs;
luaL_setmetatable;
luaL_testudata;
luaL_tolstring;
luaL_traceback;
luaL_unref;
luaL_where;
luaopen_base;
luaopen_bit32;
luaopen_coroutine;
luaopen_debug;
luaopen_io;
luaopen_math;
luaopen_os;
luaopen_package;
luaopen_string;
luaopen_table;
/* The _IO_stdin_used symbol is used by the GNU libc determine
which version of the I/O function should be used. Not
exporting it means that the "old" version is used, causing
crashes or other issues on some architectures. It should be
exported as an anonymous tag, but ld does not support mixing
anonymous version tags with other version tags. Fortunately
the GNU libc is able to cope with the symbol having the wrong
version tag. */
_IO_stdin_used;
local :
*;
};

5
debian/watch vendored Normal file
View File

@ -0,0 +1,5 @@
# test this watch file using:
# uscan --watchfile debian/watch --upstream-version 0.0.1 --package lua5.2
#
version=3
http://www.lua.org/ftp/ lua-(5.2.\d).tar.gz