util.x509: Only collect commonNames that pass idna
[prosody.git] / makefile
blob0b1c8788dc2bb1d9cbd457c7a29b4efb6b8bc295
2 include config.unix
4 BIN = $(DESTDIR)$(PREFIX)/bin
5 CONFIG = $(DESTDIR)$(SYSCONFDIR)
6 MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
7 SOURCE = $(DESTDIR)$(LIBDIR)/prosody
8 DATA = $(DESTDIR)$(DATADIR)
9 MAN = $(DESTDIR)$(PREFIX)/share/man
11 INSTALLEDSOURCE = $(LIBDIR)/prosody
12 INSTALLEDCONFIG = $(SYSCONFDIR)
13 INSTALLEDMODULES = $(LIBDIR)/prosody/modules
14 INSTALLEDDATA = $(DATADIR)
16 INSTALL=install -p
17 INSTALL_DATA=$(INSTALL) -m644
18 INSTALL_EXEC=$(INSTALL) -m755
19 MKDIR=install -d
20 MKDIR_PRIVATE=$(MKDIR) -m750
22 LUACHECK=luacheck
23 BUSTED=busted
25 .PHONY: all test clean install
27 all: prosody.install prosodyctl.install prosody.cfg.lua.install prosody.version
28 $(MAKE) -C util-src install
29 .if $(EXCERTS) == "yes"
30 $(MAKE) -C certs localhost.crt example.com.crt
31 .endif
33 install: prosody.install prosodyctl.install prosody.cfg.lua.install util/encodings.so util/encodings.so util/pposix.so util/signal.so
34 $(MKDIR) $(BIN) $(CONFIG) $(MODULES) $(SOURCE)
35 $(MKDIR_PRIVATE) $(DATA)
36 $(MKDIR) $(MAN)/man1
37 $(MKDIR) $(CONFIG)/certs
38 $(MKDIR) $(SOURCE)/core $(SOURCE)/net $(SOURCE)/util
39 $(INSTALL_EXEC) ./prosody.install $(BIN)/prosody
40 $(INSTALL_EXEC) ./prosodyctl.install $(BIN)/prosodyctl
41 $(INSTALL_DATA) core/*.lua $(SOURCE)/core
42 $(INSTALL_DATA) net/*.lua $(SOURCE)/net
43 $(MKDIR) $(SOURCE)/net/http $(SOURCE)/net/resolvers $(SOURCE)/net/websocket
44 $(INSTALL_DATA) net/http/*.lua $(SOURCE)/net/http
45 $(INSTALL_DATA) net/resolvers/*.lua $(SOURCE)/net/resolvers
46 $(INSTALL_DATA) net/websocket/*.lua $(SOURCE)/net/websocket
47 $(INSTALL_DATA) util/*.lua $(SOURCE)/util
48 $(INSTALL_DATA) util/*.so $(SOURCE)/util
49 $(MKDIR) $(SOURCE)/util/sasl
50 $(INSTALL_DATA) util/sasl/*.lua $(SOURCE)/util/sasl
51 $(MKDIR) $(MODULES)/mod_s2s $(MODULES)/mod_pubsub $(MODULES)/adhoc $(MODULES)/muc $(MODULES)/mod_mam
52 $(INSTALL_DATA) plugins/*.lua $(MODULES)
53 $(INSTALL_DATA) plugins/mod_s2s/*.lua $(MODULES)/mod_s2s
54 $(INSTALL_DATA) plugins/mod_pubsub/*.lua $(MODULES)/mod_pubsub
55 $(INSTALL_DATA) plugins/adhoc/*.lua $(MODULES)/adhoc
56 $(INSTALL_DATA) plugins/muc/*.lua $(MODULES)/muc
57 $(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
58 .if $(EXCERTS) == "yes"
59 $(INSTALL_DATA) certs/localhost.crt certs/localhost.key $(CONFIG)/certs
60 $(INSTALL_DATA) certs/example.com.crt certs/example.com.key $(CONFIG)/certs
61 .endif
62 $(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
63 test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
64 -test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
65 $(MAKE) install -C util-src
67 clean:
68 rm -f prosody.install
69 rm -f prosodyctl.install
70 rm -f prosody.cfg.lua.install
71 rm -f prosody.version
72 $(MAKE) clean -C util-src
74 lint:
75 $(LUACHECK) -q $$(HGPLAIN= hg files -I '**.lua') prosody prosodyctl
76 @echo $$(sed -n '/^\tlocal exclude_files/,/^}/p;' .luacheckrc | sed '1d;$d' | wc -l) files ignored
77 shellcheck configure
79 test:
80 $(BUSTED) --lua=$(RUNWITH)
83 prosody.install: prosody
84 sed "1s| lua$$| $(RUNWITH)|; \
85 s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
86 s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|; \
87 s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|; \
88 s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" < prosody > $@
90 prosodyctl.install: prosodyctl
91 sed "1s| lua$$| $(RUNWITH)|; \
92 s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
93 s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|; \
94 s|^CFG_DATADIR=.*;$$|CFG_DATADIR='$(INSTALLEDDATA)';|; \
95 s|^CFG_PLUGINDIR=.*;$$|CFG_PLUGINDIR='$(INSTALLEDMODULES)/';|;" < prosodyctl > $@
97 prosody.cfg.lua.install: prosody.cfg.lua.dist
98 sed 's|certs/|$(INSTALLEDCONFIG)/certs/|' prosody.cfg.lua.dist > $@
100 prosody.version:
101 test -f prosody.release && \
102 cp prosody.release $@ || \
103 test -f .hg_archival.txt && \
104 sed -n 's/^node: \(............\).*/\1/p' .hg_archival.txt > $@ || \
105 test -f .hg/dirstate && \
106 hexdump -n6 -e'6/1 "%02x"' .hg/dirstate > $@ || \
107 echo unknown > $@