--- lua-rexlib-2.4.0.orig/debian/watch
+++ lua-rexlib-2.4.0/debian/watch
@@ -0,0 +1,5 @@
+# test this watch file using:
+# uscan --watchfile debian/watch --upstream-version 0.0.1 --package lua-rexlib
+#
+version=3
+http://luaforge.net/frs/?group_id=63 /frs/download.php/\d+/lrexlib-([\d\.]*).zip
--- lua-rexlib-2.4.0.orig/debian/copyright
+++ lua-rexlib-2.4.0/debian/copyright
@@ -0,0 +1,33 @@
+This package was debianized by Enrico Tassi <gareuselesinge@debian.org>
+Thu Aug 20 17:49:29 CEST 2009
+
+It was downloaded from http://luaforge.net/projects/lrexlib/.
+
+Copyright (C) Reuben Thomas 2000-2008
+Copyright (C) Shmuel Zeigerman 2004-2008
+
+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.
+
+Files doc/html4css1.css and doc/lrexlib.css has been placed in the public
+domain.
+
--- lua-rexlib-2.4.0.orig/debian/changelog
+++ lua-rexlib-2.4.0/debian/changelog
@@ -0,0 +1,14 @@
+lua-rexlib (2.4.0-2) unstable; urgency=low
+
+ * Add upstream patch to fix memory alignment problems on ARM.
+ (Closes: #598947)
+ * Fixed copyright, some files were under public domain, kudos to
+ Torsten Werner
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Sun, 07 Nov 2010 10:37:33 +0100
+
+lua-rexlib (2.4.0-1) unstable; urgency=low
+
+ * Initial release. (Closes: #538230)
+
+ -- Enrico Tassi <gareuselesinge@debian.org> Thu, 20 Aug 2009 17:02:51 +0200
--- lua-rexlib-2.4.0.orig/debian/pcre.Makefile.Debian.conf
+++ lua-rexlib-2.4.0/debian/pcre.Makefile.Debian.conf
@@ -0,0 +1,44 @@
+### $Id: Makefile.Debian.conf.sample 902 2008-03-22 13:32:17Z gareuselesinge $
+
+### mandatory fields
+PKG_NAME=rex.pcre
+
+### things relative to the C library part
+CLIB_CFLAGS=$(shell pcre-config --cflags)
+CLIB_LDFLAGS=$(shell pcre-config --libs)
+CLIB_OBJS=src/common.lo src/pcre/lpcre.lo src/pcre/lpcre_f.lo
+VERSION_INFO=0:0:0
+LUA_MODNAME_CPART=
+
+### things relative to the lua library part
+LUA_HEADER=
+LUA_SOURCES=
+LUA_MODNAME=rex_pcre
+LUA_TEST=runtest.lua -v pcre
+
+### this part is relative to pkg-config
+PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1)
+PKG_LIBS_PRIVATE=
+PKG_URL=
+PKG_REQUIRES=
+PKG_CONFLICTS=
+
+### this part is relative to debian libs naming policy
+DEB_EXTRA_DASH=
+
+### In addition, to gather flexibility, you can set these hooks
+### (called in this order)
+pre-all-hook::
+post-all-hook::
+pre-test-hook::
+ ln -sf test/*.lua .
+pre-lua-dynamic-test-hook::
+pre-dynamic-link-hook::
+pre-app-dynamic-test-hook::
+pre-static-link-hook::
+pre-app-static-test-hook::
+pre-install-hook::
+post-install-hook::
+pre-clean-hook::
+post-clean-hook::
+ rm -f *.lua
--- lua-rexlib-2.4.0.orig/debian/posix.Makefile.Debian.conf
+++ lua-rexlib-2.4.0/debian/posix.Makefile.Debian.conf
@@ -0,0 +1,44 @@
+### $Id: Makefile.Debian.conf.sample 902 2008-03-22 13:32:17Z gareuselesinge $
+
+### mandatory fields
+PKG_NAME=rex.posix
+
+### things relative to the C library part
+CLIB_CFLAGS=
+CLIB_LDFLAGS=
+CLIB_OBJS=src/common.lo src/posix/lposix.lo
+VERSION_INFO=0:0:0
+LUA_MODNAME_CPART=
+
+### things relative to the lua library part
+LUA_HEADER=
+LUA_SOURCES=
+LUA_MODNAME=rex_posix
+LUA_TEST=runtest.lua -v posix
+
+### this part is relative to pkg-config
+PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1)
+PKG_LIBS_PRIVATE=
+PKG_URL=
+PKG_REQUIRES=
+PKG_CONFLICTS=
+
+### this part is relative to debian libs naming policy
+DEB_EXTRA_DASH=
+
+### In addition, to gather flexibility, you can set these hooks
+### (called in this order)
+pre-all-hook::
+post-all-hook::
+pre-test-hook::
+ ln -sf test/*.lua .
+pre-lua-dynamic-test-hook::
+pre-dynamic-link-hook::
+pre-app-dynamic-test-hook::
+pre-static-link-hook::
+pre-app-static-test-hook::
+pre-install-hook::
+post-install-hook::
+pre-clean-hook::
+post-clean-hook::
+ rm -f *.lua
--- lua-rexlib-2.4.0.orig/debian/onig.Makefile.Debian.conf
+++ lua-rexlib-2.4.0/debian/onig.Makefile.Debian.conf
@@ -0,0 +1,44 @@
+### $Id: Makefile.Debian.conf.sample 902 2008-03-22 13:32:17Z gareuselesinge $
+
+### mandatory fields
+PKG_NAME=rex.onig
+
+### things relative to the C library part
+CLIB_CFLAGS=$(shell onig-config --cflags)
+CLIB_LDFLAGS=$(shell onig-config --libs)
+CLIB_OBJS=src/common.lo src/oniguruma/lonig.lo src/oniguruma/lonig_f.lo
+VERSION_INFO=0:0:0
+LUA_MODNAME_CPART=
+
+### things relative to the lua library part
+LUA_HEADER=
+LUA_SOURCES=
+LUA_MODNAME=rex_onig
+LUA_TEST=runtest.lua -v onig
+
+### this part is relative to pkg-config
+PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1)
+PKG_LIBS_PRIVATE=
+PKG_URL=
+PKG_REQUIRES=
+PKG_CONFLICTS=
+
+### this part is relative to debian libs naming policy
+DEB_EXTRA_DASH=
+
+### In addition, to gather flexibility, you can set these hooks
+### (called in this order)
+pre-all-hook::
+post-all-hook::
+pre-test-hook::
+ ln -sf test/*.lua .
+pre-lua-dynamic-test-hook::
+pre-dynamic-link-hook::
+pre-app-dynamic-test-hook::
+pre-static-link-hook::
+pre-app-static-test-hook::
+pre-install-hook::
+post-install-hook::
+pre-clean-hook::
+post-clean-hook::
+ rm -f *.lua
--- lua-rexlib-2.4.0.orig/debian/control
+++ lua-rexlib-2.4.0/debian/control
@@ -0,0 +1,64 @@
+Source: lua-rexlib
+Section: interpreters
+Priority: optional
+Maintainer: Enrico Tassi <gareuselesinge@debian.org>
+Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 5), lua5.1-policy-dev (>= 22), libpcre3-dev, dpatch, libonig-dev
+Standards-Version: 3.8.3
+Vcs-Svn: svn://svn.debian.org/pkg-lua/packages/lua-rexlib
+Vcs-Browser: http://svn.debian.org/viewsvn/pkg-lua/packages/lua-rexlib
+Homepage: http://lrexlib.luaforge.net/
+
+Package: liblua5.1-rex-pcre0
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Perl regular expressions library for the Lua language version 5.1
+ This package provides bindings for Perl regular expressions to the Lua
+ language.
+
+Package: liblua5.1-rex-pcre-dev
+Architecture: any
+Depends: liblua5.1-rex-pcre0 (= ${binary:Version}), ${misc:Depends}
+Section: libdevel
+Description: PCRE development files for the Lua language version 5.1
+ This package contains the development files of the PCRE lrexlib lua5.1
+ bindings, useful to create a statically linked binary (like a C application or
+ a standalone Lua interpreter).
+
+Package: liblua5.1-rex-posix0
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: POSIX regular expressions library for the Lua language version 5.1
+ This package provides bindings for POSIX regular expressions to the Lua
+ language.
+
+Package: liblua5.1-rex-posix-dev
+Architecture: any
+Depends: liblua5.1-rex-posix0 (= ${binary:Version}), ${misc:Depends}
+Section: libdevel
+Description: POSIX regex development files for the Lua language version 5.1
+ This package contains the development files of the POSIX lrexlib lua5.1
+ bindings, useful to create a statically linked binary (like a C application or
+ a standalone Lua interpreter).
+
+Package: liblua5.1-rex-onig0
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Onig regular expressions library for the Lua language version 5.1
+ This package provides bindings for Oniguruma regular expressions to the Lua
+ language.
+
+Package: liblua5.1-rex-onig-dev
+Architecture: any
+Depends: liblua5.1-rex-onig0 (= ${binary:Version}), ${misc:Depends}
+Section: libdevel
+Description: Onig regex development files for the Lua language version 5.1
+ This package contains the development files of the Onig lrexlib lua5.1
+ bindings, useful to create a statically linked binary (like a C application or
+ a standalone Lua interpreter).
+
+Package: liblua5.1-rex-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends}
+Description: documentation of the rex library for the Lua language version 5.1
+ Documentation of all liblua5.1-rex-* modules is shipped in this package.
--- lua-rexlib-2.4.0.orig/debian/liblua5.1-rex-doc.docs
+++ lua-rexlib-2.4.0/debian/liblua5.1-rex-doc.docs
@@ -0,0 +1 @@
+doc/
--- lua-rexlib-2.4.0.orig/debian/rules
+++ lua-rexlib-2.4.0/debian/rules
@@ -0,0 +1,4 @@
+#!/usr/bin/make -f
+
+include /usr/share/cdbs/1/class/lua.mk
+include /usr/share/cdbs/1/rules/dpatch.mk
--- lua-rexlib-2.4.0.orig/debian/patches/00dpatch.conf
+++ lua-rexlib-2.4.0/debian/patches/00dpatch.conf
@@ -0,0 +1,2 @@
+conf_debianonly=1
+conf_origtargzpath=../tarballs/
--- lua-rexlib-2.4.0.orig/debian/patches/fix-align-arm.dpatch
+++ lua-rexlib-2.4.0/debian/patches/fix-align-arm.dpatch
@@ -0,0 +1,58 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix-align-arm.dpatch by Enrico Tassi <gareuselesinge@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix memory alignment issues on arm
+## DP: see http://luaforge.net/tracker/index.php?func=detail&aid=47649&group_id=63&atid=344
+
+@DPATCH@
+diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' trunk~/src/common.c trunk/src/common.c
+--- trunk~/src/common.c 2007-04-20 11:25:46.000000000 +0200
++++ trunk/src/common.c 2010-11-07 10:21:16.000000000 +0100
+@@ -8,6 +8,10 @@
+ #include "lauxlib.h"
+ #include "common.h"
+
++#ifndef N_ALIGN
++#define N_ALIGN 4 /* valid values: 1, 2, 4 */
++#endif
++
+ /* the table must be on Lua stack top */
+ int get_int_field (lua_State *L, const char* field)
+ {
+@@ -153,7 +157,8 @@
+ buf->arr = p;
+ buf->size = 2 * newtop;
+ }
+- memcpy (buf->arr + buf->top, src, sz);
++ if (src)
++ memcpy (buf->arr + buf->top, src, sz);
+ buf->top = newtop;
+ }
+
+@@ -168,6 +173,12 @@
+ header[1] = len;
+ buffer_addlstring (buf, header, sizeof (header));
+ buffer_addlstring (buf, src, len);
++#if N_ALIGN != 1
++ {
++ int n = len % N_ALIGN;
++ if (n) buffer_addlstring (buf, NULL, N_ALIGN - n);
++ }
++#endif
+ }
+
+ static void bufferZ_addnum (TBuffer *buf, size_t num) {
+@@ -232,6 +243,12 @@
+ if (*ptr_header == ID_STRING) {
+ *str = buf->arr + *iter;
+ *iter += *num;
++#if N_ALIGN != 1
++ {
++ int n = *iter % N_ALIGN;
++ if (n) *iter += (N_ALIGN - n);
++ }
++#endif
+ }
+ return 1;
+ }
--- lua-rexlib-2.4.0.orig/debian/patches/00list
+++ lua-rexlib-2.4.0/debian/patches/00list
@@ -0,0 +1,2 @@
+test.dpatch
+fix-align-arm.dpatch
--- lua-rexlib-2.4.0.orig/debian/patches/test.dpatch
+++ lua-rexlib-2.4.0/debian/patches/test.dpatch
@@ -0,0 +1,24 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## test.dpatch by Enrico Tassi <gareuselesinge@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: fix argument passing in test file
+
+@DPATCH@
+diff -urNad trunk~/test/runtest.lua trunk/test/runtest.lua
+--- trunk~/test/runtest.lua 2008-08-01 12:18:58.000000000 +0200
++++ trunk/test/runtest.lua 2009-08-20 17:25:54.000000000 +0200
+@@ -51,6 +51,7 @@
+ onig = { lib = "rex_onig", "common_sets", "onig_sets", }
+ }
+
++function main(...)
+ do
+ local verbose, tests, nerr = false, {}, 0
+ local dir
+@@ -94,3 +95,5 @@
+ end
+ print ("Total number of failures: " .. nerr)
+ end
++end
++main(unpack(arg))