source: trunk/gsdl3/gs3-prepare.sh@ 7833

Last change on this file since 7833 was 7807, checked in by kjdon, 20 years ago

changing soap server modifications

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1#!/bin/sh
2
3if [ ! -f gs3-setup.sh ]; then
4 echo "You must run this script from within the Greenstone 3 home directory"
5 exit 1
6fi
7
8source gs3-setup.sh
9
10gsdl3home=$GSDL3HOME
11
12if test -z "$CVSROOT" ; then
13 echo "You need to set the environment variable CVSROOT before running"
14 echo "this script. Please use the same path that you used to check out"
15 echo "the Greentone repository. If you are not using anonymous cvs, you"
16 echo "also need to set the variable CVS_RSH to ssh."
17 exit;
18fi
19
20# firstly, remove unwanted directories
21cvs update -dRP
22
23# now check out extra bits
24cd packages
25if [ ! -d mgpp ]; then
26 cvs co -P mgpp
27fi
28cd $GSDL3HOME
29
30#### TOMCAT ####
31cd comms/jakarta/
32# unpack tomcat and rename directory
33if [ ! -d tomcat ]; then
34 unzip jakarta-tomcat-4.1.30.zip
35 mv jakarta-tomcat-4.1.30 tomcat
36fi
37#edit the tomcat setclasspath script to add our classpath
38if [ ! -f ./tomcat/bin/setclasspath.sh.orig ]; then
39 mv ./tomcat/bin/setclasspath.sh ./tomcat/bin/setclasspath.sh.orig
40 cat ./tomcat/bin/setclasspath.sh.orig | sed 's,CLASSPATH=,CLASSPATH=\"$CLASSPATH\":,' > ./tomcat/bin/setclasspath.sh
41fi
42#edit the server config file
43if ! grep -q gsdl3 ./tomcat/conf/server.xml; then
44 cat ./tomcat/conf/server.xml | sed "s,<\!-- Tomcat Root Context -->,<\!-- GSDL3 Service --><Context path=\"/gsdl3\" docBase=\"${gsdl3home}/web\" debug=\"1\" reloadable=\"true\"><Resources allowLinking='true'/></Context><\!-- Tomcat Root Context -->," > server.xml.tmp
45 mv server.xml.tmp ./tomcat/conf/server.xml
46fi
47#make everyone happy by giving the right permissions to the shell scripts
48chmod a+x ./tomcat/bin/*.sh
49
50cd $GSDL3HOME
51
52# Edit the web/WEB-INF/web.xml to set gsdl3home
53if [ ! -f ./web/WEB-INF/web.xml ]; then
54 sed "s|@gsdl3home@|${gsdl3home}|" ./web/WEB-INF/web.xml.in > ./web/WEB-INF/web.xml
55fi
56
57#### SOAP ####
58cd comms/soap
59# unpack soap and rename directory
60if [ ! -d soap ]; then
61 unzip soap-bin-2.3.1.zip
62 mv soap-2_3_1 soap
63 cp soap/lib/soap.jar $GSDL3HOME/lib/java
64# move the localsite deployment description into the soap webapp - localsite comes predeployed
65 cp DeployedServices.ds soap/webapps/soap/
66fi
67cd $GSDL3HOME
68
69# edit the localsite soap server class, - add in gsdl3home
70if [ ! -f ./src/java/org/greenstone/gsdl3/SOAPServerLocalsite.java ]; then
71 sed "s|@gsdl3home@|${gsdl3home}|" ./src/java/org/greenstone/gsdl3/SOAPServerLocalsite.java.in > ./src/java/org/greenstone/gsdl3/SOAPServerLocalsite.java
72fi
73
74#### SAMPLE COLLECTIONS ####
75# how can we stop these being done more than once? and do we need to?
76cd web/sites/localsite/collect
77# unpack import, index and metadata
78for f in */index; do
79 cd $f
80 if test -f index.zip; then
81 unzip index.zip
82 fi
83 cd ../../
84done
85
86for f in */import; do
87 cd $f
88 if test -f import.zip; then
89 unzip import.zip
90 fi
91 cd ../../
92done
93
94for f in */metadata; do
95 cd $f
96 if test -f metadata.zip; then
97 unzip metadata.zip
98 fi
99 cd ../../
100done
101
102for f in */archives; do
103 cd $f
104 if test -f archives.zip; then
105 unzip archives.zip
106 fi
107 cd ../../
108done
109
110
111cd $GSDL3HOME
112
113
114
115
116
Note: See TracBrowser for help on using the repository browser.