Don't use "mkdir" during install

lahwran just showed up on irc and told us that he installed znc, but znc failed
to find any modules. The reason for this was his umask 077 which means that
"make install" installed stuff so that only root can access it.

The solution is do use "install -d" since that makes sure to ignore the
currently set umask.

However, google finds results which say that "install -d" might mess with stuff
of pre-existing directories when it shouldn't, so we must first test if the
directory already exists before calling install. Obviously, this makes our
Makefile a lot more readable. :-(

I didn't have time to test this properly, so stuff might break.

Signed-off-by: Uli Schlachter <psychon@znc.in>

Conflicts:

	modules/Makefile.in
This commit is contained in:
Uli Schlachter
2011-11-03 08:54:23 +01:00
parent d082c472e5
commit 094d6f358a
3 changed files with 9 additions and 10 deletions
+2 -3
View File
@@ -101,10 +101,9 @@ install: all install_datadir
install_datadir:
rm -rf $(DESTDIR)$(DATADIR)/modules
mkdir -p $(DESTDIR)$(MODDIR)
mkdir -p $(DESTDIR)$(DATADIR)/modules
test -d $(DESTDIR)$(MODDIR) || $(INSTALL) -d $(DESTDIR)$(MODDIR)
test -d $(DESTDIR)$(DATADIR)/modules || $(INSTALL) -d $(DESTDIR)$(DATADIR)/modules
rm -rf $(DESTDIR)$(MODDIR)/*.so
mkdir -p $(DESTDIR)$(DATADIR)/modules
cp -R $(srcdir)/data/* $(DESTDIR)$(DATADIR)/modules
if test "@EXTRA@" = "yes" ; then \
cp -R $(srcdir)/extra/data/* $(DESTDIR)$(DATADIR)/modules ; \