Comparison

Makefile @ 502:21dc299387a6

Installation improvements (auto-creation of data directories)
author Matthew Wild <mwild1@gmail.com>
date Sun, 30 Nov 2008 04:22:43 +0000
parent 501:ea61e191043e
child 503:00702b66beb1
comparison
equal deleted inserted replaced
501:ea61e191043e 502:21dc299387a6
4 BIN = $(DESTDIR)$(PREFIX)/bin 4 BIN = $(DESTDIR)$(PREFIX)/bin
5 CONFIG = $(DESTDIR)$(SYSCONFDIR) 5 CONFIG = $(DESTDIR)$(SYSCONFDIR)
6 MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules 6 MODULES = $(DESTDIR)$(PREFIX)/lib/prosody/modules
7 SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody 7 SOURCE = $(DESTDIR)$(PREFIX)/lib/prosody
8 8
9 DATADIR?=data
10
9 INSTALLEDSOURCE = $(PREFIX)/lib/prosody 11 INSTALLEDSOURCE = $(PREFIX)/lib/prosody
10 INSTALLEDCONFIG = $(SYSCONFDIR) 12 INSTALLEDCONFIG = $(SYSCONFDIR)
11 INSTALLEDMODULES = $(PREFIX)/lib/prosody/modules 13 INSTALLEDMODULES = $(PREFIX)/lib/prosody/modules
14 INSTALLEDDATA = $(DATADIR)
12 15
13 16 all: prosody.install prosody.cfg.lua.install
14 all:
15 $(MAKE) all -C util-src 17 $(MAKE) all -C util-src
16 18
17 install: prosody.install prosody.cfg.lua.install util/encodings.so util/encodings.so 19 install: prosody.install prosody.cfg.lua.install util/encodings.so util/encodings.so
18 install -d $(BIN) $(CONFIG) $(MODULES) $(SOURCE) 20 install -d $(BIN) $(CONFIG) $(MODULES) $(SOURCE) $(DATADIR)
19 install -d $(CONFIG)/certs 21 install -d $(CONFIG)/certs
20 install -d $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util 22 install -d $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
21 install ./prosody.install $(BIN)/prosody 23 install ./prosody.install $(BIN)/prosody
22 install -m644 core/* $(SOURCE)/core 24 install -m644 core/* $(SOURCE)/core
23 install -m644 net/* $(SOURCE)/net 25 install -m644 net/* $(SOURCE)/net
38 40
39 util/hashes.so: 41 util/hashes.so:
40 $(MAKE) install -C util-src 42 $(MAKE) install -C util-src
41 43
42 prosody.install: prosody 44 prosody.install: prosody
43 sed "s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|;s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|;s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" prosody > prosody.install 45 cp prosody prosody.install
46 sed -i "s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|;" prosody.install
47 sed -i "s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|;" prosody.install
48 sed -i "s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|;" prosody.install
49 # The trailing slash is intentional in this one
50 sed -i "s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" prosody.install
44 51
45 prosody.cfg.lua.install: 52 prosody.cfg.lua.install:
46 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' prosody.cfg.lua.dist > prosody.cfg.lua.install 53 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' prosody.cfg.lua.dist > prosody.cfg.lua.install
47 54