aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xconfigure7
-rw-r--r--tools/migration/Makefile6
-rw-r--r--util/datamanager.lua2
4 files changed, 15 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 85eca971..f6e1e3f2 100644
--- a/Makefile
+++ b/Makefile
@@ -3,14 +3,14 @@ include config.unix
BIN = $(DESTDIR)$(PREFIX)/bin
CONFIG = $(DESTDIR)$(SYSCONFDIR)
-MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules
-SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody
+MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
+SOURCE = $(DESTDIR)$(LIBDIR)/prosody
DATA = $(DESTDIR)$(DATADIR)
MAN = $(DESTDIR)$(PREFIX)/share/man
-INSTALLEDSOURCE = $(PREFIX)/lib/prosody
+INSTALLEDSOURCE = $(LIBDIR)/prosody
INSTALLEDCONFIG = $(SYSCONFDIR)
-INSTALLEDMODULES = $(PREFIX)/lib/prosody/modules
+INSTALLEDMODULES = $(LIBDIR)/prosody/modules
INSTALLEDDATA = $(DATADIR)
.PHONY: all clean install
diff --git a/configure b/configure
index 040ff648..d669d3a8 100755
--- a/configure
+++ b/configure
@@ -4,6 +4,7 @@
PREFIX=/usr/local
SYSCONFDIR="$PREFIX/etc/prosody"
+LIBDIR="$PREFIX/lib"
DATADIR="$PREFIX/var/lib/prosody"
LUA_SUFFIX=""
LUA_DIR="/usr"
@@ -36,6 +37,8 @@ Configure Prosody prior to building.
Default is $PREFIX
--sysconfdir=DIR Location where the config file should be installed.
Default is \$PREFIX/etc/prosody
+--libdir=DIR Location where the server files should be stored.
+ Default is \$PREFIX/lib
--datadir=DIR Location where the server data should be stored.
Default is \$PREFIX/var/lib/prosody
--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
@@ -133,6 +136,9 @@ do
LUA_INCDIR="/usr/local/include";
fi
;;
+ --libdir=*)
+ LIBDIR="$value"
+ ;;
--datadir=*)
DATADIR="$value"
DATADIR_SET=yes
@@ -337,6 +343,7 @@ cat <<EOF > config.unix
PREFIX=$PREFIX
SYSCONFDIR=$SYSCONFDIR
+LIBDIR=$LIBDIR
DATADIR=$DATADIR
LUA_SUFFIX=$LUA_SUFFIX
LUA_DIR=$LUA_DIR
diff --git a/tools/migration/Makefile b/tools/migration/Makefile
index ae402bd2..713831d2 100644
--- a/tools/migration/Makefile
+++ b/tools/migration/Makefile
@@ -3,13 +3,13 @@ include ../../config.unix
BIN = $(DESTDIR)$(PREFIX)/bin
CONFIG = $(DESTDIR)$(SYSCONFDIR)
-SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody
+SOURCE = $(DESTDIR)$(LIBDIR)/prosody
DATA = $(DESTDIR)$(DATADIR)
MAN = $(DESTDIR)$(PREFIX)/share/man
-INSTALLEDSOURCE = $(PREFIX)/lib/prosody
+INSTALLEDSOURCE = $(LIBDIR)/prosody
INSTALLEDCONFIG = $(SYSCONFDIR)
-INSTALLEDMODULES = $(PREFIX)/lib/prosody/modules
+INSTALLEDMODULES = $(LIBDIR)/prosody/modules
INSTALLEDDATA = $(DATADIR)
SOURCE_FILES = migrator/*.lua
diff --git a/util/datamanager.lua b/util/datamanager.lua
index 4a4d62b3..b82349f1 100644
--- a/util/datamanager.lua
+++ b/util/datamanager.lua
@@ -163,7 +163,7 @@ local function atomic_store(filename, data)
return nil, msg;
end
-if prosody.platform ~= "posix" then
+if prosody and prosody.platform ~= "posix" then
-- os.rename does not overwrite existing files on Windows
-- TODO We could use Transactional NTFS on Vista and above
function atomic_store(filename, data)