2015-01-12 10:32:20 +01:00
|
|
|
Description: fix install permissions
|
|
|
|
Without this patch, the makefile will try to install directories and
|
|
|
|
files with incompatible permissions for ejabberd, which run as an
|
|
|
|
ejabberd user.
|
|
|
|
Author: Johan Oudinet <johan.oudinet@gmail.com>
|
|
|
|
|
|
|
|
Index: ejabberd/Makefile.in
|
|
|
|
===================================================================
|
2015-07-08 11:54:14 +02:00
|
|
|
diff --git a/Makefile.in b/Makefile.in
|
|
|
|
index ffd1d30..a60c5b7 100644
|
|
|
|
--- a/Makefile.in
|
|
|
|
+++ b/Makefile.in
|
|
|
|
@@ -114,10 +114,8 @@ DLLs := $(wildcard deps/*/priv/*.so) $(wildcard deps/*/priv/lib/*.so)
|
2015-01-12 10:32:20 +01:00
|
|
|
install: all
|
|
|
|
#
|
|
|
|
# Configuration files
|
|
|
|
- $(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
|
2015-07-08 11:54:14 +02:00
|
|
|
- [ -f $(ETCDIR)/ejabberd.yml ] \
|
2015-01-12 10:32:20 +01:00
|
|
|
- && $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
|
|
|
|
- || $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
|
2015-07-08 11:54:14 +02:00
|
|
|
+ $(INSTALL) -d $(ETCDIR)
|
|
|
|
+ $(INSTALL) -b -m 644 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
|
2015-01-12 10:32:20 +01:00
|
|
|
$(SED) -e "s*{{rootdir}}*@prefix@*" \
|
|
|
|
-e "s*{{installuser}}*@INSTALLUSER@*" \
|
2015-07-08 11:54:14 +02:00
|
|
|
-e "s*{{bindir}}*@bindir@*" \
|
|
|
|
@@ -127,14 +125,11 @@ install: all
|
|
|
|
-e "s*{{docdir}}*@docdir@*" \
|
2015-01-12 10:32:20 +01:00
|
|
|
-e "s*{{erl}}*@ERL@*" ejabberdctl.template \
|
|
|
|
> ejabberdctl.example
|
2015-07-08 11:54:14 +02:00
|
|
|
- [ -f $(ETCDIR)/ejabberdctl.cfg ] \
|
2015-01-12 10:32:20 +01:00
|
|
|
- && $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
|
|
|
|
- || $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
2015-07-08 11:54:14 +02:00
|
|
|
+ $(INSTALL) -b -m 644 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
|
2015-01-12 10:32:20 +01:00
|
|
|
$(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
|
|
|
|
#
|
|
|
|
# Administration script
|
|
|
|
- [ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
|
|
|
|
- $(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
|
|
|
|
+ $(INSTALL) -D ejabberdctl.example $(SBINDIR)/ejabberdctl
|
2015-07-08 11:54:14 +02:00
|
|
|
# Elixir binaries
|
|
|
|
[ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
|
|
|
|
-[ -f deps/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/iex $(BINDIR)/iex
|
|
|
|
@@ -165,9 +160,9 @@ install: all
|
2015-01-12 10:32:20 +01:00
|
|
|
#
|
|
|
|
# Binary C programs
|
2015-07-08 11:54:14 +02:00
|
|
|
$(INSTALL) -d $(PBINDIR)
|
2015-01-12 10:32:20 +01:00
|
|
|
- $(INSTALL) -m 750 $(O_USER) tools/captcha.sh $(PBINDIR)
|
2015-07-08 11:54:14 +02:00
|
|
|
- $(INSTALL) -m 750 $(O_USER) tools/joincluster $(PBINDIR)
|
|
|
|
- $(INSTALL) -m 750 $(O_USER) tools/leavecluster $(PBINDIR)
|
|
|
|
+ $(INSTALL) tools/captcha.sh $(PBINDIR)
|
|
|
|
+ $(INSTALL) tools/joincluster $(PBINDIR)
|
|
|
|
+ $(INSTALL) tools/leavecluster $(PBINDIR)
|
|
|
|
-[ -f deps/p1_pam/priv/bin/epam ] \
|
|
|
|
&& $(INSTALL) -m 750 $(O_USER) deps/p1_pam/priv/bin/epam $(PBINDIR)
|
2015-01-12 10:32:20 +01:00
|
|
|
#
|
2015-07-08 11:54:14 +02:00
|
|
|
@@ -184,29 +179,6 @@ install: all
|
|
|
|
# Copy lite.sql
|
|
|
|
-[ -d deps/sqlite3 ] && $(INSTALL) -d $(SQLDIR)
|
|
|
|
-[ -d deps/sqlite3 ] && $(INSTALL) -m 644 sql/lite.sql $(SQLDIR)
|
2015-01-12 10:32:20 +01:00
|
|
|
- #
|
|
|
|
- # Spool directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(SPOOLDIR)
|
|
|
|
- [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
|
|
|
|
- #
|
|
|
|
- # ejabberdctl lock directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(CTLLOCKDIR)
|
|
|
|
- #
|
|
|
|
- # Log directory
|
|
|
|
- $(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
|
|
|
|
- $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
|
|
|
|
- chmod -R 750 $(LOGDIR)
|
2015-07-08 11:54:14 +02:00
|
|
|
- #
|
|
|
|
- # Documentation
|
|
|
|
- $(INSTALL) -d $(DOCDIR)
|
|
|
|
- [ -f doc/guide.html ] \
|
|
|
|
- && $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
|
|
|
|
- || echo "Documentation not included in sources"
|
|
|
|
- $(INSTALL) -m 644 COPYING $(DOCDIR)
|
2015-01-12 10:32:20 +01:00
|
|
|
|
|
|
|
uninstall: uninstall-binary
|