debian/0000755000000000000000000000000012202444551007165 5ustar debian/lua50.prerm0000644000000000000000000000037712202414617011171 0ustar #!/bin/sh set -e if [ "$1" != "upgrade" ]; then update-alternatives --remove lua-compiler /usr/bin/luac50 update-alternatives --remove lua-interpreter /usr/bin/lua50 update-alternatives --remove lua-configuration /usr/bin/lua-config50 fi #DEBHELPER# debian/liblualib50-dev.links0000644000000000000000000000006312202414617013106 0ustar usr/lib/liblualib50.so.5.0 usr/lib/liblualib50.so debian/liblua50-dev.prerm0000644000000000000000000000020712202414617012424 0ustar #!/bin/sh set -e if [ "$1" != "upgrade" ]; then update-alternatives --remove lua-configuration /usr/bin/lua-config50 fi #DEBHELPER# debian/liblua50.install0000644000000000000000000000004312202414617012167 0ustar debian/tmp/usr/lib/liblua50.so.5.0 debian/lua50.install0000644000000000000000000000020012202414617011473 0ustar debian/tmp/usr/bin/lua50 debian/tmp/usr/bin/luac50 debian/tmp/usr/share/man/man1/lua50.1 debian/tmp/usr/share/man/man1/luac50.1 debian/lua50-doc.install0000644000000000000000000000006612202414617012250 0ustar doc/*.gif doc/*.html usr/share/doc/lua50-doc/manual debian/liblua50-dev.links0000644000000000000000000000013012202414617012412 0ustar usr/lib/liblua50.so.5.0 usr/lib/liblua50.so usr/include/lua50 usr/include/lua50/lua debian/watch0000644000000000000000000000006712202414617010221 0ustar version=3 http://www.lua.org/ftp/lua-(5\.0.*)\.tar\.gz debian/README.source0000644000000000000000000000006712202414617011347 0ustar Please refer to /usr/share/doc/dpatch/README.source.gz debian/lua50.examples0000644000000000000000000000002712202414617011652 0ustar test/README test/*.lua debian/rules0000755000000000000000000000343412202414617010251 0ustar #!/usr/bin/make -f # Hey Emacs, this is a -*- Makefile -*- # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 include /usr/share/quilt/quilt.make # -Wall added by config. MYCFLAGS = -g ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) MYCFLAGS += -O0 else MYCFLAGS += -O2 endif build: build-stamp build-stamp: patch dh_testdir # Well, this does it all. $(MAKE) MYCFLAGS="$(MYCFLAGS)" all so sobin touch build-stamp clean: patch clean1 unpatch clean1: dh_testdir dh_testroot rm -f build-stamp # Toplevel clean does it all $(MAKE) clean soclean dh_clean install: build dh_testdir dh_testroot dh_clean -k dh_installdirs $(MAKE) PREFIX=$(CURDIR)/debian/tmp install soinstall # Perform a mapping for the '50' suffix where needed mv debian/tmp/usr/bin/lua debian/tmp/usr/bin/lua50 mv debian/tmp/usr/bin/luac debian/tmp/usr/bin/luac50 mv debian/tmp/usr/share/man/man1/lua.1 debian/tmp/usr/share/man/man1/lua50.1 mv debian/tmp/usr/share/man/man1/luac.1 debian/tmp/usr/share/man/man1/luac50.1 # Build architecture-independent files here. binary-indep: build install dh_install -i dh_testdir -i dh_testroot -i dh_installchangelogs -i dh_installdocs -i dh_installexamples -i dh_link -i dh_compress -i dh_fixperms -i dh_installdeb -i dh_gencontrol -i dh_md5sums -i dh_builddeb -i # Build architecture-dependent files here. binary-arch: build install dh_install -a dh_testdir -a dh_testroot -a dh_installchangelogs -a dh_installdocs -a dh_installexamples -a dh_strip -a dh_link -a dh_compress -a dh_fixperms -a dh_makeshlibs -a -V dh_installdeb -a dh_shlibdeps -a -ldebian/liblua50/usr/lib:debian/liblualib50/usr/lib dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install debian/NEWS0000644000000000000000000000114412202414617007664 0ustar lua50 (5.0.3-2) unstable; urgency=low lua40 compatibility layer has been removed. No more -C switch and compat.lua file installed. Install lua40 instead. lua5.1 compatibility layer added, integrating compat-5.1r5. compat-5.1.lua is shipped with liblualib50 and the C counterpart is linked in the library- compat-5.1.h is inside liblualib50-dev. Standard path changed, according to the lua5.1 standards. Old paths are still supported. /usr/share/lua50 -> /usr/share/lua/50 /usr/lib/lua50 -> /usr/lib/lua/50 -- Enrico Tassi Thu, 14 Sep 2006 11:29:09 +0200 debian/liblua50-dev.install0000644000000000000000000000023412202414617012745 0ustar debian/tmp/usr/lib/liblua50.a debian/tmp/usr/include/lua50/lua.h lua-config50 usr/bin lua-config50.1 usr/share/man/man1 lua50.pc usr/lib/pkgconfig debian/lua50-doc.links0000644000000000000000000000007312202414617011720 0ustar usr/share/doc/lua50-doc/manual usr/share/doc/lua50/manual debian/compat0000644000000000000000000000000212202414617010363 0ustar 5 debian/liblualib50.install0000644000000000000000000000011012202414617012651 0ustar debian/tmp/usr/lib/liblualib50.so.5.0 debian/tmp/usr/share/lua/50/*.lua debian/liblua50-dev.postinst0000644000000000000000000000052312202414617013163 0ustar #!/bin/sh set -e if [ "$1" = "configure" ]; then # For now, just update the alternatives set to include us. update-alternatives --install /usr/bin/lua-config lua-configuration /usr/bin/lua-config50 80 --slave /usr/share/man/man1/lua-config.1.gz lua-configuration-manual /usr/share/man/man1/lua-config50.1.gz fi # Configure #DEBHELPER# debian/liblua50.links0000644000000000000000000000006012202414617011640 0ustar usr/lib/liblua50.so.5.0 usr/lib/liblua50.so.5 debian/source/0000755000000000000000000000000012202414617010465 5ustar debian/source/format0000644000000000000000000000001412202414617011673 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000001416612202414617011047 0ustar lua50 (5.0.3-7) unstable; urgency=low * Package moved to git -- Enrico Tassi Sat, 23 Jul 2011 10:52:03 +0200 lua50 (5.0.3-6) unstable; urgency=low * source format 3.0 (quilt) -- Enrico Tassi Sat, 23 Jul 2011 10:49:26 +0200 lua50 (5.0.3-5) unstable; urgency=low * Build-depend on libreadline-dev (Closes: #553806) * Bump standards-versiont to 3.9.2, no changes * Depend on ${misc:Depends} to make lintian happy -- Enrico Tassi Wed, 20 Jul 2011 11:32:31 +0200 lua50 (5.0.3-4) unstable; urgency=low * cheange lua to Lua in package description * updated Vcs-* fields * bumped standards-version to 3.8.3 * added README.source * fixed doc-base section, now it is Programming -- Enrico Tassi Sun, 27 Sep 2009 18:47:28 +0200 lua50 (5.0.3-3) unstable; urgency=low * made control file binNMU safe * commented out upstream strip of binaries (Closes: #437542) -- Enrico Tassi Sat, 16 Sep 2006 13:34:43 +0200 lua50 (5.0.3-2) unstable; urgency=low * Removed compatibility layer with lua40 (both compat.lua and -C switch). * Added compat-5.1r5 to liblualib50 (both the .o and the .lua). * Added LUA_CPATH environment variable and fixed LUA_PATH to include /usr/share/lua/50 (/usr/share/lua50 is preserved for backward compatibility). * Fixed .pc to report the correct version and to include the definition of INSTALL_LMOD and INSTALL_CMOD. -- Enrico Tassi Fri, 15 Sep 2006 17:34:57 +0200 lua50 (5.0.3-1) unstable; urgency=low * New upstream release (Closes: #378764) * Applied patch to fix -l (Closes: #370633) * The current interpreter returns 1 in case of fatal error (Closes: #359132) * Enrico Tassi adopted lua50 (Closes: #339009) * Updated standards to 3.7.2 -- Enrico Tassi Thu, 10 Aug 2006 10:45:57 +0200 lua50 (5.0.2-6) unstable; urgency=low * QA upload. * Package is orphaned (#339009); set maintainer to Debian QA Group. * Acknowledge NMU. Closes: #326327. * Switch to debhelper 5. * Make liblua50-dev and liblualib50-dev depend on exact versions of liblua50 and liblualib50 respectively (per Policy 8.5). * Make liblua50-dev and liblualib50-dev depend on libc6-dev. * Remove Lintian override for `unusual-interpreter #!/usr/bin/lua50'; this is a bug in Lintian (#361644). * debian/lua50-doc.doc-base: Fix authors list. * debian/liblua50-dev.postinst, debian/liblua50-dev.prerm, debian/lua50.postinst, debian/lua50.prerm: Use `set -e'. * debian/rules: Add support for DEB_BUILD_OPTIONS=noopt. * debian/watch: Add. * Conforms to Standards version 3.6.2. -- Matej Vela Sun, 9 Apr 2006 16:02:28 +0200 lua50 (5.0.2-5.1) unstable; urgency=low * Non Maintainer Upload * Build-Depend on libreadline5-dev instead of libreadline4 (closes: #326327) -- Don Armstrong Sat, 24 Dec 2005 04:13:30 -0800 lua50 (5.0.2-5) unstable; urgency=low * Missed a place where calling do_path() is kinda important in lua.c -- Daniel Silverstone Thu, 5 Aug 2004 22:03:23 +0100 lua50 (5.0.2-4) unstable; urgency=low * The "Suddenly the Dungeon collapses!! - You die..." release * Added in a patch so that if pclose() returns -1 and errno is ECHILD then assume the pclose() succeeded rather than calling fclose() on the FILE* and thus rendering the world a very unpleasant place to call malloc() in. -- Daniel Silverstone Tue, 27 Jul 2004 01:11:53 +0100 lua50 (5.0.2-3) unstable; urgency=low * Fold in a patch from Reuben Thomas, integrating the signal and error code from Fedora Core. Thanks Reuben. * Lintian cleanups (recursive symlink stays, sorry) -- Daniel Silverstone Thu, 3 Jun 2004 14:35:00 -0300 lua50 (5.0.2-2) unstable; urgency=low * Update the link line for liblualib50.so so that it gets -ldl too -- Daniel Silverstone Wed, 26 May 2004 12:10:36 -0300 lua50 (5.0.2-1) unstable; urgency=low * New upstream release Closes: #223259 - This includes many bug fixes * Forward-ported the fixed makesystem to build shared objects etc. -- Daniel Silverstone Thu, 18 Mar 2004 17:48:04 +0000 lua50 (5.0-5) unstable; urgency=low * Fixed the doc-base part of lua50-doc Closes: #224247 * Fixed handling of --extralibs for lua-config50 Closes: #226143 * Fixed handling of --version for lua-config50 Closes: #226295 * Included a lua50.pc for pkg-config and recommended pkg-config for the liblua50-dev package. Also included a lualib50.pc and these together solve a portability issue. Closes: #226353 * Updated the lua-config50 manpage to reflect the above. -- Daniel Silverstone Tue, 6 Jan 2004 23:37:48 +0000 lua50 (5.0-4) unstable; urgency=low * Updated a pile of descriptions. Closes: #209899 -- Daniel Silverstone Sun, 14 Sep 2003 21:48:28 +0100 lua50 (5.0-3) unstable; urgency=low * Fix the lua-config50 script a little more * Correct bug to close for previous change: Closes: #198952 * Update standards version to 3.6.0 -- Daniel Silverstone Sat, 19 Jul 2003 11:34:53 +0100 lua50 (5.0-2) unstable; urgency=low * Remembered to put the new lua-config script in. -- Daniel Silverstone Thu, 26 Jun 2003 23:40:23 +0100 lua50 (5.0-1) unstable; urgency=low * Initial release of Lua 5.0 (closes: #188715) * Added better support for building the shared libraries * Added support for -C to load the compatibility library on startup * Added an initial LUA_PATH to support /usr/share/lua50 etc. * Added a -P switch to suppress the LUA_PATH code if need-be * Created a version of lua-config for this release of Lua * Updated the manpage lua.1 for the -C and -P switches * Modified the SO support to work better on HPPA * Rolled in a late-riding change to io.close() to fix a segfault -- Daniel Silverstone Wed, 11 Jun 2003 20:18:57 +0100 debian/liblualib50-dev.install0000644000000000000000000000027112202414617013435 0ustar debian/tmp/usr/lib/liblualib50.a debian/tmp/usr/include/lua50/lauxlib.h debian/tmp/usr/include/lua50/lualib.h debian/tmp/usr/include/lua50/compat-5.1.h lualib50.pc usr/lib/pkgconfig debian/copyright0000644000000000000000000000311412202414617011117 0ustar lua -- debianised by Daniel Silverstone Lua can be found at http://www.lua.org/ Lua License ----------- Lua is licensed under the terms of the MIT license reproduced below. This means that Lua is free software and can be used for both academic and commercial purposes at absolutely no cost. For details and rationale, see http://www.lua.org/license.html . =============================================================================== Copyright (C) 2003,2004 Tecgraf, PUC-Rio. 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. =============================================================================== debian/liblualib50.links0000644000000000000000000000006512202414617012334 0ustar usr/lib/liblualib50.so.5.0 usr/lib/liblualib50.so.5 debian/lua50-doc.doc-base0000644000000000000000000000075012202414617012257 0ustar Document: lua50-doc Title: Lua 5.0 Reference Manual Author: Roberto Ierusalimschy, Luiz Henrique de Figueiredo, Waldemar Celes Abstract: Lua is an extension programming language designed to support general procedural programming with data description facilities. This manual describes version 5.0 of the language and implementation including the C API. Section: Programming Format: HTML Index: /usr/share/doc/lua50-doc/manual/readme.html Files: /usr/share/doc/lua50-doc/manual/*.html debian/control0000644000000000000000000000552412202414617010576 0ustar Source: lua50 Section: interpreters Priority: optional Maintainer: Enrico Tassi Build-Depends: debhelper (>= 5), libreadline-dev, quilt (>= 0.40) Standards-Version: 3.9.2 Homepage: http://www.lua.org Vcs-Git: git://git.debian.org/git/pkg-lua/lua50.git Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua50.git Package: lua50 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Provides: lua Description: Small embeddable language with simple procedural syntax Lua is a programming language originally designed for extending applications, but also frequently used as a general-purpose, stand-alone language. . Lua combines simple procedural syntax (similar to Pascal) with powerful data description constructs based on associative arrays and extensible semantics. Lua is dynamically typed, interpreted from bytecodes, and has automatic memory management, making it ideal for configuration, scripting, and rapid prototyping. Lua is implemented as a small library of C functions, written in ANSI C, and the implementation goals are simplicity, efficiency, portability, and low embedding cost. Package: lua50-doc Architecture: all Recommends: w3m | www-browser Suggests: lua50 Depends: ${misc:Depends} Section: doc Description: Documentation for the Lua 5.0 programming language This is the documentation for the Lua 5.0 programming language. . This package includes the HTML versions of the manual pages and the language manual itself. Package: liblua50 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Section: libs Description: Main interpreter library for the Lua 5.0 programming language Lua is a powerful language which can be included in your C/C++ projects using this library. . For more information, please see the lua50 and lua50-doc packages Package: liblua50-dev Architecture: any Depends: libc6-dev | libc-dev, liblua50 (= ${binary:Version}), lua50, ${misc:Depends} Recommends: pkg-config Section: libdevel Description: Main interpreter library for Lua 5.0: static library and headers Using this package you can develop applications which have Lua interpreters built into them. Package: liblualib50 Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Section: libs Description: Extension library for the Lua 5.0 programming language This package provides string, maths and IO functions to liblua50. . This package will most commonly be installed by programs depending on it or by authors using the liblualib50-dev package Package: liblualib50-dev Architecture: any Depends: libc6-dev | libc-dev, liblua50-dev, liblualib50 (= ${binary:Version}), ${misc:Depends} Recommends: pkg-config Section: libdevel Description: Extension library for Lua 5.0: static and headers This package allows you to link to the Lua standard libraries providing maths, string and IO functions to your Lua based programs. debian/patches/0000755000000000000000000000000012202414617010614 5ustar debian/patches/compat-5.1r5.patch0000644000000000000000000002442712202414617013701 0ustar Author: Enrico Tassi Description: No description. --- /dev/null +++ lua50-5.0.3/src/lib/compat-5.1r5/compat-5.1.c @@ -0,0 +1,97 @@ +/* +** Compat-5.1 +** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat) +** $Id: compat-5.1.c,v 1.13 2006/02/20 21:12:47 carregal Exp $ +*/ + +#include +#include +#include "lua.h" +#include "lauxlib.h" +#include "compat-5.1.h" + +static void getfield(lua_State *L, int idx, const char *name) { + const char *end = strchr(name, '.'); + lua_pushvalue(L, idx); + while (end) { + lua_pushlstring(L, name, end - name); + lua_gettable(L, -2); + lua_remove(L, -2); + if (lua_isnil(L, -1)) return; + name = end+1; + end = strchr(name, '.'); + } + lua_pushstring(L, name); + lua_gettable(L, -2); + lua_remove(L, -2); +} + +static void setfield(lua_State *L, int idx, const char *name) { + const char *end = strchr(name, '.'); + lua_pushvalue(L, idx); + while (end) { + lua_pushlstring(L, name, end - name); + lua_gettable(L, -2); + /* create table if not found */ + if (lua_isnil(L, -1)) { + lua_pop(L, 1); + lua_newtable(L); + lua_pushlstring(L, name, end - name); + lua_pushvalue(L, -2); + lua_settable(L, -4); + } + lua_remove(L, -2); + name = end+1; + end = strchr(name, '.'); + } + lua_pushstring(L, name); + lua_pushvalue(L, -3); + lua_settable(L, -3); + lua_pop(L, 2); +} + +LUALIB_API void luaL_module(lua_State *L, const char *libname, + const luaL_reg *l, int nup) { + if (libname) { + getfield(L, LUA_GLOBALSINDEX, libname); /* check whether lib already exists */ + if (lua_isnil(L, -1)) { + int env, ns; + lua_pop(L, 1); /* get rid of nil */ + lua_pushliteral(L, "require"); + lua_gettable(L, LUA_GLOBALSINDEX); /* look for require */ + lua_getfenv(L, -1); /* getfenv(require) */ + lua_remove(L, -2); /* remove function require */ + env = lua_gettop(L); + + lua_newtable(L); /* create namespace for lib */ + ns = lua_gettop(L); + getfield(L, env, "package.loaded"); /* get package.loaded table */ + if (lua_isnil(L, -1)) { /* create package.loaded table */ + lua_pop(L, 1); /* remove previous result */ + lua_newtable(L); + lua_pushvalue(L, -1); + setfield(L, env, "package.loaded"); + } + else if (!lua_istable(L, -1)) + luaL_error(L, "name conflict for library `%s'", libname); + lua_pushstring(L, libname); + lua_pushvalue(L, ns); + lua_settable(L, -3); /* package.loaded[libname] = ns */ + lua_pop(L, 1); /* get rid of package.loaded table */ + lua_pushvalue(L, ns); /* copy namespace */ + setfield(L, LUA_GLOBALSINDEX, libname); + lua_remove (L, env); /* remove env */ + } + lua_insert(L, -(nup+1)); /* move library table to below upvalues */ + } + for (; l->name; l++) { + int i; + lua_pushstring(L, l->name); + for (i=0; ifunc, nup); + lua_settable(L, -(nup+3)); + } + lua_pop(L, nup); /* remove upvalues */ +} + --- /dev/null +++ lua50-5.0.3/src/lib/compat-5.1r5/compat-5.1.h @@ -0,0 +1,13 @@ +/* +** Compat-5.1 +** Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat/) +** $Id: compat-5.1.h,v 1.8 2006/02/20 21:12:47 carregal Exp $ +*/ + +#ifndef COMPAT_H + +LUALIB_API void luaL_module(lua_State *L, const char *libname, + const luaL_reg *l, int nup); +#define luaL_openlib luaL_module + +#endif --- /dev/null +++ lua50-5.0.3/src/lib/compat-5.1r5/compat-5.1.lua @@ -0,0 +1,267 @@ +-- +-- Compat-5.1 +-- Copyright Kepler Project 2004-2006 (http://www.keplerproject.org/compat) +-- According to Lua 5.1 +-- $Id: compat-5.1.lua,v 1.22 2006/02/20 21:12:47 carregal Exp $ +-- + +_COMPAT51 = "Compat-5.1 R5" + +local LUA_DIRSEP = '/' +local LUA_OFSEP = '_' +local OLD_LUA_OFSEP = '' +local POF = 'luaopen_' +local LUA_PATH_MARK = '?' +local LUA_IGMARK = ':' + +local assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type = assert, error, getfenv, ipairs, loadfile, loadlib, pairs, setfenv, setmetatable, type +local find, format, gfind, gsub, sub = string.find, string.format, string.gfind, string.gsub, string.sub + +-- +-- avoid overwriting the package table if it's already there +-- +package = package or {} +local _PACKAGE = package + +package.path = LUA_PATH or os.getenv("LUA_PATH") or + ("./?.lua;" .. + "/usr/local/share/lua/5.0/?.lua;" .. + "/usr/local/share/lua/5.0/?/?.lua;" .. + "/usr/local/share/lua/5.0/?/init.lua" ) + +package.cpath = LUA_CPATH or os.getenv("LUA_CPATH") or + "./?.so;" .. + "./l?.so;" .. + "/usr/local/lib/lua/5.0/?.so;" .. + "/usr/local/lib/lua/5.0/l?.so" + +-- +-- make sure require works with standard libraries +-- +package.loaded = package.loaded or {} +package.loaded.debug = debug +package.loaded.string = string +package.loaded.math = math +package.loaded.io = io +package.loaded.os = os +package.loaded.table = table +package.loaded.base = _G +package.loaded.coroutine = coroutine +local _LOADED = package.loaded + +-- +-- avoid overwriting the package.preload table if it's already there +-- +package.preload = package.preload or {} +local _PRELOAD = package.preload + + +-- +-- looks for a file `name' in given path +-- +local function findfile (name, pname) + name = gsub (name, "%.", LUA_DIRSEP) + local path = _PACKAGE[pname] + assert (type(path) == "string", format ("package.%s must be a string", pname)) + for c in gfind (path, "[^;]+") do + c = gsub (c, "%"..LUA_PATH_MARK, name) + local f = io.open (c) + if f then + f:close () + return c + end + end + return nil -- not found +end + + +-- +-- check whether library is already loaded +-- +local function loader_preload (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + assert (type(_PRELOAD) == "table", "`package.preload' must be a table") + return _PRELOAD[name] +end + + +-- +-- Lua library loader +-- +local function loader_Lua (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local filename = findfile (name, "path") + if not filename then + return false + end + local f, err = loadfile (filename) + if not f then + error (format ("error loading module `%s' (%s)", name, err)) + end + return f +end + + +local function mkfuncname (name) + name = gsub (name, "^.*%"..LUA_IGMARK, "") + name = gsub (name, "%.", LUA_OFSEP) + return POF..name +end + +local function old_mkfuncname (name) + --name = gsub (name, "^.*%"..LUA_IGMARK, "") + name = gsub (name, "%.", OLD_LUA_OFSEP) + return POF..name +end + +-- +-- C library loader +-- +local function loader_C (name) + assert (type(name) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local filename = findfile (name, "cpath") + if not filename then + return false + end + local funcname = mkfuncname (name) + local f, err = loadlib (filename, funcname) + if not f then + funcname = old_mkfuncname (name) + f, err = loadlib (filename, funcname) + if not f then + error (format ("error loading module `%s' (%s)", name, err)) + end + end + return f +end + + +local function loader_Croot (name) + local p = gsub (name, "^([^.]*).-$", "%1") + if p == "" then + return + end + local filename = findfile (p, "cpath") + if not filename then + return + end + local funcname = mkfuncname (name) + local f, err, where = loadlib (filename, funcname) + if f then + return f + elseif where ~= "init" then + error (format ("error loading module `%s' (%s)", name, err)) + end +end + +-- create `loaders' table +package.loaders = package.loaders or { loader_preload, loader_Lua, loader_C, loader_Croot, } +local _LOADERS = package.loaders + + +-- +-- iterate over available loaders +-- +local function load (name, loaders) + -- iterate over available loaders + assert (type (loaders) == "table", "`package.loaders' must be a table") + for i, loader in ipairs (loaders) do + local f = loader (name) + if f then + return f + end + end + error (format ("module `%s' not found", name)) +end + +-- sentinel +local sentinel = function () end + +-- +-- new require +-- +function _G.require (modname) + assert (type(modname) == "string", format ( + "bad argument #1 to `require' (string expected, got %s)", type(name))) + local p = _LOADED[modname] + if p then -- is it there? + if p == sentinel then + error (format ("loop or previous error loading module '%s'", modname)) + end + return p -- package is already loaded + end + local init = load (modname, _LOADERS) + _LOADED[modname] = sentinel + local actual_arg = _G.arg + _G.arg = { modname } + local res = init (modname) + if res then + _LOADED[modname] = res + end + _G.arg = actual_arg + if _LOADED[modname] == sentinel then + _LOADED[modname] = true + end + return _LOADED[modname] +end + + +-- findtable +local function findtable (t, f) + assert (type(f)=="string", "not a valid field name ("..tostring(f)..")") + local ff = f.."." + local ok, e, w = find (ff, '(.-)%.', 1) + while ok do + local nt = rawget (t, w) + if not nt then + nt = {} + t[w] = nt + elseif type(t) ~= "table" then + return sub (f, e+1) + end + t = nt + ok, e, w = find (ff, '(.-)%.', e+1) + end + return t +end + +-- +-- new package.seeall function +-- +function _PACKAGE.seeall (module) + local t = type(module) + assert (t == "table", "bad argument #1 to package.seeall (table expected, got "..t..")") + local meta = getmetatable (module) + if not meta then + meta = {} + setmetatable (module, meta) + end + meta.__index = _G +end + + +-- +-- new module function +-- +function _G.module (modname, ...) + local ns = _LOADED[modname] + if type(ns) ~= "table" then + ns = findtable (_G, modname) + if not ns then + error (string.format ("name conflict for module '%s'", modname)) + end + _LOADED[modname] = ns + end + if not ns._NAME then + ns._NAME = modname + ns._M = ns + ns._PACKAGE = gsub (modname, "[^.]*$", "") + end + setfenv (2, ns) + for i, f in ipairs (arg) do + f (ns) + end +end debian/patches/interpreter.patch0000644000000000000000000001425512202414617014207 0ustar Author: John V. Belmonte Description: Add support for Debian package to makefiles. --- lua50-5.0.3.orig/doc/lua.1 +++ lua50-5.0.3/doc/lua.1 @@ -152,6 +152,10 @@ .TP .B \-v show version information. +.TP +.B \-P +suppress the creation of a standard LUA_PATH variable. Use this if +you need to run scripts which conflict with system-installed libraries. .SH "SEE ALSO" .BR luac (1) .br @@ -163,5 +167,11 @@ L. H. de Figueiredo, and W. Celes -(lua@tecgraf.puc-rio.br) +.LP +.BI +.LP +Debian modifications to the manpage by +Daniel Silverstone +.LP +.BI .\" EOF --- lua50-5.0.3.orig/src/lua/lua.c +++ lua50-5.0.3/src/lua/lua.c @@ -65,7 +65,100 @@ static const char *progname = PROGNAME; +/* These bits are added for Debian's -P functionality */ +static int done_path = 0; +static int suppress_path = 0; + +static const char* paths[] = { + "~/.lua50", + "~/share/lua/50", // backward compatibility for the lua package + "~/share/lua50", + "/usr/share/lua/50", + "/usr/share/lua50", // backward compatibility for the lua package + "/usr/local/share/lua50", + NULL +}; + +static const char* cpaths[] = { + "~/.lua50", + "~/lib/lua/50", + "~/lib/lua50", // backward compatibility for the lua package + "/usr/lib/lua/50", + "/usr/lib/lua50", // backward compatibility for the lua package + "/usr/local/lib/lua50", + NULL +}; + +static void do_path() +{ + const char** p = paths; + int any; + if( done_path || suppress_path ) return; + if( ! L ) return; + done_path = 1; + lua_pushliteral(L,"LUA_PATH"); + lua_pushliteral(L,""); + while( *p ) { + any = 0; + if( **p == '~' ) { + const char* home = getenv("HOME"); + if( home ) { + lua_pushstring(L,home); + lua_pushstring(L,*p+1); + lua_pushliteral(L,"/?.lua;"); + lua_pushstring(L,home); + lua_pushstring(L,*p+1); + lua_pushliteral(L,"/?;"); + any = 6; + } + } else { + lua_pushstring(L,*p); + lua_pushliteral(L,"/?.lua;"); + lua_pushstring(L,*p); + lua_pushliteral(L,"/?;"); + any = 4; + } + if( any ) { + lua_concat(L,any+1); + } + p++; + } + lua_pushliteral(L, "?.lua;?"); + lua_concat(L,2); + lua_settable(L, LUA_GLOBALSINDEX); + p=cpaths; + lua_pushliteral(L,"LUA_CPATH"); + lua_pushliteral(L,""); + while( *p ) { + any = 0; + if( **p == '~' ) { + const char* home = getenv("HOME"); + if( home ) { + lua_pushstring(L,home); + lua_pushstring(L,*p+1); + lua_pushliteral(L,"/?.so;"); + lua_pushstring(L,home); + lua_pushstring(L,*p+1); + lua_pushliteral(L,"/?;"); + any = 6; + } + } else { + lua_pushstring(L,*p); + lua_pushliteral(L,"/?.so;"); + lua_pushstring(L,*p); + lua_pushliteral(L,"/?;"); + any = 4; + } + if( any ) { + lua_concat(L,any+1); + } + p++; + } + lua_pushliteral(L, "?.so;?"); + lua_concat(L,2); + lua_settable(L, LUA_GLOBALSINDEX); +} static const luaL_reg lualibs[] = { {"base", luaopen_base}, @@ -85,13 +178,12 @@ static void lstop (lua_State *l, lua_Debug *ar) { (void)ar; /* unused arg. */ lua_sethook(l, NULL, 0, 0); - luaL_error(l, "interrupted!"); + lua_pushnil(l); + lua_error(l); } static void laction (int i) { - signal(i, SIG_DFL); /* if another SIGINT happens before lstop, - terminate process (default action) */ lua_sethook(L, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); } @@ -105,6 +197,8 @@ " -i enter interactive mode after executing `script'\n" " -l name load and run library `name'\n" " -v show version information\n" + " -P suppress the setting of LUA_PATH. If not specified\n" + " very early, this setting may not take effect.\n" " -- stop handling options\n" , progname); } @@ -120,23 +214,42 @@ const char *msg; if (status) { msg = lua_tostring(L, -1); - if (msg == NULL) msg = "(error with no message)"; - l_message(progname, msg); + if (msg == NULL) { + const char *str; + lua_getglobal(L, "LUA_DEFAULT_ERROR"); /* try global variable */ + str = lua_tostring(L, -1); + lua_pop(L, 1); + if (str) { + if (*str != '\0') msg = str; + } else msg = "(error with no message)"; + } + if (msg) l_message(progname, msg); lua_pop(L, 1); } return status; } +static void sig_catch(int sig, void (*handler)(int)) +{ + struct sigaction sa; + sa.sa_handler = handler; + sa.sa_flags = 0; + sigemptyset(&sa.sa_mask); + sigaction(sig, &sa, 0); /* XXX ignores errors */ +} + static int lcall (int narg, int clear) { int status; int base = lua_gettop(L) - narg; /* function index */ + do_path(); + //lua_settop(L,base); lua_pushliteral(L, "_TRACEBACK"); lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ lua_insert(L, base); /* put it under chunk and args */ - signal(SIGINT, laction); + sig_catch(SIGINT, laction); status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); - signal(SIGINT, SIG_DFL); + sig_catch(SIGINT, SIG_DFL); lua_remove(L, base); /* remove traceback function */ return status; } @@ -179,6 +292,7 @@ static int load_file (const char *name) { + do_path(); lua_pushliteral(L, "require"); lua_rawget(L, LUA_GLOBALSINDEX); if (!lua_isfunction(L, -1)) { /* no `require' defined? */ @@ -279,6 +393,7 @@ int status; const char *oldprogname = progname; progname = NULL; + do_path(); while ((status = load_string()) != -1) { if (status == 0) status = lcall(0, 0); report(status); @@ -352,6 +467,12 @@ return 1; /* stop if file fails */ break; } + case 'P': { + if( done_path ) + l_message(progname, "option `-P' is too late, ignored"); + suppress_path = 1; + break; + } case 'c': { l_message(progname, "option `-c' is deprecated"); break; @@ -413,6 +534,7 @@ status = handle_luainit(); if (status == 0) { status = handle_argv(s->argv, &interactive); + do_path(); if (status == 0 && interactive) manual_input(); } s->status = status; debian/patches/series0000644000000000000000000000012312202414617012025 0ustar interpreter.patch lua-config.patch pkg-config.patch compat-5.1r5.patch build.patch debian/patches/build.patch0000644000000000000000000001401012202414617012730 0ustar Author: John V. Belmonte Description: Add support for Debian package to makefiles. --- lua50-5.0.3.orig/Makefile +++ lua50-5.0.3/Makefile @@ -26,21 +26,29 @@ # remove debug information from binaries strip: - $(STRIP) bin/* + #$(STRIP) bin/* # official installation install: all strip mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN) + mkdir -p $(INSTALL_SHARE) $(INSTALL_EXEC) bin/* $(INSTALL_BIN) $(INSTALL_DATA) include/*.h $(INSTALL_INC) + $(INSTALL_DATA) src/lib/compat-5.1r5/*.h $(INSTALL_INC) $(INSTALL_DATA) lib/*.a $(INSTALL_LIB) $(INSTALL_DATA) doc/*.1 $(INSTALL_MAN) + $(INSTALL_DATA) src/lib/compat-5.1r5/compat-5.1.lua $(INSTALL_SHARE) # shared libraries (for Linux) so: - ld -o lib/liblua.so.$V -shared src/*.o - ld -o lib/liblualib.so.$V -shared src/lib/*.o - cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so + gcc -o lib/liblua50.so.$V -shared -Wl,-soname,liblua50.so.$V \ + src/*.os -lc + ln -fs liblua50.so.$V lib/liblua-build50.so + gcc -o lib/liblualib50.so.$V -shared -Wl,-soname,liblualib50.so.$V \ + src/lib/*.os src/lib/compat-5.1r5/*.os \ + -Llib -llua-build50 -lm -ldl -lc + cd lib; ln -fs liblua50.so.$V liblua50.so; \ + ln -fs liblualib50.so.$V liblualib50.so # binaries using shared libraries sobin: --- lua50-5.0.3.orig/config +++ lua50-5.0.3/config @@ -25,15 +25,15 @@ # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others), # uncomment the next two lines. # -#LOADLIB= -DUSE_DLOPEN=1 -#DLLIB= -ldl +LOADLIB= -DUSE_DLOPEN=1 +DLLIB= -ldl # # In Linux with gcc, you should also uncomment the next definition for # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option # allows dynamic libraries to link back to the `lua' program, so that they do # not need the Lua libraries. (Other systems may have an equivalent facility.) # -#MYLDFLAGS= -Wl,-E +MYLDFLAGS= -Wl,-E # # On Windows systems. support for dynamic loading is enabled by default. # To disable this support, uncomment the next line. @@ -92,7 +92,7 @@ # or if you are using a modified interpreter that does not need them, # then comment the following line or add the appropriates libraries. # -EXTRA_LIBS= -lm +#EXTRA_LIBS= -lm # If you want to customize the stand-alone Lua interpreter, uncomment and # edit the following two lines; also edit etc/saconfig.c to suit your needs. @@ -100,8 +100,8 @@ # to add -lreadline (and perhaps also -lhistory and -lcurses or -lncurses) # to EXTRA_LIBS. # -#USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE -#EXTRA_LIBS= -lm -ldl -lreadline # -lhistory -lcurses -lncurses +USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE +EXTRA_LIBS= -lreadline -lm -ldl # -lhistory -lcurses -lncurses # ------------------------------------------------------------------ C compiler @@ -148,19 +148,20 @@ # Locations for "make install". You may need to be root do "make install". # -INSTALL_ROOT= /usr/local +INSTALL_ROOT= $(PREFIX)/usr INSTALL_BIN= $(INSTALL_ROOT)/bin -INSTALL_INC= $(INSTALL_ROOT)/include +INSTALL_INC= $(INSTALL_ROOT)/include/lua50 INSTALL_LIB= $(INSTALL_ROOT)/lib -INSTALL_MAN= $(INSTALL_ROOT)/man/man1 +INSTALL_MAN= $(INSTALL_ROOT)/share/man/man1 +INSTALL_SHARE= $(INSTALL_ROOT)/share/lua/50 # You may prefer to use "install" instead of "cp" if you have it. # If you use "install", you may also want to change the permissions after -m. # -INSTALL_EXEC= cp -INSTALL_DATA= cp -#INSTALL_EXEC= install -m 0755 -#INSTALL_DATA= install -m 0644 +#INSTALL_EXEC= cp +#INSTALL_DATA= cp +INSTALL_EXEC= install -m 0755 +INSTALL_DATA= install -m 0644 -p # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE ========= @@ -173,6 +174,10 @@ INCS= -I$(INC) $(EXTRA_INCS) DEFS= $(NUMBER) $(EXTRA_DEFS) -CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS) +CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS) -DINSTALL_SHARE=\"$(INSTALL_SHARE)\" + +# Extra rule for .os files +%.os: %.c + $(CC) $(CFLAGS) -fPIC -DPIC -o $@ -c $< # (end of config) --- lua50-5.0.3.orig/src/Makefile +++ lua50-5.0.3/src/Makefile @@ -67,16 +67,18 @@ lvm.h \ lzio.h -T= $(LIB)/liblua.a +T= $(LIB)/liblua50.a + +SOBJS := $(patsubst %.o,%.os,$(OBJS)) all: $T -$T: $(OBJS) +$T: $(OBJS) $(SOBJS) $(AR) $@ $(OBJS) $(RANLIB) $@ clean: - rm -f $(OBJS) $T + rm -f $(OBJS) $(SOBJS) $T co: co -q -f -M $(SRCS) --- lua50-5.0.3.orig/src/lib/Makefile +++ lua50-5.0.3/src/lib/Makefile @@ -6,19 +6,21 @@ EXTRA_DEFS= $(POPEN) $(TMPNAM) $(DEGREES) $(LOADLIB) -OBJS= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o ltablib.o lstrlib.o loadlib.o -SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c lstrlib.c loadlib.c +OBJS= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o ltablib.o lstrlib.o loadlib.o compat-5.1r5/compat-5.1.o +SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c lstrlib.c loadlib.c compat-5.1r5/compat-5.1.c -T= $(LIB)/liblualib.a +SOBJS := $(patsubst %.o,%.os,$(OBJS)) + +T= $(LIB)/liblualib50.a all: $T -$T: $(OBJS) +$T: $(OBJS) $(SOBJS) $(AR) $@ $(OBJS) $(RANLIB) $@ clean: - rm -f $(OBJS) $T + rm -f $(OBJS) $(SOBJS) $T co: co -q -f -M $(SRCS) --- lua50-5.0.3.orig/src/lua/Makefile +++ lua50-5.0.3/src/lua/Makefile @@ -12,8 +12,8 @@ all: $T -$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a - $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB) +$T: $(OBJS) $(LIB)/liblua50.a $(LIB)/liblualib50.a + $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua50 -llualib50 $(EXTRA_LIBS) $(DLLIB) $(LIB)/liblua.a: cd ..; $(MAKE) --- lua50-5.0.3.orig/src/luac/Makefile +++ lua50-5.0.3/src/luac/Makefile @@ -12,8 +12,8 @@ all: $T -$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a - $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB) +$T: $(OBJS) $(LIB)/liblua50.a $(LIB)/liblualib50.a + $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua50 -llualib50 $(EXTRA_LIBS) # print.c needs opcode names from lopcodes.c lopcodes.o: ../lopcodes.c ../lopcodes.h debian/patches/pkg-config.patch0000644000000000000000000000256312202414617013667 0ustar Author: John V. Belmonte Description: Add support for Debian package to makefiles. --- /dev/null +++ lua50-5.0.3/lua50.pc @@ -0,0 +1,19 @@ +prefix=/usr +exec_prefix=/usr +libdir=/usr/lib +includedir=/usr/include/ +major_version=50 +version=5.0.3 + +# 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/lua/${major_version} + +Name: lua50 +Description: The Lua 5.0 programming language +Version: ${version} +Libs: -L${libdir} -llua50 +Cflags: -I${includedir}/lua50 + --- /dev/null +++ lua50-5.0.3/lualib50.pc @@ -0,0 +1,20 @@ +prefix=/usr +exec_prefix=/usr +libdir=/usr/lib +includedir=/usr/include/ +major_version=50 +version=5.0.3 + +# 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/lua/${major_version} + +Name: lua50 +Description: The Lua 5.0 programming language addon libraries +Version: ${version} +Requires: lua50 +Libs: -L${libdir} -llualib50 +Cflags: -I${includedir}/lua50 + debian/patches/lua-config.patch0000644000000000000000000001265212202414617013667 0ustar Author: John V. Belmonte Description: Add support for Debian package to makefiles. --- /dev/null +++ lua50-5.0.3/lua-config50 @@ -0,0 +1,165 @@ +#!/usr/bin/lua50 +-- -*- Lua -*- + +-- This file is under the terms of the MIT licence. Do as you will. + +-- Process the arg table +function usage() + info(); + io.stderr:write([[Usage: lua-config50 + + Valid options are: + + --include Outputs the -I switches needed to find etc. + + --static Outputs the full path to the static libraries + + --libs Outputs the -L and -l switches needed to find the library + --libs-only-L Outputs only the -L switches + --libs-only-l Outputs only the -l switches + + --extralibs Outputs the -l switches appropriate to the extra libs needed by lua + + Note that --static is mututally exclusive with the --libs* options + + Also, you can specify the following + + --vmonly Outputs only the switches for finding the VM libraries + --libonly Outputs only the switches for finding the standard libraries + --both Outputs the switches for both [The default] + + Example: + + gcc `lua-config50 --include` my_prog.c -o my_prog `lua-config50 --libs` + +]] ); + os.exit(1); +end + +function version() + io.stdout:write( [[5.0.0 +]] ); + os.exit(0); +end + +function info() + io.stdout:write( [[lua-config version 1.10 (c) Daniel Silverstone 2002 + +lua-config was written for the Debian GNU/Linux project. This version +of lua-config will provide switches appropriate to Lua 5.0 + +]] ); +end + +if( table.getn(arg) == 0 ) then + usage() +end + +output_vm = 1 +output_lib = 1 + +output_static = 0 +output_libs_l = 0 +output_libs_L = 0 +output_include = 0 +output_extras = 0 + +table.foreachi( arg, + function(n,param) + if( param == '--version' ) then + version() + end + if( param == '--help' ) then + usage() + end + if( param == '--include' ) then + output_include = 1; + return + end + if( param == '--libs' ) then + output_libs_l = 1; + output_libs_L = 1; + return + end + if( param == '--libs-only-L' ) then + output_libs_L = 1; + return + end + if( param == '--libs-only-l' ) then + output_libs_l = 1; + return + end + if( param == '--extralibs' ) then + output_extras = 1; + return + end + if( param == '--static' ) then + output_static = 1; + return + end + if( param == '--vmonly' ) then + output_vm = 1; + output_lib = 0; + return + end + if( param == '--libonly' ) then + output_lib = 1; + output_vm = 0; + return + end + if( param == '--both' ) then + output_lib = 1; + output_vm = 1; + return + end + io.stderr:write( "Unknown argument ", param ); + usage(); + end ); + +if( (output_extras + output_libs_l + output_libs_L + output_include + output_static) == 0 ) then + usage() +end + +if( (output_static + (output_libs_l or output_libs_L)) > 1 ) then + usage(); +end + +outargs = {} + +if( output_include == 1 ) then + table.insert( outargs, "-I/usr/include/lua50" ); +end + +if( output_libs_L == 1 ) then + table.insert( outargs, "-L/usr/include" ); +end + +if( output_libs_l == 1 ) then + if( output_lib == 1 ) then + table.insert( outargs, "-llualib50" ); + end + if( output_vm == 1 ) then + table.insert( outargs, "-llua50" ); + end +end + +if( output_static == 1 ) then + if( output_lib == 1 ) then + table.insert( outargs, "/usr/lib/liblualib50.a" ); + end + if( output_vm == 1 ) then + table.insert( outargs, "/usr/lib/liblua50.a" ); + end +end + +if( output_extras == 1 ) then + table.insert( outargs, "-lm" ); +end + +io.stdout:write( outargs[1] ); + +for i=2,table.getn(outargs) do + io.stdout:write( " ", outargs[i] ); +end + +io.stdout:write( "\n" ); --- /dev/null +++ lua50-5.0.3/lua-config50.1 @@ -0,0 +1,64 @@ +.\" Manual page for lua-config +.\" Written by Daniel Silverstone +.\" For the Debian GNU/Linux system + +.TH lua-config 1 +.SH NAME +lua-config \- Lua configuration information +.SH SYNOPSIS +Basic usage +.PP +.B gcc +` +.B lua-config +.I \-\-include +` +my_prog.c +.B \-o +my_prog +` +.B lua-config +.I \-\-libs +` + +.SH DESCRIPTION +The lua-config script allows you to determine useful information +about the chosen version of lua running on the Debian GNU/Linux +system in use. +More information can be found by running +.B lua-config +without any arguments. +.SH CAVEATS +This script is unique to Debian and as such you shouldn't rely +on its presence on every system. Lua is an embedded language +by default and different Linux distributions each take a different +approach to making it possible to compile with Lua. The +.B pkg-config +system also provides a way to look for libraries and is more likely +to be supported across different Linux distributions. Debian's +.B pkg-config +name for Lua 5.0 is +.I lua50 +and the libraries are in +.I lualib50. +These +.B pkg-config +files can be found in the +.I liblua50-dev +and +.I liblualib50-dev +packages. +.SH AUTHOR +lua-config was written by +.B Daniel Silverstone +.BI . + +This manual page was written by +.B Daniel Silverstone +.BI . +For the Debian project. It may be used without restriction in any +other system. +.SH "SEE ALSO" +.IR lua (1) +.IR pkg-config (1) + debian/lua50.postinst0000644000000000000000000000071612202414617011724 0ustar #!/bin/sh set -e if [ "$1" = "configure" ]; then # For now, just update the alternatives set to include us. update-alternatives --install /usr/bin/lua lua-interpreter /usr/bin/lua50 80 --slave /usr/share/man/man1/lua.1.gz lua-manual /usr/share/man/man1/lua50.1.gz update-alternatives --install /usr/bin/luac lua-compiler /usr/bin/luac50 80 --slave /usr/share/man/man1/luac.1.gz lua-compiler-manual /usr/share/man/man1/luac50.1.gz fi # Configure #DEBHELPER#