diff --git a/.travis.yml b/.travis.yml index 460c327..98d8c76 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,6 @@ env: - PACKAGE=slingshot - ROCKSPEC=$PACKAGE-git-1.rockspec - LUAROCKS_CONFIG=build-aux/luarocks-config.lua - - LUAROCKS_BASE=luarocks-2.1.1 - LUAROCKS="$LUA $HOME/bin/luarocks" matrix: - LUA=lua5.1 LUA_INCDIR=/usr/include/lua5.1 LUA_SUFFIX=5.1 @@ -26,14 +25,16 @@ install: - sudo apt-get install liblua5.1-dev - sudo apt-get install lua5.2 - sudo apt-get install liblua5.2-dev - # Install a recent luarocks release locally for everything else. - - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz - - tar zxvpf $LUAROCKS_BASE.tar.gz - - ( cd $LUAROCKS_BASE; + + # Install a luarocks beta locally for everything else. + - git clone --depth=1 https://github.com/keplerproject/luarocks.git + # LuaRocks configure --with-lua argument is just a prefix! + - ( cd luarocks; ./configure - --prefix=$HOME --lua-version=$LUA_SUFFIX --lua-suffix=$LUA_SUFFIX - --with-lua-include=$LUA_INCDIR; - make all install; ) + --prefix=$HOME --with-lua=/usr --lua-version=$LUA_SUFFIX + --lua-suffix=$LUA_SUFFIX --with-lua-include=$LUA_INCDIR; + make build; + make install; ) # Configure and build. script: diff --git a/AUTHORS b/AUTHORS index fac9728..3c2974f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -18,8 +18,6 @@ and suggestions. `ax_lua.m4`. * Tim Perkins : Wrote the original version of `ax_lua.m4`. - * Tim Toolan : - For `ax_compare_version.m4`. * Akim Demaille , Eric Blake , Simon Josefsson : Authors of upstream release rules in gnulib `maint.mk`, adapted as diff --git a/ChangeLog b/ChangeLog index 54ce617..8e1ca08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,160 @@ +2014-07-31 Gary V. Vaughan + + Release version 7 + * NEWS: Record release date. + + release: use new luarocks 2.2.0 upload command. + * build-aux/release.mk (LUAROCKS): New macro. Default to luarocks. + (upload): New phony rule. Call luarocks upload with release + rockspec file. + (release): Add `$(MAKE) upload`. + * NEWS: Update. + + maint: add a waffle.io badge to README.md. + * README.md: Add a waffle.io badge. + + travis: use git luarocks for moonrocks and upload. + * travis.yml.in (LUAROCKS_BASE): Remove. + (install): Build a shallow git clone of luarocks repo HEAD. + * .travis.yml: Regenerate. + + m4: sync ax_lua.m4 with upstream. + * m4/ax_lua.m4: Sync with upstream. + +2014-05-25 Gary V. Vaughan + + mkrockspecs: set datarootdir in addition to datadir subset. + * src/mkrockspecs.in (default.build): When using a GNU autotools + driven installation, we still set datarootdir so that (among + others) the documentation trees are installed to the correct rock + directory. But, don't mangle datadir while doing so! + + mkrockspecs: set datarootdir instead of just datadir subset. + * src/mkrockspecs.in (default.build): When using a GNU autotools + driven installation, set datarootdir so that (among others) the + documentation trees are installed to the correct rock directory. + +2014-05-24 Gary V. Vaughan + + Merge pull request #3 from rrthomas/master + Sync ax_lua.m4 with autoconf-archive + +2014-05-23 Reuben Thomas + + Sync ax_lua.m4 with autoconf-archive + +2014-05-23 Gary V. Vaughan + + m4: discard stderr, in case Lua fails for any reason. + * m4/ax_lua.m4 (_AX_LUA_CHK_VER): For compatibility with the contract + from the previous (shell|sed|awk) implementation, discard stderr output. + (AX_PROG_LUA): Missing backtick. + + m4: use discovered Lua interpreter for its own version analysis. + * m4/ax_lua.m4 (AX_PROG_LUA): Use discovered Lua interpreter to + repor its own version number. + (_AX_LUA_CHK_VER): Use Lua code for version comparison rather + than depending on AX_COMPARE_VERSION macro, some awk and a slew + of sed. + * m4/ax_compare_version.m4: Remove. Surplus to newly reduced + requirements. + * AUTHORS, README.md: Remove references to ax_compare_version.m4. + * NEWS: Update. + +2014-05-21 ncopa + + m4: don't use GNU grep extensions in portable scripts. + * m4/ax_lua.m4 (AX_PROG_LUA): \+ is not valid in standard BRE. + Use bare + in ERE with `grep -E`. + +2014-04-15 Gary V. Vaughan + + bootstrap: fix a typo in help. + * build-aux/bootstrap.slingshot (slingshot_options_prep): Add the + missing 'l' back into buildreq. + * bootstrap: Regenerate. + +2014-04-05 Gary V. Vaughan + + release: adjust for github url changes. + * build-aux/release.mk (_PRE): Raw file content is now served + from `https://raw.githubusercontent.com/...`. + (GITHUB_ROCKSPEC): Replace the `github` part of the prefix with + $(_PRE) too. + + release: fix quote nesting. + * build-aux/release.mk (public-submodule-commit): Fix quote + nesting. + +2014-03-23 Gary V. Vaughan + + travis: luarocks requires `make build`, not `make all`. + * travis.yml.in (install): Use `make build` for LuaRocks. + * .travis.yml: Regenerate. + + travis: redo LuaRocks configuration. + * travis.yml.in (install): LuaRocks configure --with-lua switch + stands in for --with-lua-prefix. Adjust and simplify. + * .travis.yml: Regenerate. + + travis: set $LUAROCKS interpreter explicitly. + * travis.yml.in: Prefix every $LUAROCKS with $LUA. + * .travis.yml: Regenerate. + + travis: revert previous change, and let luarocks pick its own Lua. + * travis.yml.in (LUAROCKS): Remove $LUA prefix. + * .travis.yml: Regenerate. + + travis: ensure LUA is defined before LUAROCKS is expanded. + * travis.yml.in (env): Switch order of matrix and global sections. + * .travis.yml: Regenerate. + + travis: luarocks-2.1.2 seems to need more configure arguments. + * travis.yml.in (install): Add --lua-suffix argument to configure. + * .travis.yml: Regenerate. + + travis: luarocks-2.1.2 configuration tweaks. + * travis.yml.in (install): The configure arguments used for + luarocks-2.1.1 don't work with 2.1.2. Adjust accordingly. + * .travis.yml: Regenerate. + +2014-03-22 Gary V. Vaughan + + docs: improve README. + * README.md: Fix some typos, and improve clarity a little. + + travis: regenerate .travis.yml. + * .travis.yml: Regenerate. + +2014-01-21 Gary V. Vaughan + + travis: bump luarocks install to release 2.1.2. + * travis.yml.in (LUAROCKS_BASE): Bump to 2.1.2. + +2014-01-17 Gary V. Vaughan + + specl: propagate $LUA to prevent mixing interpeters. + * build-aux/specl.mk (specl-check-local): Add LUA=$(LUA) to + Specl execution environment. + 2014-01-16 Gary V. Vaughan + mkrockspecs: handle .../init.lua files properly. + * src/mkrockspecs.in (loadmap): Don't leave trailing `.init` in + the key field of the build.modules table. + * NEWS: Update. + + mkrockspecs: add --repository option for rock/repo name mismatch. + * src/mkrockspecs.in (setopt): New function factored out of option + setting code duplication. + Use it to implement `--repository`. + * NEWS: Update. + configury: bump version to 7. * configure.ac (AC_INIT): Bump version to 7. * build-aux/merge-sections: Regenerate. -2014-01-16 Gary V. Vaughan +2014-01-15 Gary V. Vaughan Revert "mkrockspecs: slingshot doesn't need slingshot submodule git magic!" and others... This reverts commits 039367682f360cec97324e3fdb58bc3443938468, @@ -223,6 +373,8 @@ bootstrap: sync with upstream. * bootstrap: Pick up recent fixes from upstream. +2014-01-01 Gary V. Vaughan + maint: update copyright notices. Add rules, and update all copyright notices. * GNUmakefile (update-copyright): New rule to run @@ -247,6 +399,8 @@ * .travis.yml: Regenerate. * NEWS: Update. +2013-12-08 Gary V. Vaughan + mkrockspecs: fix a typo. * src/mkrockspecs.in: Add missing 's' to spec.build.modules reset. @@ -259,8 +413,6 @@ configury: bump release version to 6. * configure.ac (AC_INIT): Bump release version to 6. -2013-12-08 Gary V. Vaughan - maint: post-release administrivia. * NEWS: Add header line for next release. * .prev-version: Record previous version. @@ -306,7 +458,7 @@ * travis.yml.in (install): If libyaml.so is not in /usr/lib, search for suitable libraries and link them into place. -2013-09-27 Gary V. Vaughan +2013-09-26 Gary V. Vaughan mkrockspecs: sort generated rockspec tables asciibetically. * src/mkrockspecs.in (format): Collect and sort keys within @@ -329,6 +481,8 @@ * build-aux/release.mk (ChangeLog): If gitlog_args macro is set, then pass it to gitlog-to-changelog script. +2013-09-24 Gary V. Vaughan + maint: add .version to gitignore. * .gitignore: ignore .version. @@ -360,7 +514,7 @@ there are additional user-defined SPECL_OPTS. * NEWS: Update. -2013-08-30 Gary V. Vaughan +2013-08-29 Gary V. Vaughan bootstrap: sync with upstream. * bootstrap: Sync with upstream, to fix a bug that still clones @@ -403,13 +557,11 @@ much improved by putting the test fils in a subdirectory and traversing only that. -2013-08-29 Gary V. Vaughan - bootstrap: sync with upstream. * bootstrap: Use the latest upstream version with better portability to OpenBSD, and CLI compatibility with the GNU bootstrap script. -2013-08-26 Gary V. Vaughan +2013-08-25 Gary V. Vaughan mkrockspecs: don't dereference the lyaml.load return table. * src/mkrockspecs.in: Now that we expect the API to be consistent @@ -446,7 +598,7 @@ * m4/slingshot.m4 (AC_CONFIG_FILES): Strip trailing whitespace. * .travis.yml: Regenerate. -2013-06-28 Gary V. Vaughan +2013-06-27 Gary V. Vaughan release: remove git submodules before .gitmodules file. * build-aux/release.mk (check-in-release-branch): Don't run `git @@ -483,7 +635,7 @@ work with ldoc. * NEWS: Update. -2013-05-25 Gary V. Vaughan +2013-05-24 Gary V. Vaughan release: copy scm_rockspec to release branch. * Makefile.am (save_release_files): Default setting. @@ -631,6 +783,8 @@ appropriate special handling of luadoc and specl. * .travis.yml: Regenerate. +2013-05-05 Gary V. Vaughan + travis: shell picks up locally installed luarocks/bin scripts. * travis.yml.in (script): Prepend luarocks bin directory to PATH. @@ -677,8 +831,6 @@ parent project that doesn't have all the listed fragments. * local.mk: Put project specific fragment includes here. -2013-05-05 Gary V. Vaughan - travis: regenerate .travis.yml. * .travis.yml: Regenerate. @@ -688,7 +840,7 @@ configury: fix a typo. * configure.ac (AC_PATH_PROG): Spell false correctly. -2013-05-02 Gary V. Vaughan +2013-05-01 Gary V. Vaughan release: redo announcements without mutt mail wrapper. * build-aux/mail: Remove. @@ -758,6 +910,8 @@ * README.md: Add some blank lines around list items to get a definition-list-like display. +2013-04-28 Gary V. Vaughan + release: distribute .autom4te.cfg. * build-aux/release.mk (release_extra_dist): Add .autom4te.cfg. @@ -802,8 +956,6 @@ release: ensure git rockspec is available for announcement. * build-aux/release.mk (announcement): Add depedency on scm_rockspec. -2013-04-28 Gary V. Vaughan - release: create new release branch at v1 tag. * build-aux/release.mk (check-in-release-branch): If there is no release branch yet, create the new at the v1 tag rather than the diff --git a/Makefile.in b/Makefile.in index 636f925..a86d641 100644 --- a/Makefile.in +++ b/Makefile.in @@ -226,9 +226,8 @@ DIST_COMMON = $(srcdir)/local.mk $(srcdir)/src/src.mk \ $(top_srcdir)/build-aux/missing subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_lua.m4 $(top_srcdir)/m4/slingshot.m4 \ - $(top_srcdir)/configure.ac +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_lua.m4 \ + $(top_srcdir)/m4/slingshot.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -1009,7 +1008,7 @@ docs/mkrockspecs.1: build-aux/mkrockspecs Makefile build-aux/mkrockspecs; \ fi specl-check-local: $(specl_SPECS) - $(SPECL_ENV) $(SPECL) $(SPECL_OPTS) $(specl_SPECS) + $(SPECL_ENV) LUA=$(LUA) $(SPECL) $(SPECL_OPTS) $(specl_SPECS) $(luarocks_config): Makefile.am @test -d build-aux || mkdir build-aux diff --git a/NEWS b/NEWS index 3dbe180..0e61464 100644 --- a/NEWS +++ b/NEWS @@ -1,20 +1,33 @@ Slingshot NEWS - User visible changes. -* Noteworthy changes in release ?.?.? (????-??-??) +* Noteworthy changes in release 7 (2014-07-31) [stable] ** New Features: + - Slingshot `make release` now requires a LuaRocks binary that supports + the upload command (such as the 2.2.0 beta release) and uses that to + upload rockspecs directly to the moonrocks repository, rather than + emailing the luarocks-developer list with an upload request. If the + upload fails due to a missing api-key, then make sure you have one + at rocks.moonscript.org/settings and call make like this: + + make upload API_KEY=0123456789abcdefghijklmnopqrstuvwxyzABCDE + - `mkrockspecs` accepts a new `--branch` option for generating a git/scm rockspec that pulls that branch instead of master. + - `mkrockspecs` accepts a new `--repository` option to cope with + releasing a LuaRock from a repository with a different name, e.g: + `stdlib-36-1.rockspec` from `http://github.com/rrthomas/lua-stdlib`. + - Slingshot bootstrap will check rockspecs listed in $buildreq, according to the URL part of a specification-triple ending in - `.rockspec`. So that we don't have to install, say, LDoc twice - for Travis (once in the system rocks tree so that bootstrap - won't bomb out with a missing rockspec error, and then again - in the project rocks tree after luarocks-config.ld has been - built by make), the rockspec version checks can be short- - circuited by setting an APPVAR in bootstrap's environment, e.g: + `.rockspec`. So that we don't have to install, say, LDoc twice for + Travis (once in the system rocks tree so that bootstrap won't bomb + out with a missing rockspec error, and then again in the project + rocks tree after luarocks-config.ld has been built by make), the + rockspec version checks can be short-circuited by setting an APPVAR + in bootstrap's environment, e.g: LDOC=`pwd`/luarocks/bin/ldoc ./bootstrap @@ -24,10 +37,16 @@ Slingshot NEWS - User visible changes. - `build-aux/merge-sections` has a new `--verbose` flag that reports progress to stderr in real time. + - Remove m4/ax_compare_version.m4 and dependencies, resulting in a + slightly faster and smaller configure. + ** Bugs fixed: - `bootstrap` now has `slingshot_copy` merged in correctly. + - `mkrockspecs` generates build.modules keys correctly for the + `foo/bar/init.lua` pattern. + * Noteworthy changes in release 6 (2014-01-04) [stable] diff --git a/README b/README index 0fa562f..16042c8 100644 --- a/README +++ b/README @@ -2,22 +2,28 @@ SLINGSHOT ========= [![travis-ci status](https://secure.travis-ci.org/gvvaughan/slingshot.png?branch=master)](http://travis-ci.org/gvvaughan/slingshot/builds) +[![Stories in Ready](https://badge.waffle.io/gvvaughan/slingshot.png?label=ready&title=Ready)](https://waffle.io/gvvaughan/slingshot) [Slingshot][] releases rocks! The files shipped with this project form the common foundation I use -to manage [LuaRocks][] releases from github for my other projects, to -save having to propagate changes to the release process between them -every-time I make an update. +to manage [LuaRocks][] releases from github for all my other projects. +This promotes the good programming trait of **laziness** by saving me +from having to manually propagate improvements to my release process +between them all every-time I update. Installation ------------ -Using it fully involves copying `bootstrap` into your project and -checking it in . Running `bootstrap` will now set up a [Slingshot][] -submodule, a `.gitmodules` file, and link to the slingshot files -described below for the matching slingshot version checked out into -the submodule. +Incorporating [Slingshot][] into your project involves copying the +Slingshot `bootstrap` script into your project root directory and +checking it in. You should probably write and check in a project +`bootstrap.conf` with a list of files you want slingshot to manage +for you in the `slingshot_files` variable. + +Running `bootstrap` after that will set up a [Slingshot][] git +submodule, along with requisite `.gitmodules` file, and link any +slingshot managed files nominated into your project tree. * `bootstrap`: @@ -30,24 +36,24 @@ the submodule. Note that the [Slingshot][] `bootstrap` script has extra functions compared to the Libtool `bootstrap` on which it is based, and the - two are not interchangable! + two are **not** interchangable! - * `bootstrap.texi`: + * `docs/bootstrap.texi`: texinfo documentation for `bootstrap`. Alternatively, pick and choose whichever of the following files you want to make use of into your project, and either list them in a -`slingshot_files` variable in your `bootstrap.conf`, or just copy -them to your project and check them in (if you don't care about -automatically keeping them in sync with future releases): +`slingshot_files` variable in your `bootstrap.conf` (or just copy +them to your project and check them in, as long as you don't care +about automatically keeping them in sync with future releases): * `gitlog-to-changelog`, `do-release-commit-and-tag`: adapted from the [GNU Gnulib][] project, with changes for portability - and applicability to a Lua based projects. + and applicability to a Lua based project. - * `ax_lua.m4`, `ax_compare_version.m4`: + * `ax_lua.m4`: taken from the [GNU Autoconf Archive][], to help autoconf discover where Lua and its files are installed on your system. @@ -63,9 +69,9 @@ automatically keeping them in sync with future releases): given a list of files with section headers in boxes like this: - ## ------------- ## - ## Section Name. ## - ## ------------- ## + > ## ------------- ## + > ## Section Name. ## + > ## ------------- ## this script merges those sections into identically named sections from standard input. This script is used by [Slingshot][] itself @@ -121,7 +127,9 @@ the previous release version number. `release.mk` will maintain these files for you once you have them in place. You'll also need a `rockspec.conf` file to feed the `mkrockspecs` -script. +script, and probably a `local.mk` with your project specific build +rules. + Usage ----- @@ -145,7 +153,9 @@ repository, and don't push the changes back to origin. Use `make release RELEASE_TYPE=stable` to perform a full release process, including pushing changes back to origin, and mailing an -announcement taken from the NEWS file. +announcement taken from the NEWS file. You can override the mail +addresses by setting `announce_emails` and `rockspec_emails` in your +`local.mk` fragment. [gnu gnulib]: http://gnu.org/s/gnulib diff --git a/aclocal.m4 b/aclocal.m4 index 05b078f..277766d 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -735,6 +735,5 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR -m4_include([m4/ax_compare_version.m4]) m4_include([m4/ax_lua.m4]) m4_include([m4/slingshot.m4]) diff --git a/bootstrap b/bootstrap index 82dcf5c..575ce48 100755 --- a/bootstrap +++ b/bootstrap @@ -2163,7 +2163,7 @@ Slingshot Options: --luarocks-tree=DIR check a non-default tree for prerequisite rocks --skip-rock-checks - ignore Lua rocks in bootstrap.conf:buidreq' + ignore Lua rocks in bootstrap.conf:buildreq' func_quote_for_eval ${1+"$@"} slingshot_options_prep_result=$func_quote_for_eval_result diff --git a/build-aux/bootstrap.slingshot b/build-aux/bootstrap.slingshot index 1293a4e..3ff5ac1 100644 --- a/build-aux/bootstrap.slingshot +++ b/build-aux/bootstrap.slingshot @@ -153,7 +153,7 @@ Slingshot Options: --luarocks-tree=DIR check a non-default tree for prerequisite rocks --skip-rock-checks - ignore Lua rocks in bootstrap.conf:buidreq' + ignore Lua rocks in bootstrap.conf:buildreq' func_quote_for_eval ${1+"$@"} slingshot_options_prep_result=$func_quote_for_eval_result diff --git a/build-aux/mkrockspecs b/build-aux/mkrockspecs index 1ce3e85..ca8fde2 100755 --- a/build-aux/mkrockspecs +++ b/build-aux/mkrockspecs @@ -113,6 +113,15 @@ local function opterr (msg) os.exit (2) end +local function setopt (optname, arglist, i) + local opt = arglist[i] + if i + 1 > #arglist then + opterr ("option '" .. opt .. "' requires an argument") + end + prog.opts[optname] = arglist[i + 1] + return i + 1 +end + local function die (msg) msg:gsub ("([^\n]+)\n?", function () @@ -135,10 +144,11 @@ PACKAGE and VERSION are the package name and version number as defined by 'configure.ac' or similar. REVISION is only required for a revised rockspec if the default "-1" revision was released with errors. - --help print this help, then exit - --version print version number, then exit -b, --branch=BRANCH make git rockspec use BRANCH -m, --module-dir=ROOT directory of lua-files for builtin build type + -r, --repository=REPO set the repository name (default=PACKAGE) + --help print this help, then exit + --version print version number, then exit Report bugs to http://github.com/gvvaughan/slingshot/issues.]]) os.exit (0) @@ -154,29 +164,14 @@ See source files for individual license conditions.]] os.exit (0) end -prog["--module-dir"] = function (arglist, i) - local opt = arglist[i] - if i + 1 > #arglist then - opterr ("option '" .. opt .. "' requires an argument") - end - - prog.opts.module_root = arglist[i + 1] - return i + 1 -end - -prog["-m"] = prog["--module-dir"] - -prog["--branch"] = function (arglist, i) - local opt = arglist[i] - if i + 1 > #arglist then - opterr ("option '" .. opt .. "' requires an argument") - end +prog["-b"] = function (argl, i) return setopt ("branch", argl, i) end +prog["--branch"] = prog["-b"] - prog.opts.branch = arglist[i + 1] - return i + 1 -end +prog["-m"] = function (argl, i) return setopt ("module_root", argl, i) end +prog["--module-dir"] = prog["-m"] -prog["-b"] = prog["--branch"] +prog["-r"] = function (argl, i) return setopt ("repository", argl, i) end +prog["--repository"] = prog["-r"] local nonopts local i = 0 @@ -220,6 +215,11 @@ local version = arg[2] local revision = arg[3] or "1" local conf = arg[4] or "rockspec.conf" +-- Unless set explicity, assume the repo is named after the package. +if prog.opts.repository == nil then + prog.opts.repository = package +end + --[[ ================= ]]-- --[[ Helper functions. ]]-- @@ -271,7 +271,7 @@ local function loadmap (root) tree (root) for _, f in ipairs (files) do local m = f:match ("^" .. escape_pattern (root) .. "/(.*)%.lua") - map [m:gsub ("/", ".")] = f:gsub ("^%./", "") + map [m:gsub ("/", "."):gsub ("%.init$", "")] = f:gsub ("^%./", "") end return map end @@ -358,7 +358,7 @@ default.build = default.build or { build_command = "./configure " .. "LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' " .. configure_flags .. "--prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' " .. - "&& make clean all", + "--datarootdir='$(PREFIX)' && make clean all", install_command = "make install luadir='$(LUADIR)'", copy_directories = {}, } @@ -368,7 +368,7 @@ spec.source = spec.source or {} spec.build = spec.build or {} if version ~= "scm" and version ~= "git" then spec.source.url = "http://" .. url .. "/archive/release-v" .. version .. ".zip" - spec.source.dir = package .. "-release-v" .. version + spec.source.dir = prog.opts.repository .. "-release-v" .. version else spec.source.url = "git://" .. url .. ".git" spec.source.branch = prog.opts.branch diff --git a/build-aux/release.mk b/build-aux/release.mk index 6941603..b31c155 100644 --- a/build-aux/release.mk +++ b/build-aux/release.mk @@ -57,9 +57,10 @@ include Makefile ## Defaults. ## ## --------- ## -GIT ?= git -LUA ?= lua -TAR ?= tar +GIT ?= git +LUA ?= lua +LUAROCKS ?= luarocks +TAR ?= tar # Override this in cfg.mk if you are using a different format in your # NEWS file. @@ -142,6 +143,7 @@ release-type = $(call member-check,RELEASE_TYPE,$(RELEASE_TYPES)) release: $(AM_V_GEN)$(MAKE) $(release-type) $(AM_V_GEN)$(MAKE) push + $(AM_V_GEN)$(MAKE) upload $(AM_V_GEN)$(MAKE) mail submodule-checks ?= no-submodule-changes public-submodule-commit @@ -168,8 +170,8 @@ public-submodule-commit: && git --version >/dev/null 2>&1; then \ cd $(srcdir) && \ git submodule --quiet foreach \ - test '"$$(git rev-parse "$$sha1")"' \ - = '"$$(git merge-base origin "$$sha1")"' \ + 'test "$$(git rev-parse "$$sha1")" \ + = "$$(git merge-base origin "$$sha1")"' \ || { echo '$(ME): found non-public submodule commit' >&2; \ exit 1; }; \ else \ @@ -291,9 +293,9 @@ update-old-NEWS-hash: NEWS ANNOUNCE_ENV = LUA_INIT= LUA_PATH='$(abs_srcdir)/?-git-1.rockspec' ANNOUNCE_PRINT = $(ANNOUNCE_ENV) $(LUA) -l$(PACKAGE) -e -_PRE = " http://raw." +_PRE = " https://raw.githubusercontent" _POST = "/release-v$(VERSION)/$(PACKAGE)-$(VERSION)-$(rockspec_revision).rockspec" -GITHUB_ROCKSPEC = (source.url:gsub ("^git://", $(_PRE)):gsub ("%.git$$", $(_POST))) +GITHUB_ROCKSPEC = (source.url:gsub ("^git://github", $(_PRE)):gsub ("%.git$$", $(_POST))) announcement: NEWS # Not $(AM_V_GEN) since the output of this command serves as @@ -311,7 +313,7 @@ announcement: NEWS $(AM_V_at)printf '%s\n' \ 'Install it with LuaRocks, using:' '' \ ' luarocks install $(PACKAGE) $(VERSION)' '' \ - 'Until the rocks are available from the official repository in a few days,' \ + 'If the latest rocks are not yet available from the official repository,' \ 'you can install directly from the $(PACKAGE) release branch, with:' \ '' ' $$ luarocks install '\\ $(AM_V_at)$(ANNOUNCE_PRINT) 'print ($(GITHUB_ROCKSPEC))' @@ -358,8 +360,8 @@ check-in-release-branch: $(AM_V_at)$(TAR) zxf '$(release-tarball)' $(AM_V_at)rm -f '$(my_distdir)' '$(release-tarball)' $(AM_V_at)$(GIT) add . - $(AM_V_at)$(GIT) commit -s -a -m "Release v$(VERSION)." - $(AM_V_at)$(GIT) tag -s -a -m "Full source $(VERSION) release" release-v$(VERSION) + $(AM_V_at)$(GIT) commit -s -a -m 'Release v$(VERSION).' + $(AM_V_at)$(GIT) tag -s -a -m 'Full source release v$(VERSION)' release-v$(VERSION) $(AM_V_at)$(GCO) $(branch) .PHONY: push @@ -369,16 +371,15 @@ push: $(AM_V_at)$(GIT) push origin v$(VERSION) $(AM_V_at)$(GIT) push origin release-v$(VERSION) +.PHONY: upload +upload: rockspecs + $(AM_V_at)$(LUAROCKS) upload $${API_KEY+--api-key=$$API_KEY} \ + '$(PACKAGE)-$(VERSION)-$(rockspec_revision).rockspec' + announce_emails ?= lua-l@lists.lua.org -rockspec_emails ?= luarocks-developers@lists.sourceforge.net .PHONY: mail mail: rockspecs $(AM_V_at)cat ~/announce-$(my_distdir) \ | mail -s '[ANN] $(PACKAGE) $(VERSION) released' -- \ $(announce_emails) - $(AM_V_at)printf '%s\n' \ - 'Rockspec for $(PACKAGE) version $(VERSION) at:' \ - `$(ANNOUNCE_PRINT) 'print ($(GITHUB_ROCKSPEC))'` \ - | mail -s '[ANN] $(PACKAGE) $(VERSION) released; rockspec url included' -- \ - $(rockspec_emails) diff --git a/build-aux/specl.mk b/build-aux/specl.mk index f5ec9fc..6cee599 100644 --- a/build-aux/specl.mk +++ b/build-aux/specl.mk @@ -35,7 +35,7 @@ check_local += specl-check-local specl-check-local: $(specl_SPECS) - $(SPECL_ENV) $(SPECL) $(SPECL_OPTS) $(specl_SPECS) + $(SPECL_ENV) LUA=$(LUA) $(SPECL) $(SPECL_OPTS) $(specl_SPECS) ## ------------- ## diff --git a/configure b/configure index e317833..b260871 100755 --- a/configure +++ b/configure @@ -2473,7 +2473,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $LUA is a Lua interpreter" >&5 $as_echo_n "checking if $LUA is a Lua interpreter... " >&6; } - if $LUA -e "print('Hello ' .. _VERSION .. '!')" &>/dev/null; then : + if $LUA -e "print('Hello ' .. _VERSION .. '!')" >/dev/null 2>&1; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else @@ -2487,85 +2487,10 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking $_ax_check_text" >&5 $as_echo_n "checking $_ax_check_text... " >&6; } - _ax_test_ver=`$LUA -e "print(_VERSION)" 2>/dev/null | \ - sed "s|^Lua \(.*\)|\1|" | grep -o "^[0-9]\+\\.[0-9]\+"` - if test "x$_ax_test_ver" = 'x'; then : - _ax_test_ver='0' -fi - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$_ax_test_ver" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "5.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - - if $ax_compare_version; then : - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$_ax_test_ver" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "5.3" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - -fi - - if $ax_compare_version; then : + if $LUA 2>/dev/null -e ' + function norm (v) i,j=v:match "(%d+)%.(%d+)" return 100 * i + j end + v=norm (_VERSION) + os.exit ((v >= norm ("5.1") and v < norm ("5.3")) and 0 or 1)'; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else @@ -2583,95 +2508,20 @@ $as_echo_n "checking $_ax_check_text... " >&6; } if ${ax_cv_pathless_LUA+:} false; then : $as_echo_n "(cached) " >&6 else - for ax_cv_pathless_LUA in lua lua5.2 lua5.1 lua50 none; do + for ax_cv_pathless_LUA in lua lua5.2 lua52 lua5.1 lua51 lua50 none; do test "x$ax_cv_pathless_LUA" = 'xnone' && break - if $ax_cv_pathless_LUA -e "print('Hello ' .. _VERSION .. '!')" &>/dev/null; then : + if $ax_cv_pathless_LUA -e "print('Hello ' .. _VERSION .. '!')" >/dev/null 2>&1; then : else continue fi - _ax_test_ver=`$ax_cv_pathless_LUA -e "print(_VERSION)" 2>/dev/null | \ - sed "s|^Lua \(.*\)|\1|" | grep -o "^[0-9]\+\\.[0-9]\+"` - if test "x$_ax_test_ver" = 'x'; then : - _ax_test_ver='0' -fi - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$_ax_test_ver" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "5.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/true/;s/x${ax_compare_version_B}/false/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - - if $ax_compare_version; then : - - - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - - ax_compare_version_A=`echo "$_ax_test_ver" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version_B=`echo "5.3" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ - -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ - -e 's/[^0-9]//g'` - - - ax_compare_version=`echo "x$ax_compare_version_A -x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version_A}/false/;s/x${ax_compare_version_B}/true/;1q"` - - - - if test "$ax_compare_version" = "true" ; then - : - fi - -fi - - if $ax_compare_version; then : + if $ax_cv_pathless_LUA 2>/dev/null -e ' + function norm (v) i,j=v:match "(%d+)%.(%d+)" return 100 * i + j end + v=norm (_VERSION) + os.exit ((v >= norm ("5.1") and v < norm ("5.3")) and 0 or 1)'; then : break fi @@ -2738,10 +2588,7 @@ $as_echo_n "checking for $ax_display_LUA version... " >&6; } if ${ax_cv_lua_version+:} false; then : $as_echo_n "(cached) " >&6 else - ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \ - sed "s|^Lua \(.*\)|\1|" | \ - grep -o "^[0-9]\+\\.[0-9]\+"` - + ax_cv_lua_version=`$LUA -e 'print(_VERSION:match "(%d+%.%d+)")'` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lua_version" >&5 $as_echo "$ax_cv_lua_version" >&6; } @@ -2832,7 +2679,7 @@ fi ax_lua_prefixed_path='' - _ax_package_paths=`$LUA -e 'print(package.cpathd)' 2>/dev/null | sed 's|;|\n|g'` + _ax_package_paths=`$LUA -e 'print(package.cpath)' 2>/dev/null | sed 's|;|\n|g'` for _ax_package_path in $_ax_package_paths; do _ax_path_parts=`echo "$_ax_package_path" | sed 's|/|\n|g'` _ax_reassembled='' diff --git a/docs/mkrockspecs.1 b/docs/mkrockspecs.1 index 8571b62..b21635d 100644 --- a/docs/mkrockspecs.1 +++ b/docs/mkrockspecs.1 @@ -1,10 +1,10 @@ -.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.43.3. -.TH MKROCKSPECS "1" "January 2014" "mkrockspecs (slingshot) 7" "User Commands" +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.45.1. +.TH MKROCKSPECS "1" "July 2014" "mkrockspecs (slingshot) 7" "User Commands" .SH NAME mkrockspecs \- Slingshot .SH SYNOPSIS .B mkrockspecs -[\fIOPTIONS\fR] \fIPACKAGE VERSION \fR[\fIREVISION\fR] [\fIFILE\fR] +[\fI\,OPTIONS\/\fR] \fI\,PACKAGE VERSION \/\fR[\fI\,REVISION\/\fR] [\fI\,FILE\/\fR] .SH DESCRIPTION Convert a YAML configuration file into a full rockspec. .PP @@ -16,17 +16,20 @@ PACKAGE and VERSION are the package name and version number as defined by 'configure.ac' or similar. REVISION is only required for a revised rockspec if the default "\-1" revision was released with errors. .TP +\fB\-b\fR, \fB\-\-branch\fR=\fI\,BRANCH\/\fR +make git rockspec use BRANCH +.TP +\fB\-m\fR, \fB\-\-module\-dir\fR=\fI\,ROOT\/\fR +directory of lua\-files for builtin build type +.TP +\fB\-r\fR, \fB\-\-repository\fR=\fI\,REPO\/\fR +set the repository name (default=PACKAGE) +.TP \fB\-\-help\fR print this help, then exit .TP \fB\-\-version\fR print version number, then exit -.TP -\fB\-b\fR, \fB\-\-branch\fR=\fIBRANCH\fR -make git rockspec use BRANCH -.TP -\fB\-m\fR, \fB\-\-module\-dir\fR=\fIROOT\fR -directory of lua\-files for builtin build type .SH AUTHOR Written by Gary V. Vaughan , 2013 .SH "REPORTING BUGS" diff --git a/m4/ax_compare_version.m4 b/m4/ax_compare_version.m4 deleted file mode 100644 index 74dc0fd..0000000 --- a/m4/ax_compare_version.m4 +++ /dev/null @@ -1,177 +0,0 @@ -# =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_compare_version.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) -# -# DESCRIPTION -# -# This macro compares two version strings. Due to the various number of -# minor-version numbers that can exist, and the fact that string -# comparisons are not compatible with numeric comparisons, this is not -# necessarily trivial to do in a autoconf script. This macro makes doing -# these comparisons easy. -# -# The six basic comparisons are available, as well as checking equality -# limited to a certain number of minor-version levels. -# -# The operator OP determines what type of comparison to do, and can be one -# of: -# -# eq - equal (test A == B) -# ne - not equal (test A != B) -# le - less than or equal (test A <= B) -# ge - greater than or equal (test A >= B) -# lt - less than (test A < B) -# gt - greater than (test A > B) -# -# Additionally, the eq and ne operator can have a number after it to limit -# the test to that number of minor versions. -# -# eq0 - equal up to the length of the shorter version -# ne0 - not equal up to the length of the shorter version -# eqN - equal up to N sub-version levels -# neN - not equal up to N sub-version levels -# -# When the condition is true, shell commands ACTION-IF-TRUE are run, -# otherwise shell commands ACTION-IF-FALSE are run. The environment -# variable 'ax_compare_version' is always set to either 'true' or 'false' -# as well. -# -# Examples: -# -# AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[lt],[3.15.8]) -# -# would both be true. -# -# AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8]) -# AX_COMPARE_VERSION([3.15],[gt],[3.15.8]) -# -# would both be false. -# -# AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8]) -# -# would be true because it is only comparing two minor versions. -# -# AX_COMPARE_VERSION([3.15.7],[eq0],[3.15]) -# -# would be true because it is only comparing the lesser number of minor -# versions of the two values. -# -# Note: The characters that separate the version numbers do not matter. An -# empty string is the same as version 0. OP is evaluated by autoconf, not -# configure, so must be a string, not a variable. -# -# The author would like to acknowledge Guido Draheim whose advice about -# the m4_case and m4_ifvaln functions make this macro only include the -# portions necessary to perform the specific comparison specified by the -# OP argument in the final configure script. -# -# LICENSE -# -# Copyright (c) 2008 Tim Toolan -# -# Copying and distribution of this file, with or without modification, are -# permitted in any medium without royalty provided the copyright notice -# and this notice are preserved. This file is offered as-is, without any -# warranty. - -#serial 11 - -dnl ######################################################################### -AC_DEFUN([AX_COMPARE_VERSION], [ - AC_REQUIRE([AC_PROG_AWK]) - - # Used to indicate true or false condition - ax_compare_version=false - - # Convert the two version strings to be compared into a format that - # allows a simple string comparison. The end result is that a version - # string of the form 1.12.5-r617 will be converted to the form - # 0001001200050617. In other words, each number is zero padded to four - # digits, and non digits are removed. - AS_VAR_PUSHDEF([A],[ax_compare_version_A]) - A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - AS_VAR_PUSHDEF([B],[ax_compare_version_B]) - B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \ - -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \ - -e 's/[[^0-9]]//g'` - - dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary - dnl # then the first line is used to determine if the condition is true. - dnl # The sed right after the echo is to remove any indented white space. - m4_case(m4_tolower($2), - [lt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [gt],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"` - ], - [le],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ], - [ge],[ - ax_compare_version=`echo "x$A -x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"` - ],[ - dnl Split the operator from the subversion count if present. - m4_bmatch(m4_substr($2,2), - [0],[ - # A count of zero means use the length of the shorter version. - # Determine the number of characters in A and B. - ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'` - ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'` - - # Set A to no more than B's length and B to no more than A's length. - A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"` - B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"` - ], - [[0-9]+],[ - # A count greater than zero means use only that many subversions - A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"` - ], - [.+],[ - AC_WARNING( - [illegal OP numeric parameter: $2]) - ],[]) - - # Pad zeros at end of numbers to make same length. - ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`" - B="$B`echo $A | sed 's/./0/g'`" - A="$ax_compare_version_tmp_A" - - # Check for equality or inequality as necessary. - m4_case(m4_tolower(m4_substr($2,0,2)), - [eq],[ - test "x$A" = "x$B" && ax_compare_version=true - ], - [ne],[ - test "x$A" != "x$B" && ax_compare_version=true - ],[ - AC_WARNING([illegal OP parameter: $2]) - ]) - ]) - - AS_VAR_POPDEF([A])dnl - AS_VAR_POPDEF([B])dnl - - dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE. - if test "$ax_compare_version" = "true" ; then - m4_ifvaln([$4],[$4],[:])dnl - m4_ifvaln([$5],[else $5])dnl - fi -]) dnl AX_COMPARE_VERSION diff --git a/m4/ax_lua.m4 b/m4/ax_lua.m4 index f158253..bafaeef 100644 --- a/m4/ax_lua.m4 +++ b/m4/ax_lua.m4 @@ -55,9 +55,6 @@ # version number greater or equal to MINIMUM-VERSION and less than # TOO-BIG-VERSION will be accepted. # -# Version comparisons require the AX_COMPARE_VERSION macro, which is -# provided by ax_compare_version.m4 from the Autoconf Archive. -# # The Lua version number, LUA_VERSION, is found from the interpreter, and # substituted. LUA_PLATFORM is also found, but not currently supported (no # standard representation). @@ -109,6 +106,7 @@ # * /usr/include/lua/X.Y # * /usr/include/luaXY # * /usr/local/include/luaX.Y +# * /usr/local/include/lua-X.Y # * /usr/local/include/lua/X.Y # * /usr/local/include/luaXY # @@ -153,8 +151,8 @@ # # LICENSE # +# Copyright (c) 2014 Reuben Thomas # Copyright (c) 2013 Tim Perkins -# Copyright (c) 2013 Reuben Thomas # # 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 @@ -182,7 +180,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 20 +#serial 26 dnl ========================================================================= dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION], @@ -195,7 +193,7 @@ AC_DEFUN([AX_PROG_LUA], dnl Find a Lua interpreter. m4_define_default([_AX_LUA_INTERPRETER_LIST], - [lua lua5.2 lua5.1 lua50]) + [lua lua5.2 lua52 lua5.1 lua51 lua50]) m4_if([$1], [], [ dnl No version check is needed. Find any Lua interpreter. @@ -257,10 +255,7 @@ AC_DEFUN([AX_PROG_LUA], ], [ dnl Query Lua for its version number. AC_CACHE_CHECK([for $ax_display_LUA version], [ax_cv_lua_version], - [ ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \ - sed "s|^Lua \(.*\)|\1|" | \ - grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"` - ]) + [ ax_cv_lua_version=`$LUA -e 'print(_VERSION:match "(%d+%.%d+)")'` ]) AS_IF([test "x$ax_cv_lua_version" = 'x'], [AC_MSG_ERROR([invalid Lua version number])]) AC_SUBST([LUA_VERSION], [$ax_cv_lua_version]) @@ -322,7 +317,7 @@ AC_DEFUN([AX_PROG_LUA], dnl Try to find a path with the prefix. _AX_LUA_FND_PRFX_PTH([$LUA], - [$ax_lua_exec_prefix], [package.cpathd]) + [$ax_lua_exec_prefix], [package.cpath]) AS_IF([test "x$ax_lua_prefixed_path" != 'x'], [ dnl Fix the prefix. _ax_strip_prefix=`echo "$ax_lua_exec_prefix" | sed 's|.|.|g'` @@ -352,7 +347,7 @@ dnl ========================================================================= AC_DEFUN([_AX_LUA_CHK_IS_INTRP], [ dnl Just print _VERSION because all Lua interpreters have this global. - AS_IF([$1 -e "print('Hello ' .. _VERSION .. '!')" &>/dev/null], + AS_IF([$1 -e "print('Hello ' .. _VERSION .. '!')" >/dev/null 2>&1], [$2], [$3]) ]) @@ -363,16 +358,11 @@ dnl [ACTION-IF-TRUE], [ACTION-IF-FALSE]) dnl ========================================================================= AC_DEFUN([_AX_LUA_CHK_VER], [ - _ax_test_ver=`$1 -e "print(_VERSION)" 2>/dev/null | \ - sed "s|^Lua \(.*\)|\1|" | grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"` - AS_IF([test "x$_ax_test_ver" = 'x'], - [_ax_test_ver='0']) - AX_COMPARE_VERSION([$_ax_test_ver], [ge], [$2]) - m4_if([$3], [], [], - [ AS_IF([$ax_compare_version], - [AX_COMPARE_VERSION([$_ax_test_ver], [lt], [$3])]) - ]) - AS_IF([$ax_compare_version], [$4], [$5]) + AS_IF([$1 2>/dev/null -e ' + function norm (v) i,j=v:match "(%d+)%.(%d+)" return 100 * i + j end + v=norm (_VERSION) + os.exit ((v >= norm ("$2") and v < norm ("$3")) and 0 or 1)'], + [$4], [$5]) ]) @@ -431,6 +421,7 @@ AC_DEFUN([AX_LUA_HEADERS], /usr/include/lua/$LUA_VERSION \ /usr/include/lua$LUA_SHORT_VERSION \ /usr/local/include/lua$LUA_VERSION \ + /usr/local/include/lua-$LUA_VERSION \ /usr/local/include/lua/$LUA_VERSION \ /usr/local/include/lua$LUA_SHORT_VERSION \ ]) @@ -490,7 +481,7 @@ int main(int argc, char ** argv) ], [ ax_cv_lua_header_version=`./conftest$EXEEXT p | \ sed "s|^Lua \(.*\)|\1|" | \ - grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"` + grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"` ], [ax_cv_lua_header_version='unknown']) CPPFLAGS=$_ax_lua_saved_cppflags @@ -578,10 +569,15 @@ AC_DEFUN([AX_LUA_LIBS], dnl Try to find the Lua libs. _ax_lua_saved_libs=$LIBS LIBS="$LIBS $LUA_LIB" - AC_SEARCH_LIBS([lua_load], [lua$LUA_VERSION lua$LUA_SHORT_VERSION lua], - [_ax_found_lua_libs='yes'], - [_ax_found_lua_libs='no'], - [$_ax_lua_extra_libs]) + AC_SEARCH_LIBS([lua_load], + [ lua$LUA_VERSION \ + lua$LUA_SHORT_VERSION \ + lua-$LUA_VERSION \ + lua-$LUA_SHORT_VERSION \ + lua], + [_ax_found_lua_libs='yes'], + [_ax_found_lua_libs='no'], + [$_ax_lua_extra_libs]) LIBS=$_ax_lua_saved_libs AS_IF([test "x$ac_cv_search_lua_load" != 'xno' && diff --git a/slingshot-6-1.rockspec b/slingshot-7-1.rockspec similarity index 92% rename from slingshot-6-1.rockspec rename to slingshot-7-1.rockspec index f146456..66846e0 100644 --- a/slingshot-6-1.rockspec +++ b/slingshot-7-1.rockspec @@ -16,7 +16,7 @@ dependencies = { } external_dependencies = nil build = { - build_command = "./configure LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' --prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' && make clean all", + build_command = "./configure LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' --prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' --datarootdir='$(PREFIX)' && make clean all", copy_directories = {}, install_command = "make install luadir='$(LUADIR)'", type = "command", diff --git a/src/mkrockspecs.in b/src/mkrockspecs.in index b44e191..770bf5b 100755 --- a/src/mkrockspecs.in +++ b/src/mkrockspecs.in @@ -113,6 +113,15 @@ local function opterr (msg) os.exit (2) end +local function setopt (optname, arglist, i) + local opt = arglist[i] + if i + 1 > #arglist then + opterr ("option '" .. opt .. "' requires an argument") + end + prog.opts[optname] = arglist[i + 1] + return i + 1 +end + local function die (msg) msg:gsub ("([^\n]+)\n?", function () @@ -135,10 +144,11 @@ PACKAGE and VERSION are the package name and version number as defined by 'configure.ac' or similar. REVISION is only required for a revised rockspec if the default "-1" revision was released with errors. - --help print this help, then exit - --version print version number, then exit -b, --branch=BRANCH make git rockspec use BRANCH -m, --module-dir=ROOT directory of lua-files for builtin build type + -r, --repository=REPO set the repository name (default=PACKAGE) + --help print this help, then exit + --version print version number, then exit Report bugs to http://github.com/gvvaughan/slingshot/issues.]]) os.exit (0) @@ -154,29 +164,14 @@ See source files for individual license conditions.]] os.exit (0) end -prog["--module-dir"] = function (arglist, i) - local opt = arglist[i] - if i + 1 > #arglist then - opterr ("option '" .. opt .. "' requires an argument") - end - - prog.opts.module_root = arglist[i + 1] - return i + 1 -end - -prog["-m"] = prog["--module-dir"] - -prog["--branch"] = function (arglist, i) - local opt = arglist[i] - if i + 1 > #arglist then - opterr ("option '" .. opt .. "' requires an argument") - end +prog["-b"] = function (argl, i) return setopt ("branch", argl, i) end +prog["--branch"] = prog["-b"] - prog.opts.branch = arglist[i + 1] - return i + 1 -end +prog["-m"] = function (argl, i) return setopt ("module_root", argl, i) end +prog["--module-dir"] = prog["-m"] -prog["-b"] = prog["--branch"] +prog["-r"] = function (argl, i) return setopt ("repository", argl, i) end +prog["--repository"] = prog["-r"] local nonopts local i = 0 @@ -220,6 +215,11 @@ local version = arg[2] local revision = arg[3] or "1" local conf = arg[4] or "rockspec.conf" +-- Unless set explicity, assume the repo is named after the package. +if prog.opts.repository == nil then + prog.opts.repository = package +end + --[[ ================= ]]-- --[[ Helper functions. ]]-- @@ -271,7 +271,7 @@ local function loadmap (root) tree (root) for _, f in ipairs (files) do local m = f:match ("^" .. escape_pattern (root) .. "/(.*)%.lua") - map [m:gsub ("/", ".")] = f:gsub ("^%./", "") + map [m:gsub ("/", "."):gsub ("%.init$", "")] = f:gsub ("^%./", "") end return map end @@ -358,7 +358,7 @@ default.build = default.build or { build_command = "./configure " .. "LUA='$(LUA)' LUA_INCLUDE='-I$(LUA_INCDIR)' " .. configure_flags .. "--prefix='$(PREFIX)' --libdir='$(LIBDIR)' --datadir='$(LUADIR)' " .. - "&& make clean all", + "--datarootdir='$(PREFIX)' && make clean all", install_command = "make install luadir='$(LUADIR)'", copy_directories = {}, } @@ -368,7 +368,7 @@ spec.source = spec.source or {} spec.build = spec.build or {} if version ~= "scm" and version ~= "git" then spec.source.url = "http://" .. url .. "/archive/release-v" .. version .. ".zip" - spec.source.dir = package .. "-release-v" .. version + spec.source.dir = prog.opts.repository .. "-release-v" .. version else spec.source.url = "git://" .. url .. ".git" spec.source.branch = prog.opts.branch diff --git a/travis.yml.in b/travis.yml.in index 602e072..6644c59 100644 --- a/travis.yml.in +++ b/travis.yml.in @@ -6,7 +6,6 @@ env: - PACKAGE=@PACKAGE@ - ROCKSPEC=$PACKAGE-git-1.rockspec - LUAROCKS_CONFIG=build-aux/luarocks-config.lua - - LUAROCKS_BASE=luarocks-2.1.1 - LUAROCKS="$LUA $HOME/bin/luarocks" matrix: - LUA=lua5.1 LUA_INCDIR=/usr/include/lua5.1 LUA_SUFFIX=5.1 @@ -26,14 +25,16 @@ install: - sudo apt-get install liblua5.1-dev - sudo apt-get install lua5.2 - sudo apt-get install liblua5.2-dev - # Install a recent luarocks release locally for everything else. - - wget http://luarocks.org/releases/$LUAROCKS_BASE.tar.gz - - tar zxvpf $LUAROCKS_BASE.tar.gz - - ( cd $LUAROCKS_BASE; + + # Install a luarocks beta locally for everything else. + - git clone --depth=1 https://github.com/keplerproject/luarocks.git + # LuaRocks configure --with-lua argument is just a prefix! + - ( cd luarocks; ./configure - --prefix=$HOME --lua-version=$LUA_SUFFIX --lua-suffix=$LUA_SUFFIX - --with-lua-include=$LUA_INCDIR; - make all install; ) + --prefix=$HOME --with-lua=/usr --lua-version=$LUA_SUFFIX + --lua-suffix=$LUA_SUFFIX --with-lua-include=$LUA_INCDIR; + make build; + make install; ) # Configure and build. script: