--- projects/cms/source/server/configure	2001/03/10 02:04:54	1.8
+++ projects/cms/source/server/configure	2001/03/14 22:01:08	1.9
@@ -1,56 +1,61 @@
 #!/bin/sh
 
+#
+# i-scream Distributed Centralised Monitoring System
+# Server configure script
+#
+# $Id: configure,v 1.9 2001/03/14 22:01:08 tdb Exp $
+#
+
+## Config
+
+# HTTP Server. This is the source of all downloads.
 HTTPSERVER="http://killigrew.ukc.ac.uk/"
 
-echo "Generating Makefile includes"
-echo "SERVERROOT="`pwd` > Config.inc
-echo "include \$(SERVERROOT)/Config2.inc" >> Config.inc
+# This script uses wget, set it's path and parameters here
+WGETPARAM="-nv"
+WGET="/usr/local/bin/wget ${WGETPARAM}"
 
-echo "Checking for required libraries"
-cd build/lib
+# This should always be the same
+PWD=`pwd`
 
-if test -r "crimson.jar"; then \
-  echo "  crimson.jar found"; \
-else \
-  echo "  crimson.jar not found, fetching from ${HTTPSERVER}crimson.jar"; \
-  /usr/local/bin/wget -nv ${HTTPSERVER}crimson.jar; \
-fi
+## Library check
 
-if test -r "idl.jar"; then \
-  echo "  idl.jar found"; \
-else \
-  echo "  idl.jar not found, fetching from ${HTTPSERVER}idl.jar"; \
-  /usr/local/bin/wget -nv ${HTTPSERVER}idl.jar; \
-fi
+echo "> Checking for required libraries"
+cd build/lib
 
-if test -r "jacorb.jar"; then \
-  echo "  jacorb.jar found"; \
-else \
-  echo "  jacorb.jar not found, fetching from ${HTTPSERVER}jacorb.jar"; \
-  /usr/local/bin/wget -nv ${HTTPSERVER}jacorb.jar; \
-fi
+LIBRARIES="crimson.jar idl.jar jacorb.jar jaxp.jar mm.mysql-2.0.2-bin.jar"
 
-if test -r "jaxp.jar"; then \
-  echo "  jaxp.jar found"; \
-else \
-  echo "  jaxp.jar not found, fetching from ${HTTPSERVER}jaxp.jar"; \
-  /usr/local/bin/wget -nv ${HTTPSERVER}jaxp.jar; \
-fi
+for LIB in ${LIBRARIES}; do
+    
+    if test -r "${LIB}"; then \
+        echo "  + ${LIB} found"; \
+    else \
+        echo "  - ${LIB} not found, fetching from ${HTTPSERVER}${LIB}"; \
+        /usr/local/bin/wget -nv ${HTTPSERVER}${LIB}; \
+    fi
+    
+done
 
-if test -r "mm.mysql-2.0.2-bin.jar"; then \
-  echo "  mm.mysql-2.0.2-bin.jar found"; \
-else \
-  echo "  mm.mysql-2.0.2-bin.jar not found, fetching from ${HTTPSERVER}mm.mysql-2.0.2-bin.jar"; \
-  /usr/local/bin/wget -nv ${HTTPSERVER}mm.mysql-2.0.2-bin.jar; \
-fi
+## Check for jacorb properties file
 
-echo "Checking for jacorb.properties"
+echo "> Checking for jacorb.properties"
 cd ${HOME}
 if test -r "jacorb.properties"; then \
-  echo "  jacorb.properties found"; \
+  echo "  + jacorb.properties found"; \
 else \
-  echo "  jacorb.properties not found, fetching from ${HTTPSERVER}jacorb.properties"; \
+  echo "  - jacorb.properties not found, fetching from ${HTTPSERVER}jacorb.properties"; \
   wget -nv ${HTTPSERVER}jacorb.properties; \
 fi
 
-echo "Configure Completed"
+## Write out the include file for the Makefile's
+
+echo "> Generating Makefile includes"
+echo "  + writing root of source tree"
+echo "SOURCEROOT=${PWD}" > ${PWD}/Config.inc
+echo "  + writing include"
+echo "include \$(SOURCEROOT)/Config2.inc" >> ${PWD}/Config.inc
+
+echo "> Configure Completed"
+
+## End