summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2013-01-08 19:33:39 +0000
committerReuben Thomas <rrt@sc3d.org>2013-01-08 19:33:39 +0000
commitd2db8f840b10d86397082150dae04e613ed23f98 (patch)
treeb132e70479808556b662f90c4038a6e651eb3875
parent7a011b28996890121a5e47d689e974577675442d (diff)
downloadlrexlib-d2db8f840b10d86397082150dae04e613ed23f98.tar.gz
Simplify build system, and release directly from git
-rw-r--r--Makefile65
-rw-r--r--NEWS7
-rw-r--r--doc/Makefile25
-rw-r--r--luarocks-config.lua3
-rw-r--r--mkrockspecs.lua5
-rw-r--r--rockspecs.lua21
6 files changed, 56 insertions, 70 deletions
diff --git a/Makefile b/Makefile
index 6e69c5d..ed761ec 100644
--- a/Makefile
+++ b/Makefile
@@ -1,45 +1,54 @@
# Makefile for lrexlib
-# See src/*/Makefile for user-definable settings
-
-REGNAMES = gnu pcre posix oniguruma tre
+VERSION = 2.7.2
PROJECT = lrexlib
-VERSION = 2.7.1
PROJECT_VERSIONED = $(PROJECT)-$(VERSION)
-DISTFILE = $(PROJECT_VERSIONED).zip
-install: dist
- @for i in *.rockspec; do \
- luarocks make $$i; \
- done
+# Commands
+LUA = lua
+LUAROCKS = luarocks
+CP = cp -a
+RM = rm
+RST2HTML = rst2html
+REGNAMES = gnu pcre posix oniguruma tre
+LUAROCKS_COMMAND = make
-check:
- @if test -z "$(LUA)"; then echo "Set LUA to run tests"; exit 1; fi
- @for i in $(REGNAMES); do \
- LUA_PATH="test/?.lua;$(LUA_PATH)" $(LUA) test/runtest.lua -dsrc/$$i $$i; \
- done
-docs:
- @make -C doc
+.SUFFIXES: .txt .html
+
+HTML = doc/index.html doc/manual.html
+
+.txt.html:
+ $(RST2HTML) --stylesheet-path=doc/lrexlib.css --link-stylesheet --initial-header-level=2 --date --time $< $@
-rockspecs: dist
+build:
+ $(MAKE) install LUAROCKS="$(LUAROCKS) --tree=luarocks"
+
+install: rockspecs
+ for i in *.rockspec; do \
+ $(LUAROCKS) $(LUAROCKS_COMMAND) $$i; \
+ done
+
+rockspecs:
rm -f *.rockspec
- lua mkrockspecs.lua $(VERSION) `md5sum $(DISTFILE)`
+ $(LUA) mkrockspecs.lua $(VERSION)
-dist: docs
- git2cl > ChangeLog
- cd .. && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT) -x "lrexlib/.git/*" "*.gitignore" "*.o" "*.a" "*.so" "*.so.*" "*.zip" "*SciTE.properties" "*scite.properties" "*.rockspec" "lrexlib/luarocks/*" && mv $(DISTFILE) $(PROJECT) && cd $(PROJECT) && unzip $(DISTFILE) && mv $(PROJECT) $(PROJECT_VERSIONED) && rm -f $(DISTFILE) && zip $(DISTFILE) -r $(PROJECT_VERSIONED) && rm -rf $(PROJECT_VERSIONED)
+doc/index.txt: README.rst
+ $(CP) $< $@
-WOGER_ARGS = package=$(PROJECT) package_name=$(PROJECT) version=$(VERSION) description="Lua binding for regex libraries" notes=release-notes dist_type="zip" github_user=rrthomas
+check: build
+ for i in $(REGNAMES); do \
+ LUA_PATH="test/?.lua;$(LUA_PATH)" $(LUA) test/runtest.lua -dsrc/$$i $$i; \
+ done
-release: rockspecs check
+clean:
+ $(RM) $(HTML) doc/index.txt *.rockspec
+
+release: check
agrep -d 'Release' $(VERSION) NEWS | tail -n +3 | head -n -2 > release-notes && \
git diff --exit-code && \
git tag -a -m "Release tag" rel-`echo $(VERSION) | sed -e 's/\./-/g'` && \
git push && git push --tags && \
- woger github $(WOGER_ARGS) && \
- for i in *.rockspec; do \
- LUAROCKS_CONFIG=luarocks-config.lua luarocks --tree=luarocks build $$i; \
- done && \
- woger lua $(WOGER_ARGS)
+ $(MAKE) build LUAROCKS_COMMAND=build && \
+ woger lua package=$(PROJECT) package_name=$(PROJECT) version=$(VERSION) description="Lua binding for regex libraries" notes=release-notes home="https://github.com/rrthomas/$PROJECT"
rm -f release-notes
diff --git a/NEWS b/NEWS
index 076a1b5..3e932eb 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,10 @@
+2013-01-08 Release 2.7.2
+
+ * Fixed the use of alternative allocators, and a memory leak.
+ * Simplify the build system further.
+ * Change rockspec to build from git now that github no longer
+ supports downloads.
+
2012-10-18 Release 2.7.1
* Fixed Lua 5.1 compatibility, broken in 2.7.0.
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 3dc3402..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Documentation Makefile
-
-APP = rst2html
-CP = cp -a
-RM = rm
-IDX = ../README.rst
-
-.SUFFIXES: .txt .html
-
-CSS = --stylesheet-path=lrexlib.css --link-stylesheet
-HDR = --initial-header-level=2
-DT = --date --time
-
-PAGES = index.html manual.html
-
-.txt.html:
- $(APP) $(CSS) $(HDR) $(DT) $< $@
-
-all: $(PAGES)
-
-index.txt: $(IDX)
- $(CP) $< $@
-
-clean:
- $(RM) $(PAGES) index.txt
diff --git a/luarocks-config.lua b/luarocks-config.lua
deleted file mode 100644
index 582623b..0000000
--- a/luarocks-config.lua
+++ /dev/null
@@ -1,3 +0,0 @@
-rocks_trees = {
- "./luarocks"
-}
diff --git a/mkrockspecs.lua b/mkrockspecs.lua
index 6a2506c..d0596e6 100644
--- a/mkrockspecs.lua
+++ b/mkrockspecs.lua
@@ -2,13 +2,12 @@
require "std"
-if select ("#", ...) < 2 then
- io.stderr:write "Usage: mkrockspecs VERSION MD5SUM\n"
+if select ("#", ...) < 1 then
+ io.stderr:write "Usage: mkrockspecs VERSION\n"
os.exit ()
end
version = select (1, ...)
-md5sum = select (2, ...)
function format (x, indent)
indent = indent or ""
diff --git a/rockspecs.lua b/rockspecs.lua
index 3fe2615..d95e647 100644
--- a/rockspecs.lua
+++ b/rockspecs.lua
@@ -1,31 +1,30 @@
-local flavours = {"PCRE", "POSIX", "oniguruma", "TRE", "GNU"}
-
-- Rockspec data
-- Variables to be interpolated:
--
-- flavour: regex library
-- version
--- md5sum: checksum of distribution tarball
--- When Lua 5.1 support is dropped, use an env argument with loadfile
--- instead of wrapping in a table
+local flavours = {"PCRE", "POSIX", "oniguruma", "TRE", "GNU"}
+local version_dashed = version:gsub ("%.", "-")
+
+-- FIXME: When Lua 5.1 support is dropped, use an env argument with
+-- loadfile instead of wrapping in a table
return {
default = {
package = "Lrexlib-"..flavour,
version = version.."-1",
source = {
- url = "https://github.com/downloads/rrthomas/lrexlib/lrexlib-"..version..".zip",
- md5 = md5sum
+ url = "git://github.com/rrthomas/zee.git",
+ tag = "rel-"..version_dashed,
},
description = {
summary = "Regular expression library binding ("..flavour.." flavour).",
detailed = [[
- Lrexlib is a regular expression library for Lua 5.1 and 5.2, which
- provides bindings for several regular expression libraries.
- This rock provides the ]]..flavour..[[ bindings.
- ]],
+Lrexlib is a regular expression library for Lua 5.1 and 5.2, which
+provides bindings for several regular expression libraries.
+This rock provides the ]]..flavour..[[ bindings.]],
homepage = "http://github.com/rrthomas/lrexlib",
license = "MIT/X11"
},