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 | # unpack tomcat and rename directory
|
---|
37 | cd comms/jakarta/
|
---|
38 | unzip jakarta-tomcat-4.1.30.zip
|
---|
39 | mv jakarta-tomcat-4.1.30 tomcat
|
---|
40 |
|
---|
41 | #edit the tomcat setclasspath script to add our classpath
|
---|
42 | mv ./tomcat/bin/setclasspath.sh ./tomcat/bin/setclasspath.sh.orig
|
---|
43 | cat ./tomcat/bin/setclasspath.sh.orig | sed 's,CLASSPATH=,CLASSPATH=\"$CLASSPATH\":,' > ./tomcat/bin/setclasspath.sh
|
---|
44 |
|
---|
45 | #make everyone happy by giving the right permissions to the shell scripts
|
---|
46 | chmod a+x ./tomcat/bin/*.sh
|
---|
47 |
|
---|
48 | #rename server.xml files
|
---|
49 | mv ./tomcat/conf/server.xml ./tomcat/conf/server-withexamples.xml.config
|
---|
50 | mv ./tomcat/conf/server-noexamples.xml.config ./tomcat/conf/server.xml
|
---|
51 | cd $GSDL3HOME
|
---|
52 |
|
---|
53 | #extract the soap jar file
|
---|
54 | cd comms/soap
|
---|
55 | unzip soap-bin-2.3.1.zip
|
---|
56 | mv soap-2_3_1 soap
|
---|
57 | cp soap/lib/soap.jar $GSDL3HOME/lib/java
|
---|
58 | cd $GSDL3HOME
|
---|
59 |
|
---|
60 | # get mysql
|
---|
61 | cd packages/mysql
|
---|
62 | unzip mysql-4.0.20-linux.zip
|
---|
63 |
|
---|
64 | ./bin/mysql_install_db --user=root --force
|
---|
65 | ./bin/mysqld_safe --user=root --pid_file=gsdl3.pid &
|
---|
66 | sleep 2
|
---|
67 | ./bin/mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
|
---|
68 | ./bin/mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
|
---|
69 |
|
---|
70 | # set up any sample collections databases
|
---|
71 | #gs3mgdemo
|
---|
72 | ./bin/mysql --user=root --execute="create database localsite_gs3mgdemo;"
|
---|
73 | ./bin/mysql --user=root localsite_gs3mgdemo < $gsdl3home/web/sites/localsite/collect/gs3mgdemo/mysqldatadump.sql
|
---|
74 |
|
---|
75 | ./bin/mysqladmin --user=root shutdown
|
---|
76 | cd $gsdl3home
|
---|
77 |
|
---|
78 |
|
---|
79 | #compile the test servlet
|
---|
80 | source gs3-setup.sh
|
---|
81 | cd web/WEB-INF/classes
|
---|
82 | javac TestServlet.java
|
---|
83 | cd $GSDL3HOME
|
---|
84 |
|
---|
85 | # make mg and mgpp compile statically
|
---|
86 | cd packages/mg
|
---|
87 | cat ./configure.in | sed 's,LDFLAGS=,LDFLAGS=-static,' > ./configure.in.tmp
|
---|
88 | mv configure.in.tmp configure.in
|
---|
89 | autoconf configure.in > configure
|
---|
90 | cd $GSDL3HOME
|
---|
91 |
|
---|
92 | cd packages/mgpp
|
---|
93 | cat ./configure.in | sed 's,LDFLAGS=,LDFLAGS=-static,' > ./configure.in.tmp
|
---|
94 | mv configure.in.tmp configure.in
|
---|
95 | autoconf configure.in > configure
|
---|
96 | cd $GSDL3HOME
|
---|
97 |
|
---|
98 |
|
---|
99 | ./configure
|
---|
100 | make
|
---|
101 | make install
|
---|
102 | make distclean
|
---|
103 |
|
---|
104 | cd $GSDL3HOME
|
---|
105 |
|
---|
106 |
|
---|