dh-lua-19/0000755000000000000000000000000012215130547007345 5ustar dh-lua-19/doc/0000755000000000000000000000000012215130547010112 5ustar dh-lua-19/doc/get_used_vars.lua0000644000000000000000000000023712215130547013451 0ustar f = io.open("policy.txt") data = f:read("*all") vars = {} string.gsub(data,"{[A-Z_]*}",function (s) vars[s] = true end) for k,v in pairs(vars) do print(k) end dh-lua-19/doc/policy.txt0000644000000000000000000004364512215130547012166 0ustar Debian Lua policy (v@@V@@) =============================== Index ----- * [Conventions](#ch-conventions) * [Rationale](#ch-rationale) * [Packages Contents](#ch-pkgcontents) * [Run time package: `lua-{PKG_NAME}` ](#sec-runtime) * [Development package: `lua-{PKG_NAME}-dev` ](#sec-devel) * [Packages Contents (an example)](#sec-pkgconsample) * [Creating a package in a quick and clean way](#ch-quickandclean) * [The `dh-lua` package](#sec-pkgpolicydev) * [Writing a `debian/dh-lua.conf` file](#sec-makefileconf) * [The `rules` file](#sec-rules) * [No `.install` files](#sec-install) * [The control file](#sec-control) * [Multiple packages from the same source](#sec-multipkg) * [Automatically testing your package](#sec-autotest) * [Notes on undefined symbols and packages dependencies](#ch-notesundef) * [Notes on source package names](#ch-notessource) Conventions ----------- In the following we shall write `{VARIABLE}` to mean a schema of file names. The following ones are the most relevant: - `{LUA_VERSION}` The Lua major version, like `5.1` or `5.2` - `{PKG_NAME}` The name of the library, like `expat`, `lpeg` and `sql` - `{LUA_MODNAME}` The string used to `require` the module, like `lxp` Rationale --------- For every library two packages will be available, one containing only the minimum needed to run `require "{LUA_MODNAME}"` and one with all the other stuff (documentation or headers and library files to link standalone applications). The former package will be named `lua-{PKG_NAME}` while the latter will be named `lua-{PKG_NAME}-dev` even if it contains only documentation (like pure lua libraries). The motivation is that it may be modified in the future to include some C parts (and this would imply a renaming). The headers files `.h` are intended to declare the simple `luaopen_{LUA_MODNAME}` function. To avoid bloating the Debian archive with minuscule packages, a `-doc` package should be provided only if documentation is very large. Including a short documentation in the `-dev` package does not hurt. If the same source package is able to provide more than one couple of deb packages (like luasql, that provides various backends) only one copy of the source package should be added to the archive and let that package generate all the needed debs. All packages should be named with a common prefix, like `lua-{PKG_NAME}-` that in the case of luasql will produce the following debs: `lua-sql-mysql`, `lua-sql-mysql-dev`, `lua-sql-sqlite` and `lua-sql-sqlite-dev`. If the package is made of a common part the best would be to put it in a package whose name ends with the `-common` suffix. All debs should then depend on it. This avoids playing with diversions. The same also applies to documentation, that (if common to all debs) should not be replicated on all `-dev` packages, but put in a `-doc` package. Packages Contents ----------------- Here a listing of the contents of the two packages will follow. ### Run time package: `lua-{PKG_NAME}` - `/usr/lib/liblua{LUA_VERSION}-{PKG_NAME}.so.{ABI}` - `/usr/lib/liblua{LUA_VERSION}-{PKG_NAME}.so.{CABI} -> liblua{LUA_VERSION}-{PKG_NAME}.so.{ABI}` - `/usr/lib/lua/{LUA_VERSION}/{LUA_MODNAME}.so -> ../../liblua{LUA_VERSION}-{PKG_NAME}.so.{ABI}` - `/usr/share/lua/{LUA_VERSION}/*.lua` ### Development package: `lua-{PKG_NAME}-dev` - `/usr/include/lua{LUA_VERSION}/*.h` - `/usr/lib/liblua{LUA_VERSION}-{PKG_NAME}.a` - `/usr/lib/liblua{LUA_VERSION}-{PKG_NAME}.so -> liblua{LUA_VERSION}-{PKG_NAME}.so.{ABI}` - `/usr/share/doc/liblua{LUA_VERSION}-{PKG_NAME}-dev/*` - `/usr/lib/pkgconfig/lua{LUA_VERSION}-{PKG_NAME}.pc` Should a `-doc` package exist, only the following files will be contained in the package: - `/usr/share/doc/lua-{PKG_NAME}-doc/*` ### Packages Contents (an example) *`lua-expat`* - `/usr/lib/liblua5.1-expat.so.0.0.0` - `/usr/lib/liblua5.1-expat.so.0 -> liblua5.1-expat.so.0.0.0` - `/usr/lib/lua/5.1/lxp.so -> ../../liblua5.1-expat.so.0.0.0` - `/usr/share/lua/5.1/lxp/lom.lua` *`lua-expat-dev`* - `/usr/include/lua5.1/lxplib.h` - `/usr/lib/liblua5.1-expat.a` - `/usr/lib/liblua5.1-expat.so -> liblua5.1-expat.so.0.0.0` - `/usr/share/doc/lua-expat-dev/us/*html` - `/usr/lib/pkgconfig/lua5.1-expat.pc` Creating a package in a quick and clean way ------------------------------------------- Since all lua libraries look almost the same, we provide a common set of templates to help building packages conforming the policy and allowing single-place modification all over these packages. ### The `dh-lua` package The following files are contained in the package: - `dh-lua.conf` is a configuration file sourced by make. - `app.c` and `app.c.conf.in` are automatically handled by `dh-lua` and they implement an interpreter that calls `luaopen_{LUA_MODNAME}` and runs the file taken as parameter. `dh-lua` test links twice this interpreter (one time dynamically and one statically, i.e. including the library) and runs it on the test file. - `pkg-config.pc.in` is automatically handled by `dh-lua` that will create for you a policy-conforming `.pc` file. Since these files are needed at compile time, you should put `dh-lua` in your `Build-Depends` field. In addition to these files it provides the following utility: - `lua-create-gitbuildpackage-layout` should be used to create the svn repository of the debian packages. It build an git-buildpackage ready layout, adding the standard `debian/rules` file, a `debian/watch` template and a `debian/dh-lua.conf` template. Then it is necessary to edit `debian/dh-lua.conf`, create a changelog file with `dch --create`, write down the `debian/control` and `debian/copyright` files. ### Writing a `debian/dh-lua.conf` file You will find a template file called `dh-lua.conf` in the `dh-lua` package (see `/usr/share/dh-lua/template/`). Note that if you used the `lua-create-svnbuildpackage-layout` utility to create the package svn repository, you will find a template in `debian/`. The `LUA_VERSION` field is *mandatory*, unless you name the `dh-lua` configuration file in a special way (see [Multiple packages](#sec-multipkg)) - `LUA_VERSION=5.1` The `PKG_NAME` field is *mandatory*, the usual name of the library should be used (like `curl` or `logging` for luacurl and lualogging). - `PKG_NAME=curl` The next part is for the C part of the library (if any). - `CLIB_CFLAGS= -I src/` - `CLIB_LDFLAGS= $(shell pkg-config libcurl --libs)` - `CLIB_LDFLAGS_STATIC= $(shell pkg-config libcurl --libs --static)` - `CLIB_OBJS= src/lxplib.lo` - `VERSION_INFO=0:0:0` Remember that all `.c` files have to produce a `.lo` files (in libtool tradition). List them in the `CLIB_OBJS` field. `CLIB_CFLAGS` and `CLIB_LDFLAGS` have the standard meaning (see the [make manual][5]), while the `CLIB_LDFLAGS_STATIC` variant is used when building the statically linked test application (if `LUA_TEST` is not empty). `VERSION_INFO` is libtool specific (read libtool documentation if in doubt). It should be avoided in packages created using `dh-lua`, it is there for retrocompatibility with the `lua5.1-policy-dev` helper. The next part is for the lua part of the library (if any). - `LUA_HEADER=src/lxplib.h` - `LUA_SOURCES=$(wildcard src/lxp/*.lua)` - `LUA_SOURCES_MANGLER=sed s?^src/??` - `LUA_MODNAME=lxp` - `LUA_TEST=tests/test.lua` - `LUA_MODNAME_CPART=lxp` `LUA_MODNAME` will be the module name used inside lua (with `require`), if empty `PKG_NAME` will be used. `LUA_HEADER` points to the file (if any) that declares the `luaopen_LUA_MODNAME_CPART` C function (if the library has a C part), if omitted (and if the library has a C part) a trivial `.h` file will be automatically generated. `LUA_SOURCES` point to the `.lua` files. `LUA_SOURCES_MANGLER` is a program that takes in standard input one item in `LUA_SOURCES` and mangles it. The default value is `cat` that makes no change. Note that the escape character `\` has to be doubled, for example `\(a\|b\)` becomes `\\(a\\|b\\)` and `\1` becomes `\\1`. Single quotes `'` should be avoided in favour of double quotes `"`. `LUA_TEST` points to the test file that will be run once the library is compiled. `LUA_MODNAME_CPART` is the suffix of the C function to load the module (if empty `LUA_MODNAME` is used). The next part is for pkg-config (if the library has a C part). - `PKG_VERSION=` - `PKG_LIBS_PRIVATE=` - `PKG_URL=` - `PKG_REQUIRES=` - `PKG_CONFLICTS=` All these fields are explained in the manpage of pkg-config. If `PKG_VERSION` is unspecified, the following one liner is run to compute a value starting from `debian/changelog`:
dpkg-parsechangelog | grep ^Ver | cut -d ' ' -f 2 | cut -d '-' -f 1
### The `rules` file If you used the `lua-create-svnbuildpackage-layout` a standard file is placed in `debian/` for you. If not, you can use this one:
#!/usr/bin/make -f

%:
        dh $@ --buildsystem=lua --with lua
Note that there are various targets one can hook to in order to fix things. The following example illustrates how to add extra stuff to the configuration phase, the testing phase and how to clean up the mess at the end:
override_dh_auto_configure:
	echo "do some extra stuff before"
	dh_auto_configure
	echo "and some more after"

override_dh_auto_test:
	echo "prepare the test phase"
	dh_auto_test

override_dh_auto_clean:
	dh_auto_clean
	echo "remove the mess!"
### No `.install` files All `.install` files are provided by two templates part of dh-lua. The template `lib.install.in` generates the following `lua-{PKG_NAME}.install` file:
/usr/share/lua/{LUA_VERSION}/*
/usr/lib/*.so.*
/usr/lib/lua/{LUA_VERSION}/{LUA_MODNAME_UNDERSCORE}.so
Where `{LUA_MODNAME_UNDERSCORE}` is `{LUA_MODNAME}` where `.` is replaced by `_`. Also, a line is generated only if it is relevant. In the example above the package in question has both a C and a Lua part. The template `dev.install.in` generates the following `lua-{PKG_NAME}-dev.install` file:
/usr/lib/pkgconfig/*
/usr/include/lua{LUA_VERSION}/*
/usr/lib/*.so
/usr/lib/*.a
If you need to ship more files, you may add a `.install.in` file. This file can contain a line like the following one to reuse the text of the template file:
include @@TEMPLATE@@/lib.install.in
Moreover, to ship your files to the right path, take into account that `@@LUA_VERSION@@` string is substituted with the`{LUA_VERSION}` value, `@@DEB_HOST_MULTIARCH@@` with the corresponding `dpkg-architecture -qDEB_HOST_MULTIARCH` value. To install documentation, please use a `.docs` file. ### The control file Two variables will be automatically substituted by `dh-lua` in the control file. - `${lua:Versions}` is substituted in the control file of any package that has in its binary stanza the field `XB-Lua-Versions`. The value is going to be something like `5.1 5.2`, or `5.1`, depending on how many versions of the module exist (see also the following section). - `${lua:Provides}` should be used in the `Provides` field. Its value is the list of (versioned) virtual packages. For example the package `lua-lpeg` that compiles for both Lua 5.1 and 5.2 will provide `lua5.1-lpeg` and `lua5.2-lpeg`. In this way `apt-cache search 5.2 lpeg` finds the `lua-lpeg` package. Moreover a software can just declare a dependency over `lua5.2-lpeg` if sufficient. ### Multiple packages from the same source It is possible that the same source package provides more (and distinct) modules. This is the case for `luasql` that provides various backends. `dh-lua` is able to cope with this situation if it finds a set of files (and not a single file) that match the pattern `debian/*dh-lua.conf`. The variables `{PKG_NAME}` and `{LUA_MODNAME}` can be set using the `.` symbol to separate modules. In `luasql` the file `debian/mysql.dh-lua.conf` defines: - `PKG_NAME=sql.mysql` - `LUA_MODNAME=luasql.mysql` The latter is the one expected since it is the same string used with `require`, while the former is used to infer the deb package name, substituting `.` with `-` when needed. A special case is when the the configuration file name starts with `lua${LUA_VERSION}`. In that case the `LUA_VERSION` variable can be omitted and it is automatically set to the value extracted from the file name. Supported values are `5.2` and `5.1`. This makes it possible to use one single conf file to build the library for both Lua 5.1 and 5.2. It is sufficient to name the file like `debian/lua5.1.lpeg.dh-lua.conf` and add a symlink to it named like `debian/lua5.2.lpeg.dh-lua.conf`. Of course this trick can be used only if the library is agnostic and works out of the box with both versions of Lua with no modifications. ### Automatically testing your package If you specify the `LUA_TEST` variable in the `dh-lua.conf` file, three tests will be performed after compilation and before building the package. * `lua-dynamic-test` calls the lua standard interpreter in the following way: `lua{LUA_VERSION} -l LUA_MODNAME LUA_TEST` (note that if you set `LUA_TEST` to something like `tests/test.lua arg1 arg2` the arguments will be passed to the test). The lua interpreter should found the `.lua` and eventual `.so` files in the current working directory. For that purpose `LUA_MODNAME` is used to make a symbolic link pointing to the real `.so` file during build phase. If you need a different setting, set an hook for `pre-lua-dynamic-test-hook` * `app-dynamic-test` builds a minimal application that is linked (at compile time) with the C par of the library (if any). This means that the lua interpreter should load the C part of the library calling a function that is already linked with the binary, and not use dlopen as in the previous test. This minimal application is `app.c` that includes a minimal configuration file that is tuned using the variables defined in `Makefile.Debian.conf` (see the [code snippet](#snippet-appconf) at the end of this section). The variables between `@@` will be replaced with their values (the `_UNDERSCORE` is simply the result of replacing `.` by `_`). This code means that when a `require` is issued for `LUA_MODNAME_CPART` the corresponding C function `luaopen_LUA_MODNAME_CPART_UNDERSCORE` is called * `app-static-test` behaves exactly as `app-dynamic-test`, but libtool is run to statically link the C code of the library into the `app` executable
  #include "@@LUA_HEADER@@"
  static void app_open(lua_State* L){
    lua_getglobal(L,"package");
    lua_getfield(L,-1,"preload");
    lua_pushcfunction(L,luaopen_@@LUA_MODNAME_CPART_UNDERSCORE@@);
    lua_setfield(L,-2,"@@LUA_MODNAME_CPART@@");
  }
Multiple tests can be separated by a `;`, like in `LUA_TEST=test1.lua; test2.lua`. Moreover one can give a context for the test like in `LUA_TEST=cd test/ && @@LUA@@ test.lua`. `@@LUA@@` will be substituted with the something like `LUA_INIT=... lua5.1 -l${LUA_MODNAME}`. Of course you cannot use `;`. To run a custom command, for example to avoid `-l${LUA_MODNAME}`, the `LUA_TEST_CUSTOM` variable can be used instead. There `;` can be used, `@@LUA@@` is substituted for something like `LUA_INIT=... lua5.1`. Shell expansions are not reliable anyway. To code `for X in a b; do echo $X; done` one has to write `$(foreach X,a b,echo $(X);)`, using make syntax. ### Debugging `dh-lua` understands `DH_VERBOSE`. For example tp get verbose output for the test phase, you can put the following lines in `debian/rules`:
override_dh_auto_test: 
	DH_VERBOSE=1 dh_auto_test
### Fine tuning `dh-lua` while developing The `DH_LUA_OPTS` variable can be set to a space separated list of the following values: * verbose * skip-test-lua-dynamic * skip-test-app-dynamic * skip-test-app-static Notes on undefined symbols and packages dependencies ---------------------------------------------------- All lua libraries are not linked against `liblua5.1.so`, so all `lua_` and `luaL_` prefixed symbols will appear as undefined (i.e. using `objdump -T` to inspect them and look for symbols marked with `*UND*`). This is a *feature* since: - The interpreter is statically linked with that library and exports all the needed symbols. This means that it is able to dlopen the library with any troubles. - Any application linked against `liblua5.1.so` has these symbols defined, thus can load the library safely. - If libraries are linked against `liblua5.1.so` you would see `liblua5.1.so` resident in memory loading them from the lua interpreter (try `cat /proc/PID/maps`). But the interpreter already had that code loaded. As a side effect, all lua libraries do not depend on the `liblua5.1` package (and must not declare it in the `Depends` field). All dependencies among other lua libraries must be declared. A `-dev` package must depend on the `-dev` packages corresponding to the other lua libraries that it uses, while the runtime package (non `-dev` package) must depend only on the runtime package relative to the other lua libraries that it uses. Notes on source package names ----------------------------- All source packages should be named `lua-{PKG_NAME}` for consistency. ------------------------------------------------------------------------------- This file follows the markdown syntax. See [Markdown][1] and [lua markdown][2]. [1]: http://daringfireball.net/projects/markdown/ "Markdown Homepage" [2]: http://luaforge.net/projects/markdown/ "Lua implementation of markdown" [3]: http://www.gnu.org/software/libtool/ "GNU Libtool" [4]: http://pkgconfig.freedesktop.org/wiki/ "pkg-config tool" [5]: http://www.gnu.org/software/make/manual/make.html "GNU Make" dh-lua-19/doc/Makefile0000644000000000000000000000133312215130547011552 0ustar all: html/policy.html POLICY_VERSION=$(shell cd ..;dpkg-parsechangelog | grep Version | cut -d : -f 2) used-vars: lua get_used_vars.lua html/%.html:%.txt echo '' > $@ echo "" >> $@ echo "" >> $@ # assume first line of markdown is main header to use for page title echo "$(shell head -n 1 $< | sed 's/@@V@@/$(POLICY_VERSION)/')" >> $@ echo '' >> $@ echo "" >> $@ echo "" >> $@ cat $< | sed 's/@@V@@/$(POLICY_VERSION)/' | markdown >> $@ echo "" >> $@ echo "" >> $@ clean: rm -f html/policy.html dh-lua-19/doc/html/0000755000000000000000000000000012215130547011056 5ustar dh-lua-19/doc/html/style.css0000644000000000000000000000126312215130547012732 0ustar body { background-color: #FFFFf2; font-family: sans-serif; width: 50em; margin-left: auto; margin-right: auto; } h1 { text-align: center; } h2 { border-bottom-style: solid; border-bottom-width: 2px; border-bottom-color: #AAAAAA; } a:hover { color: #ffffff; background-color: #1030f0; text-decoration: none; } a.nohover:hover { background-color: transparent; } a code { font-family: inherit; } blockquote p { margin:0pt; padding-left:0pt; } pre, blockquote { display: block; padding-left:1em; padding-right:1em; padding-top:1em; padding-bottom:1em; margin-left:4em; margin-right:4em; border-style: solid; border-width: 1px; background-color: #DDDDDD; } dh-lua-19/test/0000755000000000000000000000000012215130547010324 5ustar dh-lua-19/test/5.1/0000755000000000000000000000000012215130547010627 5ustar dh-lua-19/test/5.1/app.c.conf.in0000644000000000000000000000050012215130547013077 0ustar // Copyright: © 2012 Enrico Tassi // License: MIT/X #include "@@LUA_HEADER@@" static void app_open(lua_State* L){ lua_getglobal(L,"package"); lua_getfield(L,-1,"preload"); lua_pushcfunction(L,luaopen_@@LUA_MODNAME_CPART_UNDERSCORE@@); lua_setfield(L,-2,"@@LUA_MODNAME_CPART@@"); } dh-lua-19/test/5.1/app.c0000644000000000000000000000304412215130547011554 0ustar // Copyright: © 2012 Enrico Tassi // License: MIT/X #include #include #include #include // this should include all the needed libraries and // define // static void app_open(lua_State* L) #include "app.c.conf" int main(int argn,char** argv){ int rc; int i; const char *init = getenv("LUA_INIT"); // create a lua VM lua_State* L = lua_open(); if (L == NULL) { fprintf(stderr,"Unable to allocate a lua_State"); return 1; } // load stdlib lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ luaL_openlibs(L); /* open libraries */ lua_gc(L, LUA_GCRESTART, 0); // LUA_INIT if (init != NULL && luaL_dostring(L, init)) { const char* error = NULL; error = lua_tostring(L,-1); fprintf(stderr,"app.c: %s\n",error); return 1; } // here the specific luaopen_MODULENAME app_open(L); // LOAD rc = luaL_loadfile(L,argv[1]); // check for errors if (rc != 0){ const char* error = NULL; error = lua_tostring(L,-1); fprintf(stderr,"app.c: %s\n",error); return 1; } // RUN! lua_newtable(L); for(i=1;i // License: MIT/X #include "@@LUA_HEADER@@" static void app_open(lua_State* L){ lua_getglobal(L,"package"); lua_getfield(L,-1,"preload"); lua_pushcfunction(L,luaopen_@@LUA_MODNAME_CPART_UNDERSCORE@@); lua_setfield(L,-2,"@@LUA_MODNAME_CPART@@"); } dh-lua-19/test/5.2/app.c0000644000000000000000000000305112215130547011553 0ustar // Copyright: © 2012 Enrico Tassi // License: MIT/X #include #include #include #include // this should include all the needed libraries and // define // static void app_open(lua_State* L) #include "app.c.conf" int main(int argn,char** argv){ int rc; int i; const char *init = getenv("LUA_INIT"); // create a lua VM lua_State* L = luaL_newstate(); if (L == NULL) { fprintf(stderr,"Unable to allocate a lua_State"); return 1; } // load stdlib lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ luaL_openlibs(L); /* open libraries */ lua_gc(L, LUA_GCRESTART, 0); // LUA_INIT if (init != NULL && luaL_dostring(L, init)) { const char* error = NULL; error = lua_tostring(L,-1); fprintf(stderr,"app.c: %s\n",error); return 1; } // here the specific luaopen_MODULENAME app_open(L); // LOAD rc = luaL_loadfile(L,argv[1]); // check for errors if (rc != 0){ const char* error = NULL; error = lua_tostring(L,-1); fprintf(stderr,"app.c: %s\n",error); return 1; } // RUN! lua_newtable(L); for(i=1;i # License: MIT/X # vim: foldmethod=marker:ft=make # override for more verbose output ifeq "$(DH_VERBOSE)-$(findstring verbose,$(DH_LUA_OPTS))" "-" H=@ else H= endif include $(CONFIGURATION_FILE) ### {{{gnu make haks empty:= space:=$(empty) $(empty) ### }}} ### {{{ a bunch of definitions (standard at least for debian) ### you should not need to change this # LUA_VERSION ifeq "$(LUA_VERSION)" "" LUA_VERSION:=$(if $(shell echo $(CONFIGURATION_FILE) | grep ^debian/lua5\.2),5.2) endif ifeq "$(LUA_VERSION)" "" LUA_VERSION:=$(if $(shell echo $(CONFIGURATION_FILE) | grep ^debian/lua5\.1),5.1) endif # UID for the LUA_VERSION UID=$(shell pwd)/$(LUA_VERSION)-$(PKG_NAME) # misc DH_LUA_SUPPORT_FILES=/usr/share/dh-lua/ LUA=lua$(LUA_VERSION) C_TEST_FILE=$(DH_LUA_SUPPORT_FILES)test/$(LUA_VERSION)/app.c PREFIX=$(DESTDIR)/usr/ LBTL=libtool --silent --tag=CC ifeq "$(LUA_SOURCES_MANGLER)" "" LUA_SOURCES_MANGLER:=cat endif # .pc PKG_CONF_NAME=$(LUA)-$(PKG_NAME_DASH).pc DEB_PKGCONFIG_TEMPL=$(DH_LUA_SUPPORT_FILES)/template/pkg-config.pc.in PKGCONF=pkg-config $(LUA) --define-variable=prefix=$(PREFIX) ifeq "$(PKG_VERSION)" "" PKG_VERSION=$(shell dpkg-parsechangelog|grep ^Ver|cut -d ' ' -f 2|cut -d '-' -f 1) endif # CFLAGS LUA_CFLAGS := $(shell $(PKGCONF) --cflags) CFLAGS := $(shell dpkg-buildflags --get CFLAGS) CFLAGS += $(shell dpkg-buildflags --get CPPFLAGS) CFLAGS += $(LUA_CFLAGS) $(CLIB_CFLAGS) -Wall -Wextra STD_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) LDFLAGS_STATIC = $(STD_LDFLAGS) $(CLIB_LDFLAGS_STATIC) LDFLAGS = $(STD_LDFLAGS) $(CLIB_LDFLAGS) # liblua5.1-foo.so.0.0.0 VERSION_INFO ?= 0:0:0 LIBNAME=lib$(LUA)-$(PKG_NAME_DASH) REALSO=$(LIBNAME).so.$(subst :,.,$(VERSION_INFO)) # /usr/lib/liblua5.1.la LUA_LBTL_S := $(shell $(PKGCONF) --libs --static) LUA_LBTL_D := $(shell $(PKGCONF) --libs) # /usr/lib/, /usr/lib/lua/5.1, /usr/share/lua/5.1/ LUA_CPATH:=$(shell $(PKGCONF) --variable=INSTALL_CMOD) LUA_SPATH:=$(shell $(PKGCONF) --variable=INSTALL_LMOD) DEB_HOST_MULTIARCH:=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) LUA_LPATH=$(PREFIX)/lib/$(DEB_HOST_MULTIARCH) # /usr/include/lua5.1 LUA_HPATH:=$(shell $(PKGCONF) --variable=includedir)/$(LUA) # debian packages name and derivates PKG_NAME_DASH=$(subst .,-,$(PKG_NAME)) DEB_PKG_LIB=lua-$(PKG_NAME_DASH) DEB_PKG_DEV=$(DEB_PKG_LIB)-dev # .h ifeq "$(LUA_HEADER)" "" LUA_HEADER=$(UID)/lua-$(PKG_NAME_DASH).h endif DEB_HEADER_TEMPL=$(DH_LUA_SUPPORT_FILES)template/header.h.in # names for require and for luaopen ifeq "$(LUA_MODNAME)" "" LUA_MODNAME=$(PKG_NAME) endif ifeq "$(LUA_MODNAME_CPART)" "" LUA_MODNAME_CPART=$(LUA_MODNAME) endif # luasql.mysql -> /usr/lib/lua/5.1/sql/mysql LUA_MODNAME_PATH=$(subst .,/,$(LUA_MODNAME_CPART)) # luaopen_luasql_mysql(lua_State* L) ifeq "$(LUA_MODNAME_CPART_UNDERSCORE)" "" LUA_MODNAME_CPART_UNDERSCORE=$(subst .,_,$(LUA_MODNAME_CPART)) endif # depending on the nesting, a '../' for every level LUA_MODNAME_DOTS=$(shell echo $(LUA_MODNAME_CPART) | sed 's/[^\.]//g' | sed 's/\./..\//g') # .install DEB_INST_LIB=debian/$(DEB_PKG_LIB).install DEB_INST_LIB_TEMPL=$(DH_LUA_SUPPORT_FILES)template/lib.install.in DEB_INST_DEV=debian/$(DEB_PKG_DEV).install DEB_INST_DEV_TEMPL=$(DH_LUA_SUPPORT_FILES)template/dev.install.in # where to find stuff LUA_INIT=' package.path="$(UID)/?.lua;$(UID)/?/init.lua;"..package.path; package.cpath="$(UID)/?.so;"..package.cpath; ' # to help crosscompiling DEB_BUILD_ARCH:=$(shell dpkg-architecture -qDEB_BUILD_ARCH) DEB_HOST_ARCH:=$(shell dpkg-architecture -qDEB_HOST_ARCH) # lua5.2 specific ifeq "$(LUA_VERSION)" "5.2" LUA_TEST := $(subst /usr/bin/shake,,$(LUA_TEST)) endif # test LUA_TEST_KIND:=fake ifneq "$(LUA_TEST)" "" LUA_TEST_KIND:=real endif ifneq "$(LUA_TEST_CUSTOM)" "" LUA_TEST_KIND:=real-custom endif ### }}} .PHONY: build clean test install configure sanity # ---------------------- Here starts the Makefile ------------------------------ # {{{ entrypoints ifeq "$(CLIB_OBJS)" "" build: sanity test: sanity test-lua-dynamic install: sanity installcommon else build: sanity $(UID)/$(LIBNAME).la test: sanity test-lua-dynamic test-app-dynamic test-app-static install: sanity installcommon installso endif clean: sanity $(H)$(RM) -rf $(UID)/ $(H)$(call empty_trash) # fix for leftovers of dh-lua < 14 $(H)$(RM) -f debian/backup autopkgtest: sanity test-lua-dynamic-apkgt-$(LUA_TEST_KIND) sanity: $(H)if [ -z "$(LUA_VERSION)" ]; then\ echo;\ echo ERROR: LUA_VERSION is not set;\ echo;\ exit 1;\ fi # }}} # {{{ helper macros define trash echo $(1) >> debian/trash endef define empty_trash if [ -e debian/trash ]; then \ $(RM) -f `cat debian/trash` debian/trash; fi endef define subst_vars sed \ -e 's@@TEMPLATE@@$(DH_LUA_SUPPORT_FILES)templateg' \ -e 's^include \(.\)cat \1g' \ -e '/^cat ./e' \ -e 's@@PKG_VERSION@@$(PKG_VERSION)g' \ -e 's@@PKG_NAME@@$(PKG_NAME_DASH)g' \ -e 's@@PKG_LUA@@$(LUA)g' \ -e 's@@PKG_LIBS_PRIVATE@@$(PKG_LIBS_PRIVATE)g' \ -e 's@@PKG_URL@@$(PKG_URL)g' \ -e 's@@PKG_REQUIRES@@$(PKG_REQUIRES)g' \ -e 's@@PKG_CONFLICTS@@$(PKG_CONFLICTS)g' \ -e 's@@LIBNAME@@$(LIBNAME)g' \ -e 's@@DEB_HOST_MULTIARCH@@$(DEB_HOST_MULTIARCH)g' \ -e 's@@LUA@@$(LUA)g' \ -e 's@@LUA_VERSION@@$(LUA_VERSION)g' \ -e 's@@LUA_MODNAME_CPART_UNDERSCORE@@$(LUA_MODNAME_CPART_UNDERSCORE)g' \ -e 's@@LUA_MODNAME_CPART@@$(LUA_MODNAME_CPART)g' \ -e 's@@LUA_MODNAME_PATH@@$(LUA_MODNAME_PATH)g' \ -e 's@@LUA_HEADER@@$(notdir $(LUA_HEADER))g' \ -e 's@@LUA_SOURCES@@$(LUA_SOURCES)g' \ -e 's@@LUA_SOURCES_MANGLER@@$(LUA_SOURCES_MANGLER)g' \ -e 's@@CLIB_OBJS@@$(CLIB_OBJS)g' \ -e 's@@[A-Z_]*@@g' \ -e '/^test ./e' endef define merge_with (while read line; do\ [ -e $(1) ] || touch $(1);\ if grep -q -F "$$line" $(1); then\ if [ ! -z "$$line" ]; then\ echo "Skipping already existing line: $$line";\ fi\ else\ echo "Adding new line: $$line";\ echo "$$line" >> $(1);\ fi;\ done) endef define assert if [ "$(1)" != "$(2)" ]; then\ echo;\ echo "ERROR:" $(3);\ echo;\ exit 1;\ fi endef define all_packages_with_luaVersions grep-dctrl -s Package -F XB-Lua-Versions lua:Versions debian/control | \ cut -d : -f 2 endef define all_packages_with_luaProvides grep-dctrl -s Package -F Provides lua:Provides debian/control | \ cut -d : -f 2 endef define subst_lua $(if $(findstring @@LUA@@,$(1)),($(subst @@LUA@@,$(2),$(1))),$(2) $(1)) endef define export_env HOME=$(shell pwd)/debian LUA_INIT=$(LUA_INIT) \ SEGFAULT_SIGNALS=all PATH="$(UID)/:$$PATH" $(1) endef define export_env_apkgt HOME="$(ADTTMP)" \ SEGFAULT_SIGNALS=all PATH="$(UID)/:$$PATH" $(1) endef define run_multiple_tests $(foreach test,$(subst ;,$(space),$(subst $(space),_space_,$(1))),\ echo "Test: $(subst _space_,$(space),$(test))" && \ cd $(shell pwd) && \ $(call subst_lua,\ $(subst _space_,$(space),$(test)),\ $(call export_env$(3),$(2))) &&) true endef define run_custom_test cd $(shell pwd) && $(call subst_lua,$(1),$(call export_env$(3),$(2))) endef # }}} # ---------------------------- Testing ----------------------------------------- # {{{ test the module, from lua and from a dynamically/statically linked C app test-lua-dynamic-fake: @echo "********************** lua dynamic ($(LUA_VERSION)) *********" @echo SKIPPED! @echo "**************************************************" test-app-static-fake: $(UID)/app-static @echo "*********************** app static ($(LUA_VERSION)) *********" @echo SKIPPED! @echo "**************************************************" test-app-dynamic-fake: $(UID)/app-dynamic @echo "********************** app dynamic ($(LUA_VERSION)) *********" @echo SKIPPED! @echo "**************************************************" test-lua-dynamic-real: @echo "********************** lua dynamic ($(LUA_VERSION)) *********" $(H)$(call run_multiple_tests,$(LUA_TEST),catchsegv $(LUA) -l$(LUA_MODNAME)) @echo "**************************************************" test-lua-dynamic-real-custom: @echo "****************** lua dynamic custom ($(LUA_VERSION)) ******" $(H)$(call run_custom_test,$(LUA_TEST_CUSTOM),catchsegv $(LUA)) @echo "*************************************************" test-lua-dynamic-apkgt-real: @echo "************ lua dynamic ($(LUA_VERSION), autopkgtest) *********" $(H)$(call run_multiple_tests,\ $(LUA_TEST),catchsegv $(LUA) -l$(LUA_MODNAME),_apkgt) @echo "**************************************************" test-lua-dynamic-apkgt-real-custom: @echo "********* lua dynamic custom ($(LUA_VERSION), autopkgtest) ******" $(H)$(call run_custom_test,$(LUA_TEST_CUSTOM),catchsegv $(LUA),_apkgt) @echo "*************************************************" test-app-static-real: $(UID)/app-static @echo "*********************** app static ($(LUA_VERSION)) *********" $(H)$(call run_multiple_tests,$(LUA_TEST),catchsegv $(UID)/app-static) @echo "**************************************************" test-app-dynamic-real: $(UID)/app-dynamic @echo "********************** app dynamic ($(LUA_VERSION)) *********" $(H)$(call run_multiple_tests,$(LUA_TEST),\ $(LBTL) --mode=execute -dlopen $(UID)/$(LIBNAME).la \ catchsegv $(UID)/app-dynamic) @echo "**************************************************" ifneq "$(DEB_HOST_ARCH)" "$(DEB_BUILD_ARCH)" ifeq "$(CLIB_OBJS)" "" test-lua-dynamic: test-lua-dynamic-$(LUA_TEST_KIND) else test-lua-dynamic: test-lua-dynamic-fake endif test-app-static: test-app-static-fake test-app-dynamic: test-app-dynamic-fake else ifneq "$(findstring skip-test-lua-dynamic,$(DH_LUA_OPTS))" "" test-lua-dynamic: test-lua-dynamic-fake else test-lua-dynamic: test-lua-dynamic-$(LUA_TEST_KIND) endif ifneq "$(findstring skip-test-app-static,$(DH_LUA_OPTS))" "" test-app-static: test-app-static-fake else test-app-static: test-app-static-$(LUA_TEST_KIND) endif ifneq "$(findstring skip-test-app-dynamic,$(DH_LUA_OPTS))" "" test-app-dynamic: test-app-dynamic-fake else test-app-dynamic: test-app-dynamic-$(LUA_TEST_KIND) endif endif # }}} # ------------------------- Installation --------------------------------------- # {{{ install static and dynamic libraries for module to global location installso: $(UID)/$(LIBNAME).la $(UID)/$(PKG_CONF_NAME) $(LUA_HEADER) # .so $(H)echo Installing $(LIBNAME) $(H)mkdir -p $(LUA_CPATH) $(H)mkdir -p $(LUA_LPATH) $(H)$(LBTL) --mode=install install \ $(UID)/$(LIBNAME).la \ $(shell pwd)/$(LUA_LPATH)/$(LIBNAME).la $(LBTL) --finish $(LUA_LPATH) $(H)cd $(LUA_CPATH); \ echo Creating symlink $(LUA_MODNAME_PATH).so;\ mkdir -p $(dir $(LUA_MODNAME_PATH));\ ln -s $(LUA_MODNAME_DOTS)../../$(REALSO) $(LUA_MODNAME_PATH).so # .pc $(H)echo Installing $(PKG_CONF_NAME) $(H)mkdir -p $(LUA_LPATH)/pkgconfig/ $(H)$(LBTL) --mode=install install -m 0644 \ $(UID)/$(PKG_CONF_NAME) \ $(shell pwd)/$(LUA_LPATH)/pkgconfig/ # .h $(H)if [ ! -z "$(CLIB_OBJS)" ]; then\ echo Installing $(LUA_HEADER);\ mkdir -p $(LUA_HPATH);\ $(LBTL) --mode=install install -m 0644 \ $(LUA_HEADER) $(shell pwd)/$(LUA_HPATH)/;\ fi installcommon: # .lua $(H)mkdir -p $(LUA_SPATH) $(H)if [ ! -z "$(LUA_SOURCES)" ]; then\ echo Installing $(LUA_SOURCES); \ for X in $(LUA_SOURCES); do\ mkdir -p `dirname $(LUA_SPATH)/$$(echo $$X|$(LUA_SOURCES_MANGLER))`;\ cp $$X $(LUA_SPATH)/`echo $$X|$(LUA_SOURCES_MANGLER)`;\ chmod 644 $(LUA_SPATH)/`echo $$X|$(LUA_SOURCES_MANGLER)`;\ done;\ fi # debian/substvars $(H)for P in $(shell $(call all_packages_with_luaVersions)); do \ echo Filling in debian/$$P.substvars; \ echo lua:Versions=`cat debian/lua_versions` | \ $(call merge_with, debian/$$P.substvars);\ done $(H)for P in $(shell $(call all_packages_with_luaProvides)); do \ ACC=""; \ for V in `cat debian/lua_versions`; do \ PV=`echo $$P | sed "s/^lua-/lua$$V-/"`; \ ACC="$$PV, $$ACC"; \ done; \ echo Filling in debian/$$P.substvars; \ echo lua:Provides=$$ACC | $(call merge_with, debian/$$P.substvars);\ done # }}} # ------------------------- C compilation -------------------------------------- # {{{ compilation rules: .lo .la app $(UID)/%.lo: %.c $(LBTL) --mode=compile $(CC) -c $(CFLAGS) -o $@ $< $(UID)/$(LIBNAME).la $(UID)/$(LUA_MODNAME_PATH).so: $(addprefix $(UID)/,$(CLIB_OBJS)) $(LBTL) --mode=link $(CC) \ -rpath $(LUA_LPATH) -version-info $(VERSION_INFO) -Wl,--no-add-needed \ -o $(UID)/$(LIBNAME).la \ $(patsubst %,$(UID)/%,$(CLIB_OBJS)) \ $(LDFLAGS) $(H)mkdir -p $(UID)/$(dir $(LUA_MODNAME_PATH)) $(H)ln -sf $(LUA_MODNAME_DOTS)./.libs/$(REALSO) \ $(UID)/$(LUA_MODNAME_PATH).so ldd $(UID)/$(LUA_MODNAME_PATH).so $(UID)/app-static: $(UID)/$(LIBNAME).la $(LBTL) --mode=link $(CC) $(CFLAGS) -Wl,--no-add-needed \ -static -o $@ -I . -I $(UID)/ \ $(C_TEST_FILE) $(UID)/$(LIBNAME).la \ $(LDFLAGS_STATIC) $(LUA_LBTL_S) ldd $(UID)/app-static $(UID)/app-dynamic: $(UID)/$(LIBNAME).la $(LBTL) --mode=link $(CC) $(CFLAGS) -Wl,--no-add-needed \ -o $@ -I . -I $(UID)/ \ $(C_TEST_FILE) $(UID)/$(LIBNAME).la \ $(LDFLAGS) $(LUA_LBTL_D) $(LBTL) --mode=execute -dlopen $(UID)/$(LIBNAME).la \ ldd $(UID)/app-dynamic # }}} # ------------------------- configuration -------------------------------------- # {{{ pkgconfig, .install and (evental) .h generation $(UID): $(H)mkdir -p $(UID)/ $(LUA_HEADER): $(H)if [ ! -e $@ ]; then \ cat $(DEB_HEADER_TEMPL) | $(call subst_vars) > $@; \ fi $(UID)/$(PKG_CONF_NAME): $(UID) $(H)cat $(DEB_PKGCONFIG_TEMPL) | $(call subst_vars) > $@ $(UID)/app.c.conf: $(UID) $(H)cat $(C_TEST_FILE).conf.in | $(call subst_vars) > $@ configure: sanity $(UID) $(LUA_HEADER) $(UID)/$(PKG_CONF_NAME) $(UID)/app.c.conf # .install $(H)$(call trash, $(DEB_INST_LIB)) $(H)if [ -e $(DEB_INST_LIB).in ]; then\ echo "Filling in $(DEB_INST_LIB) using $(DEB_INST_LIB).in";\ cat $(DEB_INST_LIB).in | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_LIB));\ else\ echo "Filling in $(DEB_INST_LIB) using $(DEB_INST_LIB_TEMPL)";\ cat $(DEB_INST_LIB_TEMPL) | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_LIB));\ fi $(H)$(call trash, $(DEB_INST_DEV)) $(H)if [ -e $(DEB_INST_DEV).in ]; then\ echo "Filling in $(DEB_INST_DEV) using $(DEB_INST_DEV).in";\ cat $(DEB_INST_DEV).in | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_DEV));\ else\ echo "Filling in $(DEB_INST_DEV) using $(DEB_INST_DEV_TEMPL)";\ cat $(DEB_INST_DEV_TEMPL) | $(call subst_vars) | \ $(call merge_with, $(DEB_INST_DEV));\ fi # lua_versions $(H)$(call trash, debian/lua_versions) $(H)echo Filling in debian/lua_versions $(H)echo $(LUA_VERSION) | $(call merge_with, debian/lua_versions) # tests $(H)ln -sf `which $(LUA)` $(UID)/lua $(H)if [ ! -z "$(LUA_SOURCES)" ]; then\ echo Copying $(LUA_SOURCES) in $(UID) for test; \ for X in $(LUA_SOURCES); do\ mkdir -p `dirname $(UID)/$$(echo $$X|$(LUA_SOURCES_MANGLER))`;\ cp $$X $(UID)/`echo $$X|$(LUA_SOURCES_MANGLER)`;\ done;\ fi # }}} # vim:set ts=4: # eof dh-lua-19/make/dh-lua.Makefile.multiple0000644000000000000000000000136112215130547014726 0ustar # Copyright: © 2012 Enrico Tassi # License: MIT/X # vim: ft=make MODULES=$(wildcard debian/*dh-lua.conf) LUA_SINGLE_MAKEFILE=/usr/share/dh-lua/make/dh-lua.Makefile.single H=@ .PHONY: build clean test install configure build clean test configure autopkgtest: $(H)for X in $(MODULES); do\ echo; \ echo Making target $@ for $$X; \ $(MAKE) --no-print-directory -f $(LUA_SINGLE_MAKEFILE) $@ \ CONFIGURATION_FILE=$$X || exit 1;\ echo Target $@ made;\ echo;\ done install: $(H)for X in $(MODULES); do\ echo; \ echo Making target $@ for $$X; \ $(MAKE) --no-print-directory -f $(LUA_SINGLE_MAKEFILE) $@ \ DESTDIR=debian/tmp \ CONFIGURATION_FILE=$$X || exit 1;\ echo Target $@ made;\ echo;\ done dh-lua-19/debhelper7/0000755000000000000000000000000012215130547011366 5ustar dh-lua-19/debhelper7/buildsystem/0000755000000000000000000000000012215130547013732 5ustar dh-lua-19/debhelper7/buildsystem/lua.pm0000644000000000000000000000241712215130547015055 0ustar # Copyright: © 2012 Enrico Tassi # License: MIT/X # Strongly based on the ruby build systems. Thanks Lucas! package Debian::Debhelper::Buildsystem::lua; use strict; use base 'Debian::Debhelper::Buildsystem'; my $DH_LUA_MAKEFILE="/usr/share/dh-lua/make/dh-lua.Makefile.multiple"; sub DESCRIPTION { "Lua" } sub check_auto_buildable { return 0 } sub new { my $class=shift; my $this=$class->SUPER::new(@_); $this->enforce_in_source_building(); return $this; } sub configure { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "configure", @_); } sub build { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "build", @_); } sub test { my $this=shift; if (defined($ENV{ADTTMP})) { $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "autopkgtest", @_); } else { $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "test", @_); } } sub install { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "install", @_); } sub clean { my $this=shift; $this->doit_in_sourcedir("make", "--no-print-directory", "-f", $DH_LUA_MAKEFILE, "clean", @_); } 1 dh-lua-19/debhelper7/sequence/0000755000000000000000000000000012215130547013176 5ustar dh-lua-19/debhelper7/sequence/lua.pm0000644000000000000000000000052712215130547014321 0ustar #! /usr/bin/perl # Copyright: © 2012 Enrico Tassi # License: MIT/X # Strongly based on the ruby build systems. Thanks Lucas! use warnings; use strict; use Debian::Debhelper::Dh_Lib; add_command("dh_auto_test","autopkgtest"); add_command_options("dh_compress", "-X.lua"); insert_after("dh_install", "dh_lua"); 1 dh-lua-19/template/0000755000000000000000000000000012215130547011160 5ustar dh-lua-19/template/tests.dh-lua-tests0000644000000000000000000000003112215130547014550 0ustar debian/rules autopkgtest dh-lua-19/template/header.h.in0000644000000000000000000000021012215130547013157 0ustar /* This file has been automatically generated by dh-lua */ extern int luaopen_@@LUA_MODNAME_CPART_UNDERSCORE@@(lua_State*); /* eof */ dh-lua-19/template/dev.install.in0000644000000000000000000000047712215130547013743 0ustar test -z "@@CLIB_OBJS@@" || echo usr/lib/@@DEB_HOST_MULTIARCH@@/@@LIBNAME@@.so test -z "@@CLIB_OBJS@@" || echo usr/lib/@@DEB_HOST_MULTIARCH@@/@@LIBNAME@@.a test -z "@@CLIB_OBJS@@" || echo usr/lib/@@DEB_HOST_MULTIARCH@@/pkgconfig/@@LUA@@-@@PKG_NAME@@.pc test -z "@@CLIB_OBJS@@" || echo usr/include/@@LUA@@/@@LUA_HEADER@@ dh-lua-19/template/tests.control0000644000000000000000000000010412215130547013717 0ustar Tests: dh-lua-tests Restrictions: rw-build-tree Depends: @, dh-lua dh-lua-19/template/rules0000644000000000000000000000007312215130547012235 0ustar #!/usr/bin/make -f %: dh $@ --buildsystem=lua --with lua dh-lua-19/template/pkg-config.pc.in0000644000000000000000000000073212215130547014137 0ustar lua=@@PKG_LUA@@ version=@@PKG_VERSION@@ lib_name=@@PKG_NAME@@ libs_private=@@PKG_LIBS_PRIVATE@@ url=@@PKG_URL@@ requires=@@PKG_REQUIRES@@ conflicts=@@PKG_CONFLICTS@@ prefix=/usr libdir=${prefix}/lib includedir=${prefix}/include/${lua} Name: Lua ${lib_name} Description: Lua ${lib_name} engine Version: ${version} URL: ${url} Requires: ${requires} lua5.1 Conflicts: ${conflicts} Libs: -L${libdir} -l${lua}-${lib_name} Libs.private: ${libs_private} Cflags: -I${includedir} dh-lua-19/template/copyright0000644000000000000000000000273612215130547013123 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: Upstream-Contact: Source: Files: * Copyright: Comment: In the Lua community this license is better known as "MIT". Unfortunately other variants of this license are also known as "MIT". To obtain a machine intepretable copyright file Debian prefers to name this version of the MIT license using the non ambiguous term "Expat". License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. dh-lua-19/template/dh-lua.conf0000644000000000000000000000060512215130547013202 0ustar ### mandatory fields LUA_VERSION= PKG_NAME= ### things relative to the C library part CLIB_CFLAGS= CLIB_LDFLAGS= CLIB_LDFLAGS_STATIC= CLIB_OBJS= LUA_MODNAME_CPART= ### things relative to the lua library part LUA_HEADER= LUA_SOURCES= LUA_SOURCES_MANGLER= LUA_MODNAME= LUA_TEST= ### this part is relative to pkg-config PKG_VERSION= PKG_LIBS_PRIVATE= PKG_URL= PKG_REQUIRES= PKG_CONFLICTS= dh-lua-19/template/lib.install.in0000644000000000000000000000050012215130547013716 0ustar test -z "@@CLIB_OBJS@@" || echo usr/lib/@@DEB_HOST_MULTIARCH@@/lua/@@LUA_VERSION@@/@@LUA_MODNAME_PATH@@.so test -z "@@CLIB_OBJS@@" || echo usr/lib/@@DEB_HOST_MULTIARCH@@/@@LIBNAME@@.so.* test -z "@@LUA_SOURCES@@" || for X in @@LUA_SOURCES@@; do echo usr/share/lua/@@LUA_VERSION@@/`echo $X|@@LUA_SOURCES_MANGLER@@`; done dh-lua-19/template/control0000644000000000000000000000166612215130547012574 0ustar Source: lua- Section: interpreters Priority: optional Maintainer: Enrico Tassi Build-Depends: debhelper (>= 9), dh-lua Standards-Version: 3.9.3 Homepage: Vcs-Git: git://git.debian.org/git/pkg-lua/lua-.git Vcs-Browser: http://git.debian.org/?p=pkg-lua/lua-.git Package: lua- Architecture: any Multi-Arch: same Pre-Depends: multiarch-support Depends: ${shlibs:Depends}, ${misc:Depends} Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: bla bla Package: lua--dev Section: libdevel Multi-Arch: same Pre-Depends: multiarch-support Architecture: any Depends: lua- (= ${binary:Version}), ${misc:Depends} Provides: ${lua:Provides} XB-Lua-Versions: ${lua:Versions} Description: bla This package contains the development files of the ... library, useful to create a statically linked binary (like a C application or a standalone Lua interpreter). . Documentation is also shipped within this package. dh-lua-19/man/0000755000000000000000000000000012215130547010120 5ustar dh-lua-19/man/lua-create-gitbuildpackage-layout.10000644000000000000000000000262512215130547016661 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH lua-create-gitbuildpackage-layout 1 "Feb 2012" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME lua-create-gitbuildpackage-layout \- program to create an git-buildpackage compliat repository for a lua package. .SH SYNOPSIS .B lua-create-gitbuildpackage-layout \fIPKG\fR .SH DESCRIPTION .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBlua-create-gitbuildpackage-layout\fP is a program that creates a standard filesystem layout for git-buildpackage and adds some templates files for dh-lua. .SH AUTHOR lua-create-gitbuildpackage-layout was written by Enrico Tassi. .PP This manual page was written by Enrico Tassi , for the Debian project (but may be used by others). dh-lua-19/man/lua-create-svnbuildpackage-layout.10000644000000000000000000000262512215130547016704 0ustar .\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH lua-create-svnbuildpackage-layout 1 "Feb 2012" .\" Please adjust this date whenever revising the manpage. .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME lua-create-svnbuildpackage-layout \- program to create an svn-buildpackage compliat repository for a lua package. .SH SYNOPSIS .B lua-create-svnbuildpackage-layout \fIPKG\fR .SH DESCRIPTION .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. \fBlua-create-svnbuildpackage-layout\fP is a program that creates a standard filesystem layout for svn-buildpackage and adds some templates files for dh-lua. .SH AUTHOR lua-create-svnbuildpackage-layout was written by Enrico Tassi. .PP This manual page was written by Enrico Tassi , for the Debian project (but may be used by others). dh-lua-19/man/dh_lua.10000644000000000000000000001042512215130547011440 0ustar .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "DH_LUA 1" .TH DH_LUA 1 "2012-05-09" "dh_lua" "dh_lua" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" dh_lua \- postprocess a lua package .SH "SYNOPSIS" .IX Header "SYNOPSIS" \&\fBdh_lua\fR [\fIdebhelper\ options\fR] .SH "DESCRIPTION" .IX Header "DESCRIPTION" \&\fBdh_lua\fR is a debhelper program that postprocesses the package build directories. It performs the following actions: .IP "deduplication" 4 .IX Item "deduplication" Files in /usr/share/lua/5.2/ that are copies of files in /usr/share/lua/5.1/ are replaced by symlinks. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIdebhelper\fR\|(7) .PP This program is a part of debhelper. .SH "AUTHOR" .IX Header "AUTHOR" Enrico Tassi dh-lua-19/debian/0000755000000000000000000000000012215130547010567 5ustar dh-lua-19/debian/dh-lua.manpages0000644000000000000000000000000612215130547013452 0ustar man/* dh-lua-19/debian/dh-lua.docs0000644000000000000000000000001112215130547012603 0ustar doc/html dh-lua-19/debian/rules0000755000000000000000000000006312215130547011646 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 %: dh $@ dh-lua-19/debian/compat0000644000000000000000000000000212215130547011765 0ustar 7 dh-lua-19/debian/source/0000755000000000000000000000000012215130547012067 5ustar dh-lua-19/debian/source/format0000644000000000000000000000001512215130547013276 0ustar 3.0 (native) dh-lua-19/debian/changelog0000644000000000000000000001210112215130547012434 0ustar dh-lua (19) unstable; urgency=low * Add sequence autopkgtest to dh, calling dh_auto_test * lua-create-gitbuildpackage-layout installs debian/tests/control and debian/tests/dh-lua-tests so that autopkgtest runs the lua-test-dynamic tests (they are run at build time only otherwise) -- Enrico Tassi Sat, 14 Sep 2013 19:47:03 +0200 dh-lua (18) unstable; urgency=low * Do not override LUA_MODNAME_CPART_UNDERSCORE with the default value * Substitute @@V@@ with the actual policy version in html title -- Enrico Tassi Wed, 21 Aug 2013 10:16:13 +0200 dh-lua (17) unstable; urgency=low * Use 0x04 as a character for sed s command to avoid grabbing any other character (assuming nobody uses ascii 0x04 in a file name). * Better document LUA_SOURCES_MANGLER. * Write the version number in the policy (txt and html) -- Enrico Tassi Sun, 16 Jun 2013 22:49:51 +0200 dh-lua (16) unstable; urgency=low * Fixed some typos (thanks Sylvain Hitier) * Support: `include @@TEMPLATE@@/...` in debian/foo.install.in * Support: `LUA_TEST_CUSTOM` in debian/foo.dh-lua.conf * Moved development to git.d.o * Clean: remove debian/trash * New tool: lua-create-gitbuildpackage-layout * New manpage: lua-create-gitbuildpackage-layout.1 * Issue chmod 644 on files installed in /usr/share/lua/ -- Enrico Tassi Sat, 12 May 2012 18:56:58 +0200 dh-lua (15) unstable; urgency=low * Better template for dh-lua.conf * Template for copyright (1.0 format) * Template for control file -- Enrico Tassi Wed, 09 May 2012 22:23:54 +0200 dh-lua (14) unstable; urgency=low * New dh_lua script, called after dh_install. Its only activity is to deduplicate usr/share/lua/5.2/ w.r.t. usr/share/lua/5.1/ * Cleanup garbage in debian/ properly -- Enrico Tassi Sun, 06 May 2012 21:30:00 +0200 dh-lua (13) unstable; urgency=low * default value for PKG_VERSION -- Enrico Tassi Thu, 03 May 2012 22:42:50 +0200 dh-lua (12) unstable; urgency=low * Add support for LUA_SOURCES_MANGLER. * Add support for test context in LUA_TEST. -- Enrico Tassi Wed, 18 Apr 2012 23:34:32 +0200 dh-lua (11) unstable; urgency=low * During tests set PATH so that 'lua' points to 'lua5.1' or 'lua5.2' depending on the current build. This avoids upstream tests that just call 'lua' to end up using the wrong lua interpreter. -- Enrico Tassi Mon, 02 Apr 2012 09:56:58 +0200 dh-lua (10) unstable; urgency=low * Honour DH_LUA_OPTS to fine tune the behaviour of dh-lua, mainly for debugging or working around bugs in the toolchains. Supported options are: - verbose - skip-test-lua-synamic - skip-test-app-dynamic - skip-test-app-static -- Enrico Tassi Sun, 01 Apr 2012 13:37:04 +0200 dh-lua (9) unstable; urgency=low * Svn add debian/source/format when creating the layout of a new package * lua-create-svnbuildpackage-layout sets svn prop mergeWithUpstream * LUA_SOURCES installs files in their dirname * Make LUA_SOURCES available to the test infrastructure * Honour DH_VERBOSE -- Enrico Tassi Sat, 31 Mar 2012 18:12:59 +0200 dh-lua (8) unstable; urgency=low * Standards-version to 3.9.3 * make/dh-lua.Makefile.single: - test-lua-app-dynamic target fixed, typo in the -fake variant target name - subst_vars fixed to make global substitutions * template/lib.install.in adds a line per item in LUA_SOURCES -- Enrico Tassi Sun, 25 Mar 2012 17:14:11 +0200 dh-lua (7) unstable; urgency=low * Support multiple test files in LUA_TEST (separated by ;) * Honour LUA_INIT=string in app.c * Make LUA_SOURCES available to the tests * Improved logging -- Enrico Tassi Wed, 22 Feb 2012 13:21:25 +0100 dh-lua (6) unstable; urgency=low * Compile with -Wall -Wextra * Cope with lua5.2 not having shake (yet) * Avoid overwriting upstream .h file -- Enrico Tassi Wed, 22 Feb 2012 11:07:32 +0100 dh-lua (5) unstable; urgency=low * Depend on liblua5.1-0-dev, liblua5.2-dev, lua5.1, lua5.2, dctrl-tools * Clean up logging -- Enrico Tassi Tue, 21 Feb 2012 12:52:31 +0100 dh-lua (4) unstable; urgency=low * Depend on libtool and pkg-config -- Enrico Tassi Tue, 21 Feb 2012 10:32:46 +0100 dh-lua (3) unstable; urgency=low * Build-depend on markdown -- Enrico Tassi Mon, 20 Feb 2012 22:54:29 +0100 dh-lua (2) unstable; urgency=low * Fixed build-depends and depends fields (debhelper >= 8) * Put binaris in /usr/bin and not /bin/ -- Enrico Tassi Mon, 20 Feb 2012 22:50:28 +0100 dh-lua (1) unstable; urgency=low * Initial release. (Closes: #660251) -- Enrico Tassi Sun, 19 Feb 2012 11:13:27 +0100 dh-lua-19/debian/copyright0000644000000000000000000000233412215130547012524 0ustar This is dh-lua, written and maintained by Enrico Tassi . The original source can always be found at: ftp://ftp.debian.org/dists/unstable/main/source/ Copyright © 2012 Enrico Tassi. 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. dh-lua-19/debian/control0000644000000000000000000000145212215130547012174 0ustar Source: dh-lua Section: interpreters Priority: optional Maintainer: Enrico Tassi Build-Depends: debhelper (>= 8.0.0), markdown, perl Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/git/pkg-lua/dh-lua.git Vcs-Browser: http://git.debian.org/?p=pkg-lua/dh-lua.git Homepage: http://pkg-lua.alioth.debian.org/ Package: dh-lua Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, debhelper (>= 8.0.0), dctrl-tools, libtool, pkg-config, liblua5.2-dev, lua5.2, liblua5.1-0-dev, lua5.1, libfile-find-rule-perl Description: helper tools for maintaining Lua-related packages This package contains the Debian policy for the Debian packages relative to the Lua scripting language, as well as some tools to help build them. . This package is meant to superseed lua5.1-policy. dh-lua-19/Makefile0000644000000000000000000000234712215130547011013 0ustar # Copyright: © 2012 Enrico Tassi # License: MIT/X DH_LUA_HOME=usr/share/dh-lua/ DH_HOME=usr/share/perl5/Debian/Debhelper/ POLICY_VERSION=$(shell dpkg-parsechangelog | grep Version | cut -d : -f 2) all build: man/dh_lua.1 $(MAKE) -C doc/ clean: $(MAKE) -C doc/ clean test: install: mkdir -p $(DESTDIR)/$(DH_LUA_HOME)/template/ mkdir -p $(DESTDIR)/$(DH_LUA_HOME)/make/ mkdir -p $(DESTDIR)/$(DH_LUA_HOME)/test/5.1/ mkdir -p $(DESTDIR)/$(DH_LUA_HOME)/test/5.2/ mkdir -p $(DESTDIR)/$(DH_HOME)/Buildsystem/ mkdir -p $(DESTDIR)/$(DH_HOME)/Sequence/ mkdir -p $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/usr/share/doc/dh-lua/ cp bin/* $(DESTDIR)/usr/bin/ cp template/* $(DESTDIR)/$(DH_LUA_HOME)/template/ cp make/* $(DESTDIR)/$(DH_LUA_HOME)/make/ cp test/5.1/* $(DESTDIR)/$(DH_LUA_HOME)/test/5.1/ cp test/5.2/* $(DESTDIR)/$(DH_LUA_HOME)/test/5.2/ cp debhelper7/buildsystem/* $(DESTDIR)/$(DH_HOME)/Buildsystem/ cp debhelper7/sequence/* $(DESTDIR)/$(DH_HOME)/Sequence/ cat doc/policy.txt | sed 's/@@V@@/$(POLICY_VERSION)/' \ > $(DESTDIR)/usr/share/doc/dh-lua/policy.txt man/dh_lua.1: bin/dh_lua pod2man -c "dh_lua" -r "dh_lua" bin/dh_lua man/dh_lua.1 upload: all scp doc/html/* alioth.debian.org:pkg-lua/ dh-lua-19/bin/0000755000000000000000000000000012215130547010115 5ustar dh-lua-19/bin/lua-create-svnbuildpackage-layout0000755000000000000000000000374612215130547016552 0ustar #!/bin/sh # Copyright: © 2012 Enrico Tassi # License: MIT echo echo '******************************************************************' echo You should consider using lua-create-gitbuildpackage-layout instead echo '******************************************************************' echo sleep 2 if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then echo Give as a unique argument the name of the source package echo that will be the name of the root directory of the package. echo Be sure to start this script from your packages/ directory. exit 1 fi PKG=$1 SVN= if [ -x /usr/bin/svn ]; then SVN=/usr/bin/svn else echo warning: No /usr/bin/svn found echo warning: The directory structure will be created, but no items echo warning: will be added to the svn repository nor svn properties echo warning: will be set. fi $SVN mkdir $PKG $SVN mkdir $PKG/trunk $SVN mkdir $PKG/tags $SVN mkdir $PKG/build-area $SVN mkdir $PKG/tarballs $SVN mkdir $PKG/trunk/debian $SVN mkdir $PKG/trunk/debian/patches $SVN mkdir $PKG/trunk/debian/source cat > $PKG/trunk/debian/watch < $PKG/trunk/debian/source/format touch $PKG/trunk/debian/patches/series cp /usr/share/dh-lua/template/dh-lua.conf $PKG/trunk/debian/ cp /usr/share/dh-lua/template/rules $PKG/trunk/debian/ cp /usr/share/dh-lua/template/copyright $PKG/trunk/debian/ cp /usr/share/dh-lua/template/control $PKG/trunk/debian/ chmod a+x $PKG/trunk/debian/rules if [ ! -z "$SVN" ]; then $SVN propset svn:ignore '*' $PKG/build-area $SVN propset mergeWithUpstream 1 $PKG/trunk/debian $SVN add $PKG/trunk/debian/patches/series $SVN add $PKG/trunk/debian/watch $SVN add $PKG/trunk/debian/dh-lua.conf $SVN add $PKG/trunk/debian/rules $SVN add $PKG/trunk/debian/copyright $SVN add $PKG/trunk/debian/control $SVN add $PKG/trunk/debian/source/format fi dh-lua-19/bin/dh_lua0000755000000000000000000000435212215130547011303 0ustar #!/usr/bin/perl -w # Copyright © 2012 Enrico Tassi # Heavily based on dh_linktree, # Copyright © 2011-2012 Raphaël Hertzog # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This package is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . =head1 NAME dh_lua - postprocess a lua package =cut use strict; use File::Find::Rule; use File::Compare; use Debian::Debhelper::Dh_Lib; use Dpkg::IPC; =head1 SYNOPSIS B [S>] =head1 DESCRIPTION B is a debhelper program that postprocesses the package build directories. It performs the following actions: =over 4 =item deduplication Files in /usr/share/lua/5.2/ that are copies of files in /usr/share/lua/5.1/ are replaced by symlinks. =back =cut init(); sub mklfn { my ($base, $version, $path) = @_; return "$base/usr/share/lua/$version/$path"; } sub mklrel { my ($base,$version, $path) = @_; $path=~s:^$base/usr/share/lua/$version/::; return $path; } sub mklorig { my ($path) = @_; my @pieces=split(m:/+:,$path); my $res="../"; for (1..$#pieces) { $res.="../"; } $res.="5.1/$path"; return $res; } foreach my $package (@{$dh{DOPACKAGES}}) { my $tmp=tmpdir($package); my @srclinks=(); if (-d mklfn($tmp,"5.1","")) { @srclinks = File::Find::Rule-> name('*.lua')->in(mklfn($tmp,"5.1","")); } while (@srclinks) { my $src=shift @srclinks; my $what=mklrel($tmp,"5.1",$src); my $dest=mklfn($tmp,"5.2",$what); if (compare($src, $dest) == 0) { print "deduplicating $what\n"; doit("ln","-sf", mklorig($what), $dest); } } } =head1 SEE ALSO L This program is a part of debhelper. =head1 AUTHOR Enrico Tassi =cut dh-lua-19/bin/lua-create-gitbuildpackage-layout0000755000000000000000000000314112215130547016514 0ustar #!/bin/sh # Copyright: © 2012 Enrico Tassi # License: MIT if [ -z "$1" -o "$1" = "-h" -o "$1" = "--help" ]; then echo Give as a unique argument the name of the source package echo that will be the name of the root directory of the package. exit 1 fi PKG=$1 mkdir $PKG/ cd $PKG git init git remote add origin ssh://git.debian.org/git/pkg-lua/$PKG.git [ ! -z "$DEBFULLNAME" ] && git config user.name "$DEBFULLNAME" [ ! -z "$DEBEMAIL" ] && git config user.email "<$DEBEMAIL>" cd .. mkdir $PKG/debian mkdir $PKG/debian/patches mkdir $PKG/debian/source mkdir $PKG/debian/tests cat > $PKG//debian/watch < $PKG/debian/source/format touch $PKG/debian/patches/series cp /usr/share/dh-lua/template/dh-lua.conf $PKG/debian/ cp /usr/share/dh-lua/template/rules $PKG/debian/ cp /usr/share/dh-lua/template/copyright $PKG/debian/ cp /usr/share/dh-lua/template/control $PKG/debian/ cp /usr/share/dh-lua/template/tests.control $PKG/debian/tests/control cp /usr/share/dh-lua/template/tests.dh-lua-tests $PKG/debian/tests/dh-lua-tests chmod a+x $PKG/debian/rules cd $PKG git add debian/ cd .. cat > init-repo-$PKG.sh < description mv hooks/post-update.sample hooks/post-update chmod a+x hooks/post-update EOT echo "Now run: scp init-repo-$PKG.sh git.debian.org: && ssh git.debian.org sh init-repo-$PKG.sh"