aboutsummaryrefslogtreecommitdiffstats
path: root/tools/migration/Makefile
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2011-02-26 00:24:23 +0000
committerMatthew Wild <mwild1@gmail.com>2011-02-26 00:24:23 +0000
commit05b3139a2ca2d784ac07066d8773ca07b5113159 (patch)
treeaa68c7dba38183a45322f3356d08c73e8c45b599 /tools/migration/Makefile
parent48f32e711317c95d6d4b32de85ae8b8fe1590533 (diff)
parent2b4811c8430dcbec09c67b73e8f939b4047f1aec (diff)
downloadprosody-05b3139a2ca2d784ac07066d8773ca07b5113159.tar.gz
prosody-05b3139a2ca2d784ac07066d8773ca07b5113159.zip
Merge 0.8->trunk
Diffstat (limited to 'tools/migration/Makefile')
-rw-r--r--tools/migration/Makefile38
1 files changed, 38 insertions, 0 deletions
diff --git a/tools/migration/Makefile b/tools/migration/Makefile
new file mode 100644
index 00000000..839f2d87
--- /dev/null
+++ b/tools/migration/Makefile
@@ -0,0 +1,38 @@
+
+include ../../config.unix
+
+BIN = $(DESTDIR)$(PREFIX)/bin
+CONFIG = $(DESTDIR)$(SYSCONFDIR)
+SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody
+DATA = $(DESTDIR)$(DATADIR)
+MAN = $(DESTDIR)$(PREFIX)/share/man
+
+INSTALLEDSOURCE = $(PREFIX)/lib/prosody
+INSTALLEDCONFIG = $(SYSCONFDIR)
+INSTALLEDMODULES = $(PREFIX)/lib/prosody/modules
+INSTALLEDDATA = $(DATADIR)
+
+SOURCE_FILES = main.lua migrator/*.lua
+
+all: prosody-migrator.install migrator.cfg.lua.install $(SOURCE_FILES)
+
+install: prosody-migrator.install migrator.cfg.lua.install
+ install -d $(BIN) $(CONFIG) $(SOURCE) $(SOURCE)/migrator
+ install -d $(MAN)/man1
+ install -d $(SOURCE)/migrator
+ install -m755 ./prosody-migrator.install $(BIN)/prosody-migrator
+ install -m644 $(SOURCE_FILES) $(SOURCE)/migrator
+ test -e $(CONFIG)/migrator.cfg.lua || install -m644 migrator.cfg.lua.install $(CONFIG)/migrator.cfg.lua
+
+clean:
+ rm -f prosody-migrator.install
+ rm -f migrator.cfg.lua.install
+
+prosody-migrator.install: main.lua
+ sed "s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
+ s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|;" \
+ < main.lua > prosody-migrator.install
+
+migrator.cfg.lua.install: migrator.cfg.lua
+ sed "s|^local data_path = .*;$$|local data_path = '$(INSTALLEDDATA)';|;" \
+ < migrator.cfg.lua > migrator.cfg.lua.install