1 | #!/bin/sh
|
---|
2 |
|
---|
3 | if [ ! -f gs3-setup.sh ]; then
|
---|
4 | echo "You must run this script from within the Greenstone 3 home directory"
|
---|
5 | exit 1
|
---|
6 | fi
|
---|
7 |
|
---|
8 | source gs3-setup.sh
|
---|
9 |
|
---|
10 | gsdl3home=$GSDL3HOME
|
---|
11 |
|
---|
12 | if 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;
|
---|
18 | fi
|
---|
19 |
|
---|
20 | # firstly, remove unwanted directories
|
---|
21 | cvs update -dRP
|
---|
22 |
|
---|
23 | # now check out extra bits
|
---|
24 | cd packages
|
---|
25 | if [ ! -d mgpp ]; then
|
---|
26 | cvs co -P mgpp
|
---|
27 | fi
|
---|
28 | cd $GSDL3HOME
|
---|
29 |
|
---|
30 | #### TOMCAT ####
|
---|
31 | cd comms/jakarta/
|
---|
32 | # unpack tomcat and rename directory
|
---|
33 | if [ ! -d tomcat ]; then
|
---|
34 | unzip jakarta-tomcat-4.1.30.zip
|
---|
35 | mv jakarta-tomcat-4.1.30 tomcat
|
---|
36 | fi
|
---|
37 | #edit the tomcat setclasspath script to add our classpath
|
---|
38 | if [ ! -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
|
---|
41 | fi
|
---|
42 | #edit the server config file
|
---|
43 | if ! 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
|
---|
46 | fi
|
---|
47 | #make everyone happy by giving the right permissions to the shell scripts
|
---|
48 | chmod a+x ./tomcat/bin/*.sh
|
---|
49 |
|
---|
50 | cd $GSDL3HOME
|
---|
51 |
|
---|
52 | # Edit the web/WEB-INF/web.xml to set gsdl3home
|
---|
53 | if [ ! -f ./web/WEB-INF/web.xml ]; then
|
---|
54 | sed "s|@gsdl3home@|${gsdl3home}|" ./web/WEB-INF/web.xml.in > ./web/WEB-INF/web.xml
|
---|
55 | fi
|
---|
56 |
|
---|
57 | #### SOAP ####
|
---|
58 | cd comms/soap
|
---|
59 | # unpack soap and rename directory
|
---|
60 | if [ ! -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/
|
---|
66 | fi
|
---|
67 | cd $GSDL3HOME
|
---|
68 |
|
---|
69 | # edit the localsite soap server class, - add in gsdl3home
|
---|
70 | if [ ! -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
|
---|
72 | fi
|
---|
73 |
|
---|
74 | #### SAMPLE COLLECTIONS ####
|
---|
75 | # how can we stop these being done more than once? and do we need to?
|
---|
76 | cd web/sites/localsite/collect
|
---|
77 | # unpack import, index and metadata
|
---|
78 | for f in */index; do
|
---|
79 | cd $f
|
---|
80 | if test -f index.zip; then
|
---|
81 | unzip index.zip
|
---|
82 | fi
|
---|
83 | cd ../../
|
---|
84 | done
|
---|
85 |
|
---|
86 | for f in */import; do
|
---|
87 | cd $f
|
---|
88 | if test -f import.zip; then
|
---|
89 | unzip import.zip
|
---|
90 | fi
|
---|
91 | cd ../../
|
---|
92 | done
|
---|
93 |
|
---|
94 | for f in */metadata; do
|
---|
95 | cd $f
|
---|
96 | if test -f metadata.zip; then
|
---|
97 | unzip metadata.zip
|
---|
98 | fi
|
---|
99 | cd ../../
|
---|
100 | done
|
---|
101 |
|
---|
102 | for f in */archives; do
|
---|
103 | cd $f
|
---|
104 | if test -f archives.zip; then
|
---|
105 | unzip archives.zip
|
---|
106 | fi
|
---|
107 | cd ../../
|
---|
108 | done
|
---|
109 |
|
---|
110 |
|
---|
111 | cd $GSDL3HOME
|
---|
112 |
|
---|
113 |
|
---|
114 |
|
---|
115 |
|
---|
116 |
|
---|