--- lua5.1-5.1.4.orig/debian/lua5.1.postinst
+++ lua5.1-5.1.4/debian/lua5.1.postinst
@@ -0,0 +1,16 @@
+#!/bin/sh -e
+
+case "$1" in
+ configure)
+ update-alternatives \
+ --install /usr/bin/lua lua-interpreter /usr/bin/lua5.1 110 \
+ --slave /usr/share/man/man1/lua.1.gz lua-manual \
+ /usr/share/man/man1/lua5.1.1.gz
+ update-alternatives \
+ --install /usr/bin/luac lua-compiler /usr/bin/luac5.1 110 \
+ --slave /usr/share/man/man1/luac.1.gz lua-compiler-manual \
+ /usr/share/man/man1/luac5.1.1.gz
+ ;;
+esac
+
+#DEBHELPER#
--- lua5.1-5.1.4.orig/debian/changelog
+++ lua5.1-5.1.4/debian/changelog
@@ -0,0 +1,171 @@
+lua5.1 (5.1.4-5) unstable; urgency=low
+
+ * Fixed #include directives and calls to luaopen_* in the examples.
+ Thanks Mike Pall for reporting that (private mail).
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Thu, 05 Nov 2009 20:44:38 +0100
+
+lua5.1 (5.1.4-4) unstable; urgency=low
+
+ * build-depend on libreadline-dev (and not libreadline5-dev) to
+ help the transition to libreadline6 (Closes: #551162)
+ * added README.source pointing to default dpatch README.source
+ * made lintian happy build-depending on debhelper >= 5
+ * updated standards-version to 3.8.3, no changes needed
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Fri, 16 Oct 2009 12:54:41 +0200
+
+lua5.1 (5.1.4-3) unstable; urgency=low
+
+ * added lua5.1-doc.doc-base Abstract: field.
+ * -dbg package moved to section debug as suggested by lintian
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Tue, 21 Apr 2009 13:06:23 +0200
+
+lua5.1 (5.1.4-2) unstable; urgency=low
+
+ * upload to unstable
+ * updated standards version to 3.8.1
+ * added ${misc:Depends} to make lintian happy
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Sun, 15 Mar 2009 10:14:37 +0100
+
+lua5.1 (5.1.4-1) experimental; urgency=low
+
+ * New upstream bugfix release
+ * Bumped version-standards to 3.8.0, no changes needed
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Wed, 03 Sep 2008 18:28:39 +0200
+
+lua5.1 (5.1.3-1) unstable; urgency=low
+
+ * New upstream release (bugfix only release)
+ * Bumped version-standards to 3.7.3, no changes needed
+ * Fixed Vcs-* fields in control
+ * Added Homepage: field in control and removed hand-made links to the lua
+ website
+ * set priority of -dbg package to extra
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Sat, 26 Jan 2008 16:28:55 +0100
+
+lua5.1 (5.1.2-4) unstable; urgency=low
+
+ * Added dependency of liblua5.1-0-dbg on liblua5.1-0 (= ${binary:Version})
+ as recommended by the developer reference section 6.7.9.
+ This sould also prevent deborphan from considering it for removal (Closes: #446531).
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Sun, 14 Oct 2007 15:03:49 +0200
+
+lua5.1 (5.1.2-3) unstable; urgency=low
+
+ * Patch from upstream to fix assignement bug in lparser.c
+ See: http://lua-users.org/lists/lua-l/2007-07/msg00617.html
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Wed, 01 Aug 2007 12:34:19 +0200
+
+lua5.1 (5.1.2-2) unstable; urgency=low
+
+ * Added -dbg package (Closes: #434815)
+ * Made control file binNMU safe
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Fri, 27 Jul 2007 18:08:50 +0100
+
+lua5.1 (5.1.2-1) unstable; urgency=low
+
+ * New upstream release, lua5.1.2
+ * Remove build workaround for fixed cdbs bug
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Mon, 02 Apr 2007 20:26:49 +0200
+
+lua5.1 (5.1.1-2) unstable; urgency=low
+
+ * Added a proper watch file.
+ * Fixed URL in copyright.
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Sun, 10 Sep 2006 14:24:26 +0200
+
+lua5.1 (5.1.1-1) unstable; urgency=low
+
+ [ John V. Belmonte ]
+ * New upstream version, lua5.1.1
+ * Add README.Debian to all packages.
+ * Small fix to example makefile.
+ * Improvements to regression test.
+
+ [ Enrico Tassi ]
+ * Removed build-essential from Build-Depends (Closes: #366854)
+ * Confirm Debian policy version 3.7.2.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Tue, 13 Jun 2006 23:01:14 -0400
+
+lua5.1 (5.1-1) unstable; urgency=low
+
+ [ Enrico Tassi ]
+ * New upstream release, lua5.1-final
+
+ [ John V. Belmonte ]
+ * Set lua and luac alternatives priority higher than other Lua packages.
+ * Fix man page symlinks of alternatives.
+ * Give up "liblua-?.so" variations in package.cpath.
+ * Add package regression test.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Sat, 18 Feb 2006 09:49:27 -0500
+
+lua5.1 (5.0.103-1) unstable; urgency=low
+
+ [ John V. Belmonte ]
+ * New upstream release, lua5.1-rc4
+
+ [ Enrico Tassi ]
+ * Fixed linking problem with modules. Now the command line intepreter
+ exports all symbols so that .so modules loaded with require() do not need
+ to be linked against the Lua library. The was causing duplicated Lua
+ library code, resulting in wasted space and run-time problems.
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Tue, 14 Feb 2006 19:17:16 +0100
+
+lua5.1 (5.0.102-1) unstable; urgency=low
+
+ * New upstream release, lua5.1-rc3
+ * Change module path variables in .pc file to match upstream.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Tue, 07 Feb 2006 21:44:08 -0500
+
+lua5.1 (5.0.101-1) unstable; urgency=low
+
+ * New upstream release, lua5.1-rc (2006-Jan-24)
+ * Restore missing separator in package.path.
+ * Restore package.path and package.cpath to use "lua/5.1" paths, matching
+ upstream.
+ * Remove /usr/lib paths from package.path to meet Debian policy. Binary
+ files (i.e. module .so's) should be under /usr/lib.
+ * Add "module_dir" and "binary_modlue_dir" variables to .pc file so that
+ pkg-config can be queried to find the correct place to install Lua modules.
+ * Add module paths rationale to Debian README.
+ * Change co-maintainer email address.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Sat, 28 Jan 2006 09:32:31 -0500
+
+lua5.1 (5.0.100-1) unstable; urgency=low
+
+ * New upstream release, lua5.1-rc (2006-Jan-11)
+ * Fix build error at renaming of man files. (Closes: #349435)
+ * Add debhelper token to maintainer scripts to make lintian happy.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Sun, 22 Jan 2006 15:07:52 -0500
+
+lua5.1 (5.0.99-2) unstable; urgency=low
+
+ * Use examples/debian instead of examples.Debian to make dh_fixperms and
+ lintian happy.
+ * Work around libtool issues with --tag option.
+ * Remove use of cdbs DEB_AUTO_UPDATE_DEBIAN_CONTROL, which is hated by
+ ftp-masters and didn't work that well anyway.
+
+ -- John V. Belmonte <jbelmonte@debian.org> Mon, 2 Jan 2006 13:57:07 -0500
+
+lua5.1 (5.0.99-1) unstable; urgency=low
+
+ * Initial release, lua5.1-beta (Closes: #339935)
+
+ -- John V. Belmonte <jbelmonte@debian.org> Sun, 20 Nov 2005 19:55:05 -0500
--- lua5.1-5.1.4.orig/debian/liblua5.1-0-dev.install
+++ lua5.1-5.1.4/debian/liblua5.1-0-dev.install
@@ -0,0 +1,4 @@
+usr/include
+usr/lib/*.la
+usr/lib/*.a
+usr/lib/*.so
--- lua5.1-5.1.4.orig/debian/lua5.1.install
+++ lua5.1-5.1.4/debian/lua5.1.install
@@ -0,0 +1,2 @@
+usr/bin
+usr/share/man/man1
--- lua5.1-5.1.4.orig/debian/watch
+++ lua5.1-5.1.4/debian/watch
@@ -0,0 +1,2 @@
+version=3
+http://www.lua.org/ftp/lua-(5\.1.*)\.tar\.gz
--- lua5.1-5.1.4.orig/debian/lua5.1.prerm
+++ lua5.1-5.1.4/debian/lua5.1.prerm
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+case "$1" in
+ remove)
+ update-alternatives --remove lua-interpreter /usr/bin/lua5.1
+ update-alternatives --remove lua-compiler /usr/bin/luac5.1
+ ;;
+esac
+
+#DEBHELPER#
--- lua5.1-5.1.4.orig/debian/copyright
+++ lua5.1-5.1.4/debian/copyright
@@ -0,0 +1,28 @@
+This package was debianized by John V. Belmonte <jbelmonte@debian.org> on
+Sun, 20 Nov 2005 19:55:05 -0500.
+
+It was downloaded from <http://www.lua.org/ftp/>.
+
+Copyright Holder: Lua Team <team@lua.org>
+
+License:
+
+Copyright (C) 1994-2005 Lua.org, 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.
--- lua5.1-5.1.4.orig/debian/README.Debian
+++ lua5.1-5.1.4/debian/README.Debian
@@ -0,0 +1,140 @@
+lua5.1 for Debian
+=================
+
+This is packaging for Debian of the 5.1 series of the Lua programming
+language. For package development see <http://pkg-lua.alioth.debian.org/>.
+
+Binary package index:
+
+ * lua5.1 - command line tools (i.e. interpreter and bytecode compiler)
+ * lua5.1-doc - documentation, including manual and examples
+ * liblua5.1-0-dev - development libraries
+ * liblua5.1-0 - runtime libraries
+
+
+II. Propaganda
+==============
+
+Best practices
+--------------
+See "./examples/debian/" in the lua5.1-doc package for some tips and best
+practices for using the Lua library in your app, building binary modules,
+etc.
+
+
+III. Rationale
+==============
+
+Packaging philosophy
+--------------------
+The packaging philosophy adopted is to avoid changes to upstream source as
+much as possible.
+
+
+Need to maintain old Lua releases
+---------------------------------
+While the Lua authors attempt to keep changes to the language and standard
+libraries backwards compatible, the C API often changes significantly between
+versions (e.g. from the 5.0 series to 5.1). Applications in which Lua is
+embedded often become bound to a certain version of Lua indefinitely. For
+these reasons, and in contrast to other interpreted languages which have more
+of a stand-alone focus, it's important to maintain old Lua library releases
+as long as they are in use by relevant applications.
+
+
+Naming convention (lua5.1 vs. lua51)
+------------------------------------
+The naming convention prior to the lua5.1 package, specifically the lack of
+delimiters in the version portion, lacked foresight. The reason is that if
+the version ever has more than one digit per component, the terser name will
+be ambiguous. Even if this will never be a problem in practice (will 61.1
+clash with 6.11?), lua12.3 seems more friendly than lua123.
+
+
+Major and minor versions
+------------------------
+Looking at a full Lua version number such as "5.0.2", "5.0" is considered
+the major number and ".2" the minor number. The packaging scheme employed
+allows command line tools, modules, and libraries of multiple major Lua
+versions (for example, Lua 5.0 and 5.1) to exist together. At the same time,
+it assumes that upstream will not break Lua language compatibility in a minor
+release.
+
+
+Module paths
+------------
+Upstream's package.path and package.cpath consist of paths under /usr/local.
+Corresponding paths under /usr are required to support Lua modules which will
+be packaged for Debian. These have been added except in the case of /usr/lib
+in package.path. Debian policy is clear that architecture-independent files
+(i.e. .lua modules) be placed under /usr/share, while binary files (i.e. module
+.so's) be under /usr/lib. This implies that Lua's package.path should not
+contain references to /usr/lib. Since /usr/local is not under Debian
+management, upstream's original paths were left intact.
+
+The implication for Lua modules packaged for Debian is that the correct module
+paths must be used at install time. Instead of hard coding these paths, use
+of the "module_dir" and "binary_module_dir" info made available through
+pkg-config is recommended. For example, in a makefile:
+
+ PREFIX = /usr
+ MODULE_PATH = $(PREFIX)/$(shell pkg-config lua5.1 --variable=module_dir)
+ BIN_MODULE_PATH = $(PREFIX)/$(shell pkg-config lua5.1 --variable=binary_module_dir)
+
+For those concerned about either pkg-config or these variables not being
+available everywhere, it is trivial to fall back to a hard coded path.
+
+
+Library SONAME
+--------------
+As explained, each series of Lua (e.g. 5.0, 5.1) is treated as a completely
+separate library. Within a series, Libtool versioning is followed. For
+example, the first release of Lua 5.1 (5.1.0) will have a soname
+"liblua5.1.so.0". Let's say that 5.1.1 is later released, and it is binary
+compatible with the previous version. In that case, the soname will stay
+the same, and existing applications do not need to relink.
+
+
+Package binaries: static vs. dynamic linking
+--------------------------------------------
+There are two executables in this source package: "lua" and "luac". Due to
+luac's use of internal symbols in the Lua core, at present it cannot be
+dynamically linked. Also, it's been reported that use of position-
+independent code hinders the VM's performance. For these reasons, and for
+consistency, both executables are statically linked.
+
+
+IV. For packagers
+=================
+
+Package testing
+---------------
+Final testing should be done in a clean environment (e.g. via pbuilder).
+Important tests:
+ * package build
+ * install of each binary package without the others installed
+ * with all packages installed:
+ * run "make" in examples/debian/
+
+We have a package regression test which is intended to be run inside the
+pbuilder environment. For example (assuming pbuilder is configured
+to bindmount your package result directory inside the chroot):
+
+ $ sudo pbuilder execute -- debian/tests/regression_test \
+ /var/cache/pbuilder/sid/result/lua5.1_5.1-1_i386.changes
+
+
+Unfinished business
+-------------------
+TODO: make version-specific aliases for LUA_INIT, LUA_PATH, LUA_CPATH
+TODO: add Mike Pall's advanced readline support as a module
+TODO: consider using libedit in place of libreadline, as it's easier than
+ explaining that our distribution of the "lua" interpreter is under the GPL.
+TODO: investigate use of versioned symbols in the .so. This will allow e.g.
+ debuggers that can support multiple Lua versions simultaneously, and
+ apps which assemble components using different Lua versions. (Hint:
+ module .so's *must* be linked against the Lua library.)
+TODO: include soname number in source package name (on next increment). May
+ want to split library and command line tools into separate source packages.
+ISSUE: want way to avoid hard-coding package and path names in
+ lua5.1.postinst, etc.
--- lua5.1-5.1.4.orig/debian/liblua5.1-0.install
+++ lua5.1-5.1.4/debian/liblua5.1-0.install
@@ -0,0 +1 @@
+usr/lib/*.so.*
--- lua5.1-5.1.4.orig/debian/lua.pc.in
+++ lua5.1-5.1.4/debian/lua.pc.in
@@ -0,0 +1,28 @@
+#prefix=/usr
+#major_version=5.1
+#version=5.1.0
+
+lib_name=lua${major_version}
+libdir=${prefix}/lib
+includedir=${prefix}/include
+
+#
+# The following are intended to be used via "pkg-config --variable".
+
+# The location of the libtool library. This is used when linking to the Lua
+# library via libtool.
+libtool_lib=${libdir}/lib${lib_name}.la
+
+# 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: Lua
+Description: Lua language engine
+Version: ${version}
+Requires:
+Libs: -L${libdir} -l${lib_name}
+Libs.private: -lm
+Cflags: -I${includedir}/${lib_name}
--- lua5.1-5.1.4.orig/debian/compat
+++ lua5.1-5.1.4/debian/compat
@@ -0,0 +1 @@
+5
--- lua5.1-5.1.4.orig/debian/rules
+++ lua5.1-5.1.4/debian/rules
@@ -0,0 +1,42 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/class/makefile.mk
+include /usr/share/cdbs/1/rules/debhelper.mk
+include /usr/share/cdbs/1/rules/dpatch.mk
+
+LUA_V = 5.1
+LUA_FULL_V = 5.1.4
+SONUM = 0
+LUA = lua$(LUA_V)
+DEB_DESTDIR := $(DEB_DESTDIR)usr
+DEB_MAKE_BUILD_TARGET = \
+ debian_linux \
+ RPATH=/usr/lib
+DEB_MAKE_CLEAN_TARGET = debian_clean
+DEB_MAKE_CHECK_TARGET = debian_test
+# adjust some install directories
+DEB_MAKE_INSTALL_TARGET = \
+ debian_install \
+ INSTALL_TOP=$(DEB_DESTDIR) \
+ INSTALL_MAN=$(DEB_DESTDIR)/share/man/man1 \
+ INSTALL_INC=$(DEB_DESTDIR)/include/$(LUA)
+
+LIB_PACKAGE_NAME = lib$(LUA)-$(SONUM)
+
+DEB_INSTALL_DOCS_$(LUA)-doc = -X/man/
+DEB_INSTALL_DOCS_ALL = debian/README.Debian
+DEB_DH_INSTALL_SOURCEDIR = debian/tmp
+
+PKG_CONFIG_FILE = debian/$(LIB_PACKAGE_NAME)-dev/usr/lib/pkgconfig/$(LUA).pc
+DOC_DIR = debian/$(LUA)-doc/usr/share/doc/$(LUA)-doc
+
+binary-install/$(LUA)-doc::
+ chmod +x $(DOC_DIR)/examples/debian/script/hello
+ mv $(DOC_DIR)/doc/readme.html $(DOC_DIR)/doc/index.html
+
+binary-install/$(LIB_PACKAGE_NAME)-dev::
+ mkdir -p $(dir $(PKG_CONFIG_FILE))
+ echo "prefix=/usr" > $(PKG_CONFIG_FILE)
+ echo "major_version=$(LUA_V)" >> $(PKG_CONFIG_FILE)
+ echo "version=$(LUA_FULL_V)" >> $(PKG_CONFIG_FILE)
+ cat debian/lua.pc.in >> $(PKG_CONFIG_FILE)
--- lua5.1-5.1.4.orig/debian/README.source
+++ lua5.1-5.1.4/debian/README.source
@@ -0,0 +1 @@
+Please refer to /usr/share/doc/dpatch/README.source.gz
--- lua5.1-5.1.4.orig/debian/lua5.1-doc.doc-base
+++ lua5.1-5.1.4/debian/lua5.1-doc.doc-base
@@ -0,0 +1,12 @@
+Document: lua5.1-doc
+Title: Lua 5.1 Documentation
+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.1 of the language and implementation
+ including the C API.
+Section: Programming
+
+Format: HTML
+Index: /usr/share/doc/lua5.1-doc/doc/index.html
+Files: /usr/share/doc/lua5.1-doc/doc/*
--- lua5.1-5.1.4.orig/debian/control
+++ lua5.1-5.1.4/debian/control
@@ -0,0 +1,76 @@
+Source: lua5.1
+Section: interpreters
+Priority: optional
+Maintainer: John V. Belmonte <jbelmonte@debian.org>
+Uploaders: Enrico Tassi <gareuselesinge@debian.org>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), dpatch, libtool, libreadline-dev
+Standards-Version: 3.8.3
+Vcs-Svn: svn://svn.debian.org/pkg-lua/packages/lua5.1
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-lua/packages/lua5.1
+Homepage: http://www.lua.org
+
+Package: lua5.1-doc
+Architecture: all
+Section: doc
+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 official manual covering the Lua language and C API,
+ examples, etc.
+
+Package: lua5.1
+Architecture: any
+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.1-0-dev
+Provides: liblua5.1-dev
+Conflicts: liblua5.1-dev
+Architecture: any
+Depends: liblua5.1-0 (= ${binary:Version}), libc6-dev|libc-dev, libreadline-dev, ${misc:Depends}
+Recommends: pkg-config, libtool
+Section: libdevel
+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 developer resources for using the Lua library.
+ Install it if you are developing programs which use the Lua C API.
+
+Package: liblua5.1-0
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Section: libs
+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 runtime libraries. You shouldn't need to install it
+ explicitly.
+
+Package: liblua5.1-0-dbg
+Architecture: any
+Depends: ${shlibs:Depends}, liblua5.1-0 (= ${binary:Version}), ${misc:Depends}
+Section: debug
+Priority: extra
+Description: Simple, extensible, embeddable programming language
+ This package contains the debugging symbols for liblua5.1 and lua5.1
--- lua5.1-5.1.4.orig/debian/lua5.1-doc.docs
+++ lua5.1-5.1.4/debian/lua5.1-doc.docs
@@ -0,0 +1,5 @@
+README
+doc/
+etc/
+test/
+debian/examples
--- lua5.1-5.1.4.orig/debian/examples/debian/Makefile
+++ lua5.1-5.1.4/debian/examples/debian/Makefile
@@ -0,0 +1,9 @@
+SUBDIRS = script static_app binary_module
+
+.PHONY: $(SUBDIRS)
+
+%:: $(SUBDIRS)
+ @:
+
+$(SUBDIRS)::
+ $(MAKE) -C $(SUBDIR) $@ $(MAKECMDGOALS)
--- lua5.1-5.1.4.orig/debian/examples/debian/README
+++ lua5.1-5.1.4/debian/examples/debian/README
@@ -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".
--- lua5.1-5.1.4.orig/debian/examples/debian/binary_module/app.c
+++ lua5.1-5.1.4/debian/examples/debian/binary_module/app.c
@@ -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 = lua_open();
+ luaL_openlibs(L);
+ result = luaL_dostring(L, "require 'foo'");
+ if (result != 0) return 1;
+ result = luaL_dostring(L, "print(foo.get_greeting())");
+ lua_close(L);
+ return (result != 0);
+}
--- lua5.1-5.1.4.orig/debian/examples/debian/binary_module/Makefile
+++ lua5.1-5.1.4/debian/examples/debian/binary_module/Makefile
@@ -0,0 +1,51 @@
+LIBTOOL = libtool --silent --tag=CC
+
+LUA_CFLAGS := $(shell pkg-config lua5.1 --cflags)
+# This retrieves the name of the libtool convenience library for Lua
+# (e.g. "/usr/lib/liblua5.1.la").
+LUA_LIBTOOL := $(shell pkg-config lua5.1 --variable=libtool_lib)
+# this is the path where you'll eventually install the module
+RPATH=$(shell pkg-config lua5.1 --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
+
+# 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) -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.1 -l foo -e 'print(foo.get_greeting())'
+
+app: app.c liblua-foo.la
+ $(LIBTOOL) --mode=link $(CC) -Wall -O2 $(LUA_CFLAGS) \
+ $(LUA_LIBTOOL) -static -o app app.c liblua-foo.la
+
+test-static: app
+ ./app
+
+# 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
+
+clean:
+ $(RM) *.o *.lo *.la *.so app
+ $(RM) -r ./.libs/
--- lua5.1-5.1.4.orig/debian/examples/debian/binary_module/README
+++ lua5.1-5.1.4/debian/examples/debian/binary_module/README
@@ -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
--- lua5.1-5.1.4.orig/debian/examples/debian/binary_module/lua-foo.c
+++ lua5.1-5.1.4/debian/examples/debian/binary_module/lua-foo.c
@@ -0,0 +1,20 @@
+#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)
+{
+ luaL_register(L, "foo", funcs);
+ return 1;
+}
--- lua5.1-5.1.4.orig/debian/examples/debian/script/hello
+++ lua5.1-5.1.4/debian/examples/debian/script/hello
@@ -0,0 +1,3 @@
+#!/usr/bin/env lua5.1
+
+print 'hello from Lua'
--- lua5.1-5.1.4.orig/debian/examples/debian/script/Makefile
+++ lua5.1-5.1.4/debian/examples/debian/script/Makefile
@@ -0,0 +1,6 @@
+all: test
+
+test:
+ ./hello
+
+clean: ;
--- lua5.1-5.1.4.orig/debian/examples/debian/script/README
+++ lua5.1-5.1.4/debian/examples/debian/script/README
@@ -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.
--- lua5.1-5.1.4.orig/debian/examples/debian/static_app/app.c
+++ lua5.1-5.1.4/debian/examples/debian/static_app/app.c
@@ -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);
+}
--- lua5.1-5.1.4.orig/debian/examples/debian/static_app/Makefile
+++ lua5.1-5.1.4/debian/examples/debian/static_app/Makefile
@@ -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
--- lua5.1-5.1.4.orig/debian/examples/debian/static_app/README
+++ lua5.1-5.1.4/debian/examples/debian/static_app/README
@@ -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.
--- lua5.1-5.1.4.orig/debian/tests/regression_test
+++ lua5.1-5.1.4/debian/tests/regression_test
@@ -0,0 +1,91 @@
+#!/bin/bash -e
+#
+# Regression test for Lua packages.
+#
+# Synopsis:
+# $ regression_test build-area/lua5.1_5.1-1_i386.changes
+#
+# As new packaging bugs are discovered, try to add a corresponding regression
+# test to this script.
+#
+# This script requires root privilege. It's intended to be run in a
+# base chroot environment (e.g. via "pbuilder execute").
+#
+
+if (($# != 1)); then
+ echo "usage: $(basename $0) CHANGES_FILE"
+ exit 1
+fi 1>&2
+
+trap "echo 'Regression test FAILED.' 1>&2" EXIT
+
+CHANGES="$1"
+PACKAGE_DIR=$(dirname $CHANGES)
+
+PACKAGE_NAME=$(grep ^Source: $CHANGES | cut -d' ' -f2)
+PACKAGE_V=$(grep ^Version: $CHANGES | cut -d' ' -f2)
+DEBS=$(grep '\.deb$' $CHANGES | cut -d' ' -f6 |
+ xargs -iXX echo ${PACKAGE_DIR}/XX)
+PACKAGES=$(grep '\.deb$' $CHANGES | cut -d' ' -f6 | cut -d_ -f1)
+
+LUA_V=$(cut -d'-' -f1 <<<$PACKAGE_V)
+LUA_MAJOR_V=$(cut -d'.' -f-2 <<<$LUA_V)
+SRC_BASE=${PACKAGE_DIR}/${PACKAGE_NAME}_${PACKAGE_V}
+DSC_FILE=${SRC_BASE}.dsc
+DIFF_FILE=${SRC_BASE}.diff.gz
+
+APT_INSTALL="apt-get install -qq --force-yes"
+
+function msg
+{
+ echo "*** $@"
+}
+
+msg "Starting tests."
+
+# Since we are installing our .deb's directly, we have to manually install
+# dependencies. It would be better to have our packages available through
+# an apt source.
+msg "(Installing dependencies...)"
+$APT_INSTALL libreadline-dev libncurses5-dev
+
+msg "Package install..."
+dpkg -i $DEBS
+
+msg "(Installing support packages...)"
+# install packages for other tests
+$APT_INSTALL pkg-config libtool lintian patchutils
+
+msg "Lintian test..."
+lintian -i --allow-root $DSC_FILE $DEBS
+
+msg "pkg-config test..."
+pkg-config --exists $PACKAGE_NAME
+[[ "$(pkg-config $PACKAGE_NAME --modversion)" == "$LUA_V" ]] || exit 1
+[[ "$(pkg-config $PACKAGE_NAME --variable major_version)" == \
+ "$LUA_MAJOR_V" ]] || exit 1
+
+msg "Examples test..."
+cd /usr/share/doc/${PACKAGE_NAME}-doc/examples/debian
+make -s
+cd -
+
+msg "Man page test..."
+man lua luac lua${LUA_MAJOR_V} luac${LUA_MAJOR_V} > /dev/null
+
+msg "Doc test..."
+# ensure every package has README.Debian
+for name in $PACKAGES; do
+ [[ -f /usr/share/doc/$name/README.Debian.gz ]] || exit 1
+done
+
+msg "Diff test..."
+if BAD_DIFFS=$(zcat $DIFF_FILE | lsdiff --strip=1 |
+ grep -v ^debian/); then
+ echo "ERROR: diff contains items outside of debian directory:"
+ echo "$BAD_DIFFS"
+ exit 1
+fi 1>&2
+
+msg "All tests passed."
+trap EXIT
--- lua5.1-5.1.4.orig/debian/patches/debian_make.dpatch
+++ lua5.1-5.1.4/debian/patches/debian_make.dpatch
@@ -0,0 +1,72 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## Makefile.dpatch by John V. Belmonte <jbelmonte@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Add support for Debian package to makefiles.
+
+@DPATCH@
+diff -urNad trunk~/Makefile trunk/Makefile
+--- trunk~/Makefile 2006-01-11 18:50:05.000000000 -0500
++++ trunk/Makefile 2006-01-22 22:12:01.000000000 -0500
+@@ -102,3 +102,28 @@
+ @find . -newer MANIFEST -type f
+
+ # (end of Makefile)
++
++# Use libtool for binary installs, etc.
++
++export V
++export LIBTOOL = libtool --quiet --tag=CC
++# See libtool manual about how to set this
++export LIB_VERSION = 0:0:0
++
++debian_clean:
++ cd src; $(MAKE) $@
++
++debian_test: debian_linux
++ src/lua$(V) test/hello.lua
++
++debian_install: debian_linux
++ cd src; mkdir -p $(INSTALL_BIN) $(INSTALL_INC) $(INSTALL_LIB) $(INSTALL_MAN)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_EXEC) lua$(V) luac$(V) $(INSTALL_BIN)
++ cd src; $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
++ cd src; $(LIBTOOL) --mode=install $(INSTALL_DATA) liblua$(V).la $(INSTALL_LIB)
++ $(foreach NAME,$(TO_MAN),$(INSTALL_DATA) doc/$(NAME) $(INSTALL_MAN)/$(basename $(NAME))$(V)$(suffix $(NAME));)
++
++# ISSUE: MYCFLAGS not honored in the case of a CFLAGS override
++debian_linux:
++ cd src; $(MAKE) debian_all CFLAGS+=-DLUA_USE_LINUX \
++ LIB_LIBS="-lm -ldl" LUA_LIBS="-lreadline"
+diff -urNad trunk~/src/Makefile trunk/src/Makefile
+--- trunk~/src/Makefile 2006-01-11 18:49:05.000000000 -0500
++++ trunk/src/Makefile 2006-01-22 22:11:48.000000000 -0500
+@@ -165,3 +165,29 @@
+ ltm.h lzio.h lmem.h lopcodes.h lundump.h
+
+ # (end of Makefile)
++
++# The following rules use libtool for compiling and linking in order to
++# provide shared library support. While we are at it, our desired version
++# suffixes are added to the targets, preventing conflicts with rules in
++# the upstream makefile.
++
++LIB_NAME = liblua$(V).la
++LIB_OBJS = $(CORE_O:.o=.lo) $(LIB_O:.o=.lo)
++
++%.lo %.o: %.c
++ $(LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) $<
++
++$(LIB_NAME) $(LIB_NAME:.la=.a): $(LIB_OBJS)
++ $(LIBTOOL) --mode=link $(CC) -version-info $(LIB_VERSION) \
++ -rpath $(RPATH) -o $(LIB_NAME) $(LIB_OBJS) $(LIB_LIBS)
++
++lua$(V): $(LUA_O) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static -Wl,-E -o $@ $(LUA_O) $(LIB_NAME) $(LUA_LIBS)
++
++luac$(V): $(LUAC_O) $(LIB_NAME)
++ $(LIBTOOL) --mode=link $(CC) -static -o $@ $(LUAC_O) $(LIB_NAME)
++
++debian_clean:
++ $(LIBTOOL) --mode=clean $(RM) $(ALL_O:.o=.lo) $(LIB_NAME) lua$(V) luac$(V)
++
++debian_all: $(LIB_NAME) lua$(V) luac$(V)
--- lua5.1-5.1.4.orig/debian/patches/module_paths.dpatch
+++ lua5.1-5.1.4/debian/patches/module_paths.dpatch
@@ -0,0 +1,30 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## src_luaconf.h.dpatch by John V. Belmonte <jbelmonte@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Set Lua's default PATH and CPATH.
+
+@DPATCH@
+diff -urNad trunk~/src/luaconf.h trunk/src/luaconf.h
+--- trunk~/src/luaconf.h 2006-02-10 12:44:06.000000000 -0500
++++ trunk/src/luaconf.h 2006-02-17 21:32:55.000000000 -0500
+@@ -83,13 +83,17 @@
+
+ #else
+ #define LUA_ROOT "/usr/local/"
++#define LUA_ROOT2 "/usr/"
+ #define LUA_LDIR LUA_ROOT "share/lua/5.1/"
++#define LUA_LDIR2 LUA_ROOT2 "share/lua/5.1/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
++#define LUA_CDIR2 LUA_ROOT2 "lib/lua/5.1/"
+ #define LUA_PATH_DEFAULT \
+ "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
+- LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua"
++ LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua;" \
++ LUA_LDIR2"?.lua;" LUA_LDIR2"?/init.lua"
+ #define LUA_CPATH_DEFAULT \
+- "./?.so;" LUA_CDIR"?.so;" LUA_CDIR"loadall.so"
++ "./?.so;" LUA_CDIR"?.so;" LUA_CDIR2"?.so;" LUA_CDIR"loadall.so"
+ #endif
+
+
--- lua5.1-5.1.4.orig/debian/patches/00dpatch.conf
+++ lua5.1-5.1.4/debian/patches/00dpatch.conf
@@ -0,0 +1,2 @@
+conf_debianonly=1
+conf_origtargzpath=../tarballs/
--- lua5.1-5.1.4.orig/debian/patches/00list
+++ lua5.1-5.1.4/debian/patches/00list
@@ -0,0 +1,2 @@
+debian_make
+module_paths