Use a rockspec template like the following, and call it $PACKAGE.rockspec.in:
package="@PACKAGE@"
version="@VERSION@-1"
source = {
url = "https://github.com/downloads//@PACKAGE@/@PACKAGE@-@VERSION@.tar.gz",
md5 = "@MD5@",
dir = "@PACKAGE@-@VERSION@"
}
description = {
summary = "",
detailed = [[
]],
homepage = "http://github.com//@PACKAGE@/",
license = ""
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "command",
build_command = "LUA=$(LUA) CPPFLAGS=-I$(LUA_INCDIR) ./configure --prefix=$(PREFIX) --libdir=$(LIBDIR) --datadir=$(LUADIR)",
install_command = "make install"
}
Add "$PACKAGE.rockspec.in" to AC_CONFIG_FILES in your configure.ac:
Add or amend the following rules in your Makefile.am:
ROCKSPEC = $(PACKAGE)-$(VERSION)-1.rockspec
$(ROCKSPEC): $(PACKAGE).rockspec dist sed -e 's/@MD5@/'`$(MD5SUM) $(distdir).tar.gz | \ cut -d " " -f 1`'/g' < $(PACKAGE).rockspec > $@
EXTRA_DIST = $(PACKAGE).rockspec.in
DISTCLEANFILES = $(PACKAGE).rockspec
If you use woger to do your releases, then add $(ROCKSPEC) to the dependencies of your release target, and call woger something like:
woger lua,github package=$(PACKAGE) package_name=$(PACKAGE_NAME) \ version="$(VERSION)" description="`LUA_INIT= LUA_PATH='$(abs_srcdir)/?.rockspec.in' $(LUA) -l$(PACKAGE) -e 'print (description.summary)'`" \ notes=release-notes-$(VERSION) dist_type=".zip"