1 |
|
#!/bin/sh |
2 |
|
|
3 |
< |
HTTPSERVER="http://killigrew.ukc.ac.uk/" |
3 |
> |
# |
4 |
> |
# i-scream Distributed Centralised Monitoring System |
5 |
> |
# Server configure script |
6 |
> |
# |
7 |
> |
# $Id$ |
8 |
> |
# |
9 |
|
|
10 |
< |
echo "Generating Makefile includes" |
6 |
< |
echo "SERVERROOT="`pwd` > Config.inc |
7 |
< |
echo "include \$(SERVERROOT)/Config2.inc" >> Config.inc |
10 |
> |
## Config |
11 |
|
|
12 |
< |
echo "Checking for required libraries" |
13 |
< |
cd build/lib |
12 |
> |
# HTTP Server. This is the source of all downloads. |
13 |
> |
HTTPSERVER="http://www.i-scream.org.uk/downloads/lib/" |
14 |
|
|
15 |
< |
if test -r "idl.jar"; then \ |
16 |
< |
echo " idl.jar found"; \ |
17 |
< |
else \ |
18 |
< |
echo " idl.jar not found, fetching from ${HTTPSERVER}idl.jar"; \ |
19 |
< |
/usr/local/bin/wget -nv ${HTTPSERVER}idl.jar; \ |
15 |
> |
# This script uses wget, set it's path and parameters here |
16 |
> |
WGETPARAM="-nv" |
17 |
> |
if test -x /usr/bin/wget; then |
18 |
> |
WGET="/usr/bin/wget ${WGETPARAM}" |
19 |
> |
else |
20 |
> |
if test -x /usr/local/bin/wget; then |
21 |
> |
WGET="/usr/local/bin/wget ${WGETPARAM}" |
22 |
> |
else |
23 |
> |
WGET="wget ${WGETPARAM}"; |
24 |
> |
fi |
25 |
|
fi |
26 |
|
|
27 |
< |
if test -r "jacorb.jar"; then \ |
28 |
< |
echo " jacorb.jar found"; \ |
21 |
< |
else \ |
22 |
< |
echo " jacorb.jar not found, fetching from ${HTTPSERVER}jacorb.jar"; \ |
23 |
< |
/usr/local/bin/wget -nv ${HTTPSERVER}jacorb.jar; \ |
24 |
< |
fi |
27 |
> |
# This should always be the same |
28 |
> |
SRCROOT=`pwd` |
29 |
|
|
30 |
< |
if test -r "jaxp.jar"; then \ |
27 |
< |
echo " jaxp.jar found"; \ |
28 |
< |
else \ |
29 |
< |
echo " jaxp.jar not found, fetching from ${HTTPSERVER}jaxp.jar"; \ |
30 |
< |
/usr/local/bin/wget -nv ${HTTPSERVER}jaxp.jar; \ |
31 |
< |
fi |
30 |
> |
## Library check |
31 |
|
|
32 |
< |
if test -r "parser.jar"; then \ |
33 |
< |
echo " parser.jar found"; \ |
32 |
> |
echo "> Checking for required libraries" |
33 |
> |
cd build/lib |
34 |
> |
|
35 |
> |
LIBRARIES="crimson.jar idl.jar jacorb.jar jaxp.jar pircbot.jar iscream_util.jar" |
36 |
> |
|
37 |
> |
for LIB in ${LIBRARIES}; do |
38 |
> |
|
39 |
> |
if test -r "${LIB}"; then \ |
40 |
> |
echo " + ${LIB} found"; \ |
41 |
> |
else \ |
42 |
> |
echo " - ${LIB} not found, fetching from ${HTTPSERVER}${LIB}"; \ |
43 |
> |
${WGET} -nv ${HTTPSERVER}${LIB}; \ |
44 |
> |
fi |
45 |
> |
|
46 |
> |
done |
47 |
> |
|
48 |
> |
## Cache javadoc API package-list files |
49 |
> |
echo "> Caching remote API's" |
50 |
> |
|
51 |
> |
JDKURL="http://java.sun.com/j2se/1.4.2/docs/api/" |
52 |
> |
mkdir -p ${SRCROOT}/.api-cache/jdk |
53 |
> |
cd ${SRCROOT}/.api-cache/jdk |
54 |
> |
if test -r "package-list"; then \ |
55 |
> |
echo " + jdk/package-list found"; \ |
56 |
|
else \ |
57 |
< |
echo " parser.jar not found, fetching from ${HTTPSERVER}parser.jar"; \ |
58 |
< |
/usr/local/bin/wget -nv ${HTTPSERVER}parser.jar; \ |
57 |
> |
echo " - jdk/package-list not found, fetching from ${JDKURL}package-list"; \ |
58 |
> |
${WGET} ${JDKURL}package-list; \ |
59 |
|
fi |
60 |
|
|
61 |
< |
if test -r "mm.mysql-2.0.2-bin.jar"; then \ |
62 |
< |
echo " mm.mysql-2.0.2-bin.jar found"; \ |
61 |
> |
PIRCBOTURL="http://www.jibble.org/javadocs/pircbot/" |
62 |
> |
mkdir -p ${SRCROOT}/.api-cache/pircbot |
63 |
> |
cd ${SRCROOT}/.api-cache/pircbot |
64 |
> |
if test -r "package-list"; then \ |
65 |
> |
echo " + pircbot/package-list found"; \ |
66 |
|
else \ |
67 |
< |
echo " mm.mysql-2.0.2-bin.jar not found, fetching from ${HTTPSERVER}mm.mysql-2.0.2-bin.jar"; \ |
68 |
< |
/usr/local/bin/wget -nv ${HTTPSERVER}mm.mysql-2.0.2-bin.jar; \ |
67 |
> |
echo " - pircbot/package-list not found, fetching from ${PIRCBOTURL}package-list"; \ |
68 |
> |
${WGET} ${PIRCBOTURL}package-list; \ |
69 |
|
fi |
70 |
|
|
71 |
< |
echo "Checking for jacorb.properties" |
72 |
< |
cd ${HOME} |
73 |
< |
if test -r "jacorb.properties"; then \ |
74 |
< |
echo " jacorb.properties found"; \ |
71 |
> |
UTILURL="http://www.i-scream.org.uk/javadoc/util/" |
72 |
> |
mkdir -p ${SRCROOT}/.api-cache/util |
73 |
> |
cd ${SRCROOT}/.api-cache/util |
74 |
> |
if test -r "package-list"; then \ |
75 |
> |
echo " + util/package-list found"; \ |
76 |
|
else \ |
77 |
< |
echo " jacorb.properties not found, fetching from ${HTTPSERVER}jacorb.properties"; \ |
78 |
< |
wget -nv ${HTTPSERVER}jacorb.properties; \ |
77 |
> |
echo " - util/package-list not found, fetching from ${UTILURL}package-list"; \ |
78 |
> |
${WGET} ${UTILURL}package-list; \ |
79 |
|
fi |
80 |
|
|
81 |
< |
echo "Configure Completed" |
81 |
> |
## Write out the include file for the Makefile's |
82 |
> |
|
83 |
> |
echo "> Generating Makefile includes" |
84 |
> |
echo " + writing root of source tree" |
85 |
> |
echo "SOURCEROOT=${SRCROOT}" > ${SRCROOT}/Config.inc |
86 |
> |
echo " + writing include" |
87 |
> |
echo "include \$(SOURCEROOT)/Config2.inc" >> ${SRCROOT}/Config.inc |
88 |
> |
|
89 |
> |
echo "> Configure Completed" |
90 |
> |
|
91 |
> |
## End |