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 | #check that GSDL3HOME is set
|
---|
9 | if test -z "$GSDL3HOME" ; then
|
---|
10 | source gs3-setup.sh
|
---|
11 | fi
|
---|
12 |
|
---|
13 | if test -z "$CVSROOT" ; then
|
---|
14 | echo "You need to set the environment variable CVSROOT before running"
|
---|
15 | echo "this script. Please use the same path that you used to check out"
|
---|
16 | echo "the Greentone repository. If you are not using anonymous cvs, you"
|
---|
17 | echo "also need to set the variable CVS_RSH to ssh."
|
---|
18 | exit;
|
---|
19 | fi
|
---|
20 |
|
---|
21 | # firstly, remove unwanted directories
|
---|
22 | cvs update -dRP
|
---|
23 |
|
---|
24 | # now check out extra bits
|
---|
25 | cd packages
|
---|
26 | cvs co mgpp
|
---|
27 | cd $GSDL3HOME
|
---|
28 |
|
---|
29 | # unpack tomcat and rename directory
|
---|
30 | cd comms/jakarta/
|
---|
31 | unzip jakarta-tomcat-4.1.30.zip
|
---|
32 | mv jakarta-tomcat-4.1.30 tomcat
|
---|
33 | cd $GSDL3HOME
|
---|
34 |
|
---|
35 | # unpack the soap stuff
|
---|
36 | cd comms/soap
|
---|
37 | tar xzf soap-bin-2.2.tar.gz
|
---|
38 | mv soap-2_2 soap
|
---|
39 | cd $GSDL3HOME
|
---|
40 |
|
---|
41 | #setup sample collections
|
---|
42 | cd web/sites/localsite/collect
|
---|
43 | # unpack import, index and metadata
|
---|
44 | for f in */index; do
|
---|
45 | cd $f
|
---|
46 | if test -f index.zip; then
|
---|
47 | unzip index.zip
|
---|
48 | fi
|
---|
49 | cd ../../
|
---|
50 | done
|
---|
51 |
|
---|
52 | for f in */import; do
|
---|
53 | cd $f
|
---|
54 | if test -f import.zip; then
|
---|
55 | unzip import.zip
|
---|
56 | fi
|
---|
57 | cd ../../
|
---|
58 | done
|
---|
59 |
|
---|
60 | for f in */metadata; do
|
---|
61 | cd $f
|
---|
62 | if test -f metadata.zip; then
|
---|
63 | unzip metadata.zip
|
---|
64 | fi
|
---|
65 | cd ../../
|
---|
66 | done
|
---|
67 |
|
---|
68 | for f in */archives; do
|
---|
69 | cd $f
|
---|
70 | if test -f archives.zip; then
|
---|
71 | unzip archives.zip
|
---|
72 | fi
|
---|
73 | cd ../../
|
---|
74 | done
|
---|
75 |
|
---|
76 |
|
---|
77 | cd $GSDL3HOME
|
---|
78 |
|
---|
79 |
|
---|
80 | #edit the tomcat setclasspath script to add our classpath
|
---|
81 | cat comms/jakarta/tomcat/bin/setclasspath.sh | sed 's,CLASSPATH=,CLASSPATH=\"$CLASSPATH\":,' > setclasspath.sh
|
---|
82 | mv comms/jakarta/tomcat/bin/setclasspath.sh comms/jakarta/tomcat/bin/setclasspath.bak.sh
|
---|
83 | mv setclasspath.sh comms/jakarta/tomcat/bin/setclasspath.sh
|
---|
84 |
|
---|
85 | #edit the server config file
|
---|
86 | mv comms/jakarta/tomcat/conf/server.xml comms/jakarta/tomcat/conf/server.xml.orig
|
---|
87 | cat comms/jakarta/tomcat/conf/server.xml.orig | sed "s,<\!-- Tomcat Root Context -->,<\!-- GSDL3 Service --><Context path=\"/gsdl3\" docBase=\"@gsdl3home@/web\" debug=\"1\" reloadable=\"true\"><Resources allowLinking='true'/></Context><\!-- Tomcat Root Context -->," > comms/jakarta/tomcat/conf/server.xml.in
|
---|
88 |
|
---|
89 | #make everyone happy by giving the right permissions to the shell scripts
|
---|
90 | chmod a+x comms/jakarta/tomcat/bin/*.sh
|
---|
91 |
|
---|