[asterisk-commits] pabelanger: branch pabelanger/non-root r275774 - /team/pabelanger/non-root/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 12 15:41:54 CDT 2010


Author: pabelanger
Date: Mon Jul 12 15:41:51 2010
New Revision: 275774

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=275774
Log:
Clean up installdirs section; upgrade to a function.  Update asterisk.conf and
set runuser and rungroup properties.

Modified:
    team/pabelanger/non-root/Makefile

Modified: team/pabelanger/non-root/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/pabelanger/non-root/Makefile?view=diff&rev=275774&r1=275773&r2=275774
==============================================================================
--- team/pabelanger/non-root/Makefile (original)
+++ team/pabelanger/non-root/Makefile Mon Jul 12 15:41:51 2010
@@ -564,17 +564,81 @@
 OLDHEADERS=$(filter-out $(NEWHEADERS),$(notdir $(wildcard $(DESTDIR)$(ASTHEADERDIR)/*.h)))
 
 installdirs:
-	$(INSTALL) -d $(DESTDIR)$(MODULES_DIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTSBINDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTETCDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTVARRUNDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/voicemail
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/dictate
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/system
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/tmp
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/meetme
-	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/monitor
+	@if [ ! -d "$(DESTDIR)$(MODULES_DIR)" ]; then \
+		$(INSTALL) -d $(DESTDIR)$(MODULES_DIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSBINDIR)" ]; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSBINDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTETCDIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTETCDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTVARRUNDIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTVARRUNDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/voicemail" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/voicemail ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/dictate" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/dictate ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/system" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/system ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/tmp" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/tmp ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/meetme" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/meetme ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTSPOOLDIR)/monitor" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/monitor ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTHEADERDIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTHEADERDIR)/doxygen" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)/doxygen ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTLOGDIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTLOGDIR)/cdr-csv" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cdr-csv ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTLOGDIR)/cdr-custom" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cdr-custom ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTLOGDIR)/cel-csv" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cel-csv ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTLOGDIR)/cel-custom" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cel-custom ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR) ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)/documentation" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/documentation ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)/documentation/thirdparty" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)/keys" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/keys ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)/firmware" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/firmware ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTDATADIR)/firmware/iax" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/firmware/iax ; \
+	fi
+	@if [ ! -d "$(DESTDIR)$(ASTMANDIR)/man8" ] ; then \
+		$(INSTALL) -d $(DESTDIR)$(ASTMANDIR)/man8 ; \
+	fi
 
 bininstall: _all installdirs $(SUBDIRS_INSTALL)
 	$(INSTALL) -m 755 main/asterisk $(DESTDIR)$(ASTSBINDIR)/
@@ -586,26 +650,13 @@
 		$(INSTALL) -c -m 755 contrib/scripts/safe.tmp $(DESTDIR)$(ASTSBINDIR)/safe_asterisk ; \
 		rm -f contrib/scripts/safe.tmp ; \
 	fi
-	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTHEADERDIR)/doxygen
 	$(INSTALL) -m 644 include/asterisk.h $(DESTDIR)$(includedir)
 	$(INSTALL) -m 644 include/asterisk/*.h $(DESTDIR)$(ASTHEADERDIR)
 	$(INSTALL) -m 644 include/asterisk/doxygen/*.h $(DESTDIR)$(ASTHEADERDIR)/doxygen
 	if [ -n "$(OLDHEADERS)" ]; then \
 		rm -f $(addprefix $(DESTDIR)$(ASTHEADERDIR)/,$(OLDHEADERS)) ;\
 	fi
-	$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cdr-csv
-	$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cdr-custom
-	$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cel-csv
-	$(INSTALL) -d $(DESTDIR)$(ASTLOGDIR)/cel-custom
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/documentation
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/documentation/thirdparty
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/keys
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/firmware
-	$(INSTALL) -d $(DESTDIR)$(ASTDATADIR)/firmware/iax
-	$(INSTALL) -d $(DESTDIR)$(ASTMANDIR)/man8
+
 	$(INSTALL) -m 644 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
 	$(INSTALL) -m 644 doc/appdocsxml.dtd $(DESTDIR)$(ASTDATADIR)/documentation
 	$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
@@ -730,6 +781,20 @@
 			$(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp ; \
 		$(INSTALL) -c -m 644 $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH) ; \
 		rm -f $(DESTDIR)$(ASTCONFPATH).tmp ; \
+	fi ;\
+	if [ "$(AST_USER)" ] ; then \
+		sed \
+			-e 's|^;runuser = asterisk.*$$|runuser = $(AST_USER)|'\
+                        $(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp ; \
+                $(INSTALL) -c -m 644 $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH) ; \
+                rm -f $(DESTDIR)$(ASTCONFPATH).tmp ; \
+	fi ;\
+	if [ "$(AST_GROUP)" ] ; then \
+		sed \
+			-e 's|^;rungroup = asterisk.*$$|rungroup = $(AST_GROUP)|'\
+                        $(DESTDIR)$(ASTCONFPATH) > $(DESTDIR)$(ASTCONFPATH).tmp ; \
+                $(INSTALL) -c -m 644 $(DESTDIR)$(ASTCONFPATH).tmp $(DESTDIR)$(ASTCONFPATH) ; \
+                rm -f $(DESTDIR)$(ASTCONFPATH).tmp ; \
 	fi ;\
 	$(INSTALL) -d $(DESTDIR)$(ASTSPOOLDIR)/voicemail/default/1234/INBOX
 	build_tools/make_sample_voicemail $(DESTDIR)/$(ASTDATADIR) $(DESTDIR)/$(ASTSPOOLDIR)




More information about the asterisk-commits mailing list