package/dhcp/S80dhcp-server: allow empty INTERFACES
[buildroot-gz.git] / package / ejabberd / 0007-fix-install-permissions.patch
blob89e3379b8c6e66b870fd7aa9e6ed8dd478d2564c
1 Description: fix install permissions
2 Without this patch, the makefile will try to install directories and
3 files with incompatible permissions for ejabberd, which run as an
4 ejabberd user.
5 Author: Johan Oudinet <johan.oudinet@gmail.com>
7 Index: ejabberd/Makefile.in
8 ===================================================================
9 diff --git a/Makefile.in b/Makefile.in
10 index f7b30d4..84098a6 100644
11 --- a/Makefile.in
12 +++ b/Makefile.in
13 @@ -114,10 +114,8 @@ DLLs := $(wildcard deps/*/priv/*.so) $(wildcard deps/*/priv/lib/*.so)
14 install: all
16 # Configuration files
17 - $(INSTALL) -d -m 750 $(G_USER) $(ETCDIR)
18 - [ -f $(ETCDIR)/ejabberd.yml ] \
19 - && $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml-new \
20 - || $(INSTALL) -b -m 640 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
21 + $(INSTALL) -d $(ETCDIR)
22 + $(INSTALL) -b -m 644 $(G_USER) ejabberd.yml.example $(ETCDIR)/ejabberd.yml
23 $(SED) -e "s*{{rootdir}}*@prefix@*" \
24 -e "s*{{installuser}}*@INSTALLUSER@*" \
25 -e "s*{{bindir}}*@bindir@*" \
26 @@ -127,14 +125,11 @@ install: all
27 -e "s*{{docdir}}*@docdir@*" \
28 -e "s*{{erl}}*@ERL@*" ejabberdctl.template \
29 > ejabberdctl.example
30 - [ -f $(ETCDIR)/ejabberdctl.cfg ] \
31 - && $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg-new \
32 - || $(INSTALL) -b -m 640 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
33 + $(INSTALL) -b -m 644 $(G_USER) ejabberdctl.cfg.example $(ETCDIR)/ejabberdctl.cfg
34 $(INSTALL) -b -m 644 $(G_USER) inetrc $(ETCDIR)/inetrc
36 # Administration script
37 - [ -d $(SBINDIR) ] || $(INSTALL) -d -m 755 $(SBINDIR)
38 - $(INSTALL) -m 550 $(G_USER) ejabberdctl.example $(SBINDIR)/ejabberdctl
39 + $(INSTALL) -D ejabberdctl.example $(SBINDIR)/ejabberdctl
40 # Elixir binaries
41 [ -d $(BINDIR) ] || $(INSTALL) -d -m 755 $(BINDIR)
42 [ -f deps/elixir/bin/iex ] && $(INSTALL) -m 550 $(G_USER) deps/elixir/bin/iex $(BINDIR)/iex || true
43 @@ -165,9 +160,9 @@ install: all
45 # Binary C programs
46 $(INSTALL) -d $(PBINDIR)
47 - $(INSTALL) -m 750 $(O_USER) tools/captcha.sh $(PBINDIR)
48 - $(INSTALL) -m 750 $(O_USER) tools/joincluster $(PBINDIR)
49 - $(INSTALL) -m 750 $(O_USER) tools/leavecluster $(PBINDIR)
50 + $(INSTALL) tools/captcha.sh $(PBINDIR)
51 + $(INSTALL) tools/joincluster $(PBINDIR)
52 + $(INSTALL) tools/leavecluster $(PBINDIR)
53 [ -f deps/p1_pam/priv/bin/epam ] \
54 && $(INSTALL) -m 750 $(O_USER) deps/p1_pam/priv/bin/epam $(PBINDIR) \
55 || true
56 @@ -185,29 +180,6 @@ install: all
57 # Copy lite.sql
58 [ -d deps/sqlite3 ] && $(INSTALL) -d $(SQLDIR) || true
59 [ -d deps/sqlite3 ] && $(INSTALL) -m 644 sql/lite.sql $(SQLDIR) || true
60 - #
61 - # Spool directory
62 - $(INSTALL) -d -m 750 $(O_USER) $(SPOOLDIR)
63 - $(CHOWN_COMMAND) -R @INSTALLUSER@ $(SPOOLDIR) >$(CHOWN_OUTPUT)
64 - chmod -R 750 $(SPOOLDIR)
65 - [ ! -f $(COOKIEFILE) ] || { $(CHOWN_COMMAND) @INSTALLUSER@ $(COOKIEFILE) >$(CHOWN_OUTPUT) ; chmod 400 $(COOKIEFILE) ; }
66 - #
67 - # ejabberdctl lock directory
68 - $(INSTALL) -d -m 750 $(O_USER) $(CTLLOCKDIR)
69 - $(CHOWN_COMMAND) -R @INSTALLUSER@ $(CTLLOCKDIR) >$(CHOWN_OUTPUT)
70 - chmod -R 750 $(CTLLOCKDIR)
71 - #
72 - # Log directory
73 - $(INSTALL) -d -m 750 $(O_USER) $(LOGDIR)
74 - $(CHOWN_COMMAND) -R @INSTALLUSER@ $(LOGDIR) >$(CHOWN_OUTPUT)
75 - chmod -R 750 $(LOGDIR)
76 - #
77 - # Documentation
78 - $(INSTALL) -d $(DOCDIR)
79 - [ -f doc/guide.html ] \
80 - && $(INSTALL) -m 644 doc/guide.html $(DOCDIR) \
81 - || echo "Documentation not included in sources"
82 - $(INSTALL) -m 644 COPYING $(DOCDIR)
84 uninstall: uninstall-binary