--- projects/cms/source/server/configure 2001/01/22 18:31:12 1.4 +++ projects/cms/source/server/configure 2003/02/05 16:43:44 1.18 @@ -1,56 +1,92 @@ #!/bin/sh -HTTPSERVER="http://killigrew.ukc.ac.uk/" +# +# i-scream Distributed Centralised Monitoring System +# Server configure script +# +# $Id: configure,v 1.18 2003/02/05 16:43:44 tdb Exp $ +# -echo "Generating Makefile includes" -echo "SERVERROOT="`pwd` > Config.inc -echo "include \$(SERVERROOT)/Config2.inc" >> Config.inc +## Config -echo "Checking for required libraries" -cd build/lib +# HTTP Server. This is the source of all downloads. +HTTPSERVER="http://www.i-scream.org.uk/downloads/lib/" -if test -r "idl.jar"; then \ - echo " idl.jar found"; \ -else \ - echo " idl.jar not found, fetching from ${HTTPSERVER}idl.jar"; \ - wget -nv ${HTTPSERVER}idl.jar; \ +# This script uses wget, set it's path and parameters here +WGETPARAM="-nv" +if test -x /usr/bin/wget; then + WGET="/usr/bin/wget ${WGETPARAM}" +else + if test -x /usr/local/bin/wget; then + WGET="/usr/local/bin/wget ${WGETPARAM}" + else + WGET="wget ${WGETPARAM}"; + fi fi -if test -r "jacorb.jar"; then \ - echo " jacorb.jar found"; \ -else \ - echo " jacorb.jar not found, fetching from ${HTTPSERVER}jacorb.jar"; \ - wget -nv ${HTTPSERVER}jacorb.jar; \ -fi +# This should always be the same +SRCROOT=`pwd` -if test -r "jaxp.jar"; then \ - echo " jaxp.jar found"; \ -else \ - echo " jaxp.jar not found, fetching from ${HTTPSERVER}jaxp.jar"; \ - wget -nv ${HTTPSERVER}jaxp.jar; \ -fi +## Library check -if test -r "parser.jar"; then \ - echo " parser.jar found"; \ +echo "> Checking for required libraries" +cd build/lib + +LIBRARIES="crimson.jar idl.jar jacorb.jar jaxp.jar mm.mysql-2.0.11-bin.jar pircbot.jar iscream_util.jar" + +for LIB in ${LIBRARIES}; do + + if test -r "${LIB}"; then \ + echo " + ${LIB} found"; \ + else \ + echo " - ${LIB} not found, fetching from ${HTTPSERVER}${LIB}"; \ + ${WGET} -nv ${HTTPSERVER}${LIB}; \ + fi + +done + +## Check for jacorb properties file + +echo "> Checking for jacorb.properties" +cd ${HOME} +if test -r "jacorb.properties"; then \ + echo " + jacorb.properties found"; \ else \ - echo " parser.jar not found, fetching from ${HTTPSERVER}parser.jar"; \ - wget -nv ${HTTPSERVER}parser.jar; \ + echo " - jacorb.properties not found, fetching from ${HTTPSERVER}jacorb.properties"; \ + ${WGET} ${HTTPSERVER}jacorb.properties; \ fi -if test -r "mysql.jar"; then \ - echo " mysql.jar found"; \ +## Cache javadoc API package-list files +echo "> Caching remote API's" + +JDKURL="http://java.sun.com/j2se/1.3/docs/api/" +mkdir -p ${SRCROOT}/.api-cache/jdk +cd ${SRCROOT}/.api-cache/jdk +if test -r "package-list"; then \ + echo " + jdk/package-list found"; \ else \ - echo " mysql.jar not found, fetching from ${HTTPSERVER}mysql.jar"; \ - wget -nv ${HTTPSERVER}mysql.jar; \ + echo " - jdk/package-list not found, fetching from ${JDKURL}package-list"; \ + ${WGET} ${JDKURL}package-list; \ fi -echo "Checking for jacorb.properties" -cd ${HOME} -if test -r "jacorb.properties"; then \ - echo " jacorb.properties found"; \ +PIRCBOTURL="http://www.jibble.org/javadocs/pircbot/" +mkdir -p ${SRCROOT}/.api-cache/pircbot +cd ${SRCROOT}/.api-cache/pircbot +if test -r "package-list"; then \ + echo " + pircbot/package-list found"; \ else \ - echo " jacorb.properties not found, fetching from ${HTTPSERVER}jacorb.properties"; \ - wget -nv ${HTTPSERVER}jacorb.properties; \ + echo " - pircbot/package-list not found, fetching from ${PIRCBOTURL}package-list"; \ + ${WGET} ${PIRCBOTURL}package-list; \ 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=${SRCROOT}" > ${SRCROOT}/Config.inc +echo " + writing include" +echo "include \$(SOURCEROOT)/Config2.inc" >> ${SRCROOT}/Config.inc + +echo "> Configure Completed" + +## End