ispman Makefile,1.78,1.79

Joerg Delker <[email protected]> Thu, 07 Jun 2007 11:44:55 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1406

Modified Files:
	Makefile 
Log Message:
some cleanup and simplification in many targets

Index: Makefile
===================================================================
RCS file: /cvsroot/ispman/ispman/Makefile,v
retrieving revision 1.78
retrieving revision 1.79
diff -u -d -r1.78 -r1.79
--- Makefile	18 Sep 2006 09:47:50 -0000	1.78
+++ Makefile	7 Jun 2007 11:44:52 -0000	1.79
@@ -12,137 +12,156 @@
 
 
 # generate schema files
-schema:
+build-schema:
 	$(MAKE) -C install-data/schema all
 
 # generate prime-ldif 
-ldif:
+build-ldif:
 	$(MAKE) -C install-data/ldifs all
 
+# constructing ispman.conf 	
+build-config: build-ldif build-schema
+	@cat install-data/ispman.config install-data/ldifs/ispmanVarSort.conf \
+		> install-data/ispman.conf
+	@echo '1;' >> install-data/ispman.conf
+
+	
+# prepare ispman files
+ispman: build-config
+	# give the exec permission to install-sh
+	chmod +x install-sh
 
+	
 # install schema files
 install-schema:
-	@echo Installing LDAP schema files
-	$(MAKE) -C install-data/schema install
-
+	@echo Installing LDAP schema files; \
+		$(MAKE) -C install-data/schema install
 
 # install prime-ldif
 install-ldif:
-	@echo Installing prime LDIF file
-	$(MAKE) -C install-data/ldifs install
-
+	@echo Installing prime LDIF file; \
+		$(MAKE) -C install-data/ldifs install
 
-# prepare ispman files
-ispman: schema ldif
-	# give the exec permission to install-sh
-	chmod +x install-sh
+# install documentation & examples
+install-doc:
+	@echo ""
+	@echo "Installing documentation & examples:"
+	@echo ""
 
+	@echo "...creating dir $(DESTDIR)$(PREFIX)/docs"; \
+	$(INSTALL) -d -m 755 $(DESTDIR)$(PREFIX)/docs
+	
+	$(INSTALL) -c -m 644 VERSION $(DESTDIR)$(PREFIX)/docs
+	
+	@list="`find docs -type f | grep -v CVS | grep -v '/\.'`"; \
+	for p in $$list; do \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 644 $$p $(DESTDIR)$(PREFIX)/$$p; \
+	done
+	
+	@list="`cd install-data; find examples -type f | grep -v CVS | grep -v '/\.'`"; \
+	for p in $$list; do \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)/docs"; \
+	   $(INSTALL) -c -m 644 install-data/$$p $(DESTDIR)$(PREFIX)/docs/$$p; \
+	done
+	
 # install base files
 install-base: install-base-dirs install-schema install-ldif
-	@echo "ISPMan Base Files"
-	@echo "-----------------"
-	$(INSTALL) -c VERSION $(DESTDIR)$(PREFIX)
-
-	@cat install-data/ispman.config install-data/ldifs/ispmanVarSort.conf \
-		> install-data/ispman.conf
-	@echo '1;' >> install-data/ispman.conf
-	$(INSTALL) -m 640 install-data/ispman.conf $(DESTDIR)$(PREFIX)/conf/ispman.conf.example
-	$(INSTALL) -c install-data/nls.conf $(DESTDIR)$(PREFIX)/conf
+	@echo ""
+	@echo "Installing ISPMan Base Components:"
+	@echo ""
+	
+	@echo "...installing config files"; \
+	$(INSTALL) -c -m 640 install-data/ispman.conf $(DESTDIR)$(PREFIX)/conf/ispman.conf.example; \
 
-	$(INSTALL) -c lib/ISPMan.pm $(DESTDIR)$(PREFIX)/lib
-	$(INSTALL) -c lib/CustomerMan.pm $(DESTDIR)$(PREFIX)/lib
-	@list="`find lib/ISPMan lib/CustomerMan -name \*.pm -o -name \*.pl` lib/*.lib"; \
+	@list="`find lib -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 644 $$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
-	@list="`find install-data/templates -type f | grep -v CVS | grep -v '/\.'`"; \
+	@list="`cd install-data; find templates -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/templates"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/templates; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 644 install-data/$$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
 
 # install cli and agent binaries
-install-bin: install-base
-	@echo "ISPMan binaries"
-	@echo "---------------"
+install-bin: install-base install-bin-dirs
+	@echo ""
+	@echo "Installing ISPMan binaries & agent:"
+	@echo ""
+	
 	@list="`find bin -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c -m 750 $$p $(DESTDIR)$(PREFIX)/$$p"; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
 	   $(INSTALL) -c -m 750 $$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
-
-# install agent binary
-install-agent: install-base install-bin
-	@echo "ISPMan agent"
-	@echo "------------"
-	$(INSTALL) -c -m 750 bin/ispman-agent $(DESTDIR)$(PREFIX)/bin/ispman-agent
 	@list="`find tasks -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 640 $$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
 
 # install files for web UI
-install-web: install-base
+install-web: install-base install-web-dirs
+	@echo ""
 	@echo "ISPMan web interface"
-	@echo "--------------------"
+	@echo ""
+	
 	@list="`find locale -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/$$p; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)/conf"; \
+	   $(INSTALL) -c -m 644 $$p $(DESTDIR)$(PREFIX)/conf/$$p; \
 	done
 
-	@list="`find ispman-web/htdocs -type f | grep -v CVS | grep -v '/\.'`"; \
+	@echo "...installing nls.conf to $(DESTDIR)$(PREFIX)/conf"; \
+	$(INSTALL) -c -m 644 install-data/nls.conf $(DESTDIR)$(PREFIX)/conf
+
+	@list="`cd ispman-web; find htdocs -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 640 ispman-web/$$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
-	@list="`find ispman-web/cgi-bin -type f | grep -v CVS | grep -v '/\.'`"; \
+	@list="`cd ispman-web; find cgi-bin -type f | grep -v CVS | grep -v '/\.'`"; \
 	for p in $$list; do \
-	   echo "$(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`"; \
-	   $(INSTALL) -c $$p $(DESTDIR)$(PREFIX)/`echo $$p|sed 's/ispman-web\///'`; \
+	   echo "...installing $$p to $(DESTDIR)$(PREFIX)"; \
+	   $(INSTALL) -c -m 640 ispman-web/$$p $(DESTDIR)$(PREFIX)/$$p; \
 	done
 
-	$(INSTALL) -c -m 755 ispman-web/htdocs/admin/index.cgi \
-		$(DESTDIR)$(PREFIX)/htdocs/admin/index.cgi
-	$(INSTALL) -c -m 755 ispman-web/htdocs/control_panel/index.cgi \
-		$(DESTDIR)$(PREFIX)/htdocs/control_panel/index.cgi
+	@echo "...setting mode +x on $(DESTDIR)$(PREFIX)/htdocs/admin/index.cgi"; \
+	chmod +x $(DESTDIR)$(PREFIX)/htdocs/admin/index.cgi
 
-# if we are doing web installation then the conf directory should be
-# read+executable by the webserver
-	chmod 755 $(DESTDIR)$(PREFIX)/conf
-	chmod 644 $(DESTDIR)$(PREFIX)/conf/ispman.conf*
 
 # create base directories
 install-base-dirs:
-	$(INSTALL) -d -m 750 $(DESTDIR)$(PREFIX)
-	$(INSTALL) -d -m 750 $(DESTDIR)$(PREFIX)/conf
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/lib
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/templates
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/var
-
-
-# create cli/agent directories
-install-bin-dirs: install-base-dirs
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/var
+	@for d in $(DESTDIR)$(PREFIX) $(DESTDIR)$(PREFIX)/templates; do \
+	   echo "...creating dir $$d"; \
+	   $(INSTALL) -d -m 755 $$d; \
+	done
 
+# create bin directories
+install-bin-dirs:
+	@for d in $(DESTDIR)$(PREFIX)/bin $(DESTDIR)$(PREFIX)/tasks \
+	          $(DESTDIR)$(PREFIX)/var; do \
+	   echo "...creating dir $$d"; \
+	   $(INSTALL) -d -m 755 $$d; \
+	done
 
 # create web directories
-install-web-dirs: install-base-dirs
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/htdocs
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/cgi-bin
-	$(INSTALL) -d $(DESTDIR)$(PREFIX)/locale
-
+install-web-dirs:
+	@for d in $(DESTDIR)$(PREFIX)/conf/locale \
+	          $(DESTDIR)$(PREFIX)/htdocs $(DESTDIR)$(PREFIX)/cgi-bin; do \
+	   echo "...creating dir $$d"; \
+	   $(INSTALL) -d -m 755 $$d; \
+	done
 
 # generic install rule
-install: install-base install-bin install-web install-agent
+install: install-base install-bin install-web install-doc
 
 
 # cleanup generated files


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/