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 | source gs3-setup.sh
|
---|
10 |
|
---|
11 | if test -z "$CVSROOT" ; then
|
---|
12 | echo "You need to set the environment variable CVSROOT before running"
|
---|
13 | echo "this script. Please use the same path that you used to check out"
|
---|
14 | echo "the Greentone repository. If you are not using anonymous cvs, you"
|
---|
15 | echo "also need to set the variable CVS_RSH to ssh."
|
---|
16 | exit;
|
---|
17 | fi
|
---|
18 |
|
---|
19 | # firstly, remove unwanted directories
|
---|
20 | cvs update -dRP
|
---|
21 |
|
---|
22 | # now check out extra bits
|
---|
23 | cd packages
|
---|
24 | cvs co -P mgpp
|
---|
25 | cd $GSDL3HOME
|
---|
26 |
|
---|
27 | cvs co -P gli
|
---|
28 | cd gli
|
---|
29 | ./makegli.sh
|
---|
30 | cd classes
|
---|
31 | jar cf GLI.jar org images META-INF/MANIFEST.MF *.properties
|
---|
32 | rm -r org
|
---|
33 | mv GLI.jar ../
|
---|
34 | cd $GSDL3HOME
|
---|
35 |
|
---|
36 | ###############################
|
---|
37 | # SETUP TOMCAT
|
---|
38 | ###############################
|
---|
39 |
|
---|
40 | # unpack tomcat and rename directory
|
---|
41 | cd comms/jakarta/
|
---|
42 | unzip jakarta-tomcat-4.1.30.zip
|
---|
43 | mv jakarta-tomcat-4.1.30 tomcat
|
---|
44 |
|
---|
45 | # edit the tomcat setclasspath scripts to add our classpath
|
---|
46 | mv ./tomcat/bin/setclasspath.bat ./tomcat/bin/setclasspath.bat.orig
|
---|
47 | cat ./tomcat/bin/setclasspath.bat.orig | sed 's,CLASSPATH=,CLASSPATH=%CLASSPATH%;,' > ./tomcat/bin/setclasspath.bat
|
---|
48 | mv ./tomcat/bin/setclasspath.sh ./tomcat/bin/setclasspath.sh.orig
|
---|
49 | cat ./tomcat/bin/setclasspath.sh.orig | sed 's,CLASSPATH=,CLASSPATH=\"$CLASSPATH\":,' > ./tomcat/bin/setclasspath.sh
|
---|
50 |
|
---|
51 | #make everyone happy by giving the right permissions to the shell scripts
|
---|
52 | chmod a+x ./tomcat/bin/*.sh
|
---|
53 |
|
---|
54 | #rename server.xml files
|
---|
55 | mv ./tomcat/conf/server.xml ./tomcat/conf/server-withexamples.xml.config
|
---|
56 | #mv ./tomcat/conf/server-noexamples.xml.config ./tomcat/conf/server.xml
|
---|
57 | # @gsdl3home@ will be set by the installer, and 8080 replaced with the correct port
|
---|
58 | cp server.xml.in ./tomcat/conf/server.xml
|
---|
59 | cd $GSDL3HOME
|
---|
60 |
|
---|
61 | ###############################
|
---|
62 | # SETUP SOAP
|
---|
63 | ###############################
|
---|
64 | #extract the soap jar file
|
---|
65 | cd comms/soap
|
---|
66 | unzip soap-bin-2.3.1.zip
|
---|
67 | mv soap-2_3_1 soap
|
---|
68 | cp soap/lib/soap.jar $GSDL3HOME/lib/java
|
---|
69 | # move the localsite deployment description into the soap webapp - localsite comes predeployed
|
---|
70 | cp DeployedServices.ds soap/webapps/soap/
|
---|
71 | # disable soap by renaming the web.xml file
|
---|
72 | mv ./soap/webapps/soap/WEB-INF/web.xml ./soap/webapps/soap/WEB-INF/web.xml.disabled
|
---|
73 |
|
---|
74 | cd $GSDL3HOME
|
---|
75 |
|
---|
76 | ################################
|
---|
77 | # SETUP MYSQL + SAMPLE DATABASES
|
---|
78 | ################################
|
---|
79 | cd packages/mysql
|
---|
80 | unzip mysql-4.0.20-linux.zip
|
---|
81 | mkdir var
|
---|
82 | mkdir var/log
|
---|
83 | chmod 777 var var/log
|
---|
84 | ./scripts/mysql_install_db --user=root --force
|
---|
85 | ./bin/mysqld_safe --user=root --pid_file=gsdl3.pid &
|
---|
86 | sleep 2
|
---|
87 | ./bin/mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
|
---|
88 | ./bin/mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
|
---|
89 |
|
---|
90 | # set up any sample collections databases
|
---|
91 | #gs3mgdemo
|
---|
92 | ./bin/mysql --user=root --execute="create database localsite_gs3mgdemo;"
|
---|
93 | ./bin/mysql --user=root localsite_gs3mgdemo < $GSDL3HOME/web/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql
|
---|
94 |
|
---|
95 | ./bin/mysqladmin --user=root shutdown
|
---|
96 | cd $GSDL3HOME
|
---|
97 |
|
---|
98 |
|
---|
99 | #compile the test servlet
|
---|
100 | source gs3-setup.sh
|
---|
101 | cd web/WEB-INF/classes
|
---|
102 | javac TestServlet.java
|
---|
103 | cd $GSDL3HOME
|
---|
104 |
|
---|
105 | # make mg and mgpp compile statically
|
---|
106 | cd packages/mg
|
---|
107 | cat ./configure.in | sed 's,LDFLAGS=,LDFLAGS=-static,' > ./configure.in.tmp
|
---|
108 | mv configure.in.tmp configure.in
|
---|
109 | autoconf configure.in > configure
|
---|
110 | cd $GSDL3HOME
|
---|
111 |
|
---|
112 | cd packages/mgpp
|
---|
113 | cat ./configure.in | sed 's,LDFLAGS=,LDFLAGS=-static,' > ./configure.in.tmp
|
---|
114 | mv configure.in.tmp configure.in
|
---|
115 | autoconf configure.in > configure
|
---|
116 | cd $GSDL3HOME
|
---|
117 |
|
---|
118 |
|
---|
119 | ./configure
|
---|
120 | make
|
---|
121 | make install
|
---|
122 | make distclean
|
---|
123 |
|
---|
124 | # strip the c/c++ executables
|
---|
125 | strip bin/*
|
---|
126 |
|
---|
127 |
|
---|
128 |
|
---|