aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile8
-rwxr-xr-xconfigure13
-rw-r--r--core/statsmanager.lua1
-rw-r--r--tools/migration/Makefile6
-rw-r--r--util/datamanager.lua2
5 files changed, 22 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..84f4b9ef 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,10 @@ do
LUA_INCDIR="/usr/local/include";
fi
;;
+ --libdir=*)
+ LIBDIR="$value"
+ LIBDIR_SET=yes
+ ;;
--datadir=*)
DATADIR="$value"
DATADIR_SET=yes
@@ -206,6 +213,11 @@ then
fi
fi
+if [ "$PREFIX_SET" = "yes" -a ! "$LIBDIR_SET" = "yes" ]
+then
+ LIBDIR=$PREFIX/lib
+fi
+
find_program() {
path="$PATH"
item="`echo "$path" | sed 's/\([^:]*\):.*/\1/'`"
@@ -337,6 +349,7 @@ cat <<EOF > config.unix
PREFIX=$PREFIX
SYSCONFDIR=$SYSCONFDIR
+LIBDIR=$LIBDIR
DATADIR=$DATADIR
LUA_SUFFIX=$LUA_SUFFIX
LUA_DIR=$LUA_DIR
diff --git a/core/statsmanager.lua b/core/statsmanager.lua
index 62d217ef..cddaba06 100644
--- a/core/statsmanager.lua
+++ b/core/statsmanager.lua
@@ -48,6 +48,7 @@ if stats_interval then
end
timer.add_task(stats_interval, collect);
+ prosody.events.add_handler("server-started", function () collect() end, -1);
else
log("debug", "Statistics collection is disabled");
-- nop
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)