diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-02-24 15:22:34 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-02-24 15:22:34 +0000 |
commit | f7786f4031dad5dd2daaf92c7c099448334d892d (patch) | |
tree | bd901b2855478c2157ca69f3a143650499ffe8ea | |
parent | ab47a2b002478a36645de1ebfbbbad5815aae08b (diff) | |
parent | f9b9268e61a9dd98c9a438ad4ea2c6e6d92128d9 (diff) | |
download | prosody-f7786f4031dad5dd2daaf92c7c099448334d892d.tar.gz prosody-f7786f4031dad5dd2daaf92c7c099448334d892d.zip |
Merge 0.10->trunk
-rw-r--r-- | Makefile | 8 | ||||
-rwxr-xr-x | configure | 13 | ||||
-rw-r--r-- | core/statsmanager.lua | 1 | ||||
-rw-r--r-- | tools/migration/Makefile | 6 | ||||
-rw-r--r-- | util/datamanager.lua | 2 |
5 files changed, 22 insertions, 8 deletions
@@ -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 @@ -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) |