From 8977c175a64fab7e9bd700ca8eb52c401e1f5cfd Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sun, 5 Aug 2018 11:21:28 +1000 Subject: prefix and sysconfdir are traditionally lowercase, add luarocksconfdir --- configure | 61 ++++++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 23 deletions(-) (limited to 'configure') diff --git a/configure b/configure index d92a3915..8b6d0d24 100755 --- a/configure +++ b/configure @@ -2,9 +2,10 @@ # Defaults -PREFIX="/usr/local" -SYSCONFDIR="$PREFIX/etc/luarocks" -ROCKS_TREE="$PREFIX" +prefix="/usr/local" +sysconfdir="$prefix/etc" +luarocksconfdir="$sysconfdir/luarocks" +ROCKS_TREE="$prefix" # ---------------------------------------------------------------------------- # FUNCTION DEFINITIONS @@ -94,10 +95,13 @@ Where to install LuaRocks: -------------------------- --prefix=PREFIX Directory where LuaRocks should be installed. - - Default is $PREFIX ---sysconfdir=SYSCONFDIR Where the config file should be installed. - - Default is $SYSCONFDIR - (PREFIX/etc/luarocks) + - Default is $prefix +--sysconfdir=SYSCONFDIR Where system config files should be installed. + - Default is $sysconfdir + (PREFIX/etc) +--luarocksconfdir=DIR Where the luarocks config file should be installed. + - Default is $luarocksconfdir + (SYSCONFDIR/luarocks) Where to install files provided by rocks: ----------------------------------------- @@ -108,7 +112,7 @@ Where to install files provided by rocks: "luarocks path --help" after installation. Avoid using paths controlled by your system's package manager, such as /usr. - - Default is $PREFIX + - Default is $prefix (PREFIX) Where is your Lua interpreter: @@ -234,13 +238,18 @@ do # -------------------------- --prefix) [ -n "$value" ] || die "Missing value in flag $key." - PREFIX="$(canonicalpath "$value")" - PREFIX_SET=yes + prefix="$(canonicalpath "$value")" + prefix_SET=yes ;; --sysconfdir) [ -n "$value" ] || die "Missing value in flag $key." - SYSCONFDIR="$(canonicalpath "$value")" - SYSCONFDIR_SET=yes + sysconfdir="$(canonicalpath "$value")" + sysconfdir_SET=yes + ;; + --luarocksconfdir) + [ -n "$value" ] || die "Missing value in flag $key." + luarocksconfdir="$(canonicalpath "$value")" + luarocksconfdir_SET=yes ;; @@ -329,17 +338,23 @@ echo # Derive options from the ones given # ---------------------------------------- -if [ "$PREFIX_SET" = "yes" ] && [ ! "$SYSCONFDIR_SET" = "yes" ] +if [ "$prefix_SET" = "yes" ] && [ ! "$sysconfdir_SET" = "yes" ] then - if [ "$PREFIX" = "/usr" ] - then SYSCONFDIR=/etc/luarocks - else SYSCONFDIR=$PREFIX/etc/luarocks + if [ "$prefix" = "/usr" ] + then sysconfdir=/etc + else sysconfdir=$prefix/etc fi + sysconfdir_SET=yes +fi + +if [ "$sysconfdir_SET" = "yes" ] && [ ! "$luarocksconfdir_SET" = "yes" ] +then + luarocksconfdir=$sysconfdir/luarocks fi -if [ "$PREFIX_SET" = "yes" ] && [ ! "$ROCKS_TREE_SET" = "yes" ] +if [ "$prefix_SET" = "yes" ] && [ ! "$ROCKS_TREE_SET" = "yes" ] then - ROCKS_TREE=$PREFIX + ROCKS_TREE=$prefix fi # ---------------------------------------- @@ -477,8 +492,8 @@ cat < config.unix # This file was automatically generated by the configure script. # Run "./configure --help" for details. -PREFIX=$PREFIX -SYSCONFDIR=$SYSCONFDIR +prefix=$prefix +luarocksconfdir=$luarocksconfdir ROCKS_TREE=$ROCKS_TREE LUA_VERSION=$LUA_VERSION LUA_INTERPRETER=$LUA_INTERPRETER @@ -509,16 +524,16 @@ echo BLUE "Done configuring." echo echo -echo "LuaRocks will be installed at......: $(GREEN "$PREFIX")" +echo "LuaRocks will be installed at......: $(GREEN "$prefix")" echo "LuaRocks will install rocks at.....: $(GREEN "$ROCKS_TREE")" -echo "LuaRocks configuration directory...: $(GREEN "$SYSCONFDIR")" +echo "LuaRocks configuration directory...: $(GREEN "$luarocksconfdir")" echo "Using Lua from.....................: $(GREEN "$LUA_DIR")" if [ "$LUA_BINDIR_SET" = "yes" ]; then echo "Lua bin directory..................: $(GREEN "$LUA_BINDIR")" ; fi if [ "$LUA_INCDIR_SET" = "yes" ]; then echo "Lua include directory..............: $(GREEN "$LUA_INCDIR")" ; fi if [ "$LUA_LIBDIR_SET" = "yes" ]; then echo "Lua lib directory..................: $(GREEN "$LUA_LIBDIR")" ; fi echo echo "* Type $(BOLD make) and $(BOLD make install):" -echo " to install to $PREFIX as usual." +echo " to install to $prefix as usual." echo "* Type $(BOLD make bootstrap):" echo " to install LuaRocks into $ROCKS_TREE as a rock." echo -- cgit v1.2.3-55-g6feb