1 | @echo off
|
---|
2 |
|
---|
3 | if exist gs3-setup.bat goto begin
|
---|
4 | echo You must run this script from within the Greenstone 3 home directory
|
---|
5 | goto exit
|
---|
6 |
|
---|
7 | :begin
|
---|
8 | call gs3-setup.bat
|
---|
9 |
|
---|
10 | echo %GSDL3HOME%| "%GSDL3HOME%\winutil\sed.exe" 's,\\,\\\\,g' | "%GSDL3HOME%\winutil\setvar.exe" GSDL3HOME_ESCAPED >setgsdl3e.bat
|
---|
11 | call setgsdl3e.bat
|
---|
12 | del setgsdl3e.bat
|
---|
13 |
|
---|
14 | :: ---- CHECK NECESSARY BITS ----
|
---|
15 | if not "%CVSROOT%" == "" goto start
|
---|
16 | echo You need to set the environment variable CVSROOT before running
|
---|
17 | echo this script. Please use the same path that you used to check out
|
---|
18 | echo the Greenstone repository. If you are not using anonymous cvs, you
|
---|
19 | echo also need to set the variable CVS_RSH to ssh.
|
---|
20 | goto exit
|
---|
21 |
|
---|
22 | :start
|
---|
23 | :: ---- GET INFO FROM USER ----
|
---|
24 | :: **** (SKIPPED) ****
|
---|
25 |
|
---|
26 | :: ---- CHECKOUT ALL THE BITS FROM CVS ----
|
---|
27 | cvs update -dRP
|
---|
28 | cd %GSDL3HOME%\packages
|
---|
29 | cvs checkout -P mgpp
|
---|
30 | cd %GSDL3HOME%
|
---|
31 |
|
---|
32 | :: ---- SETUP TOMCAT ----
|
---|
33 | cd %GSDL3HOME%\comms\jakarta
|
---|
34 | "%GSDL3HOME%\winutil\7zip.exe" x jakarta-tomcat-4.1.30.zip
|
---|
35 | ren jakarta-tomcat-4.1.30 tomcat
|
---|
36 |
|
---|
37 | :: Edit the Tomcat setclasspath script to add our classpath
|
---|
38 | cd %GSDL3HOME%\comms\jakarta\tomcat\bin
|
---|
39 | ren setclasspath.bat setclasspath.bat.orig
|
---|
40 | "%GSDL3HOME%\winutil\sed.exe" 's,set CLASSPATH=,set CLASSPATH=%%CLASSPATH%%;,' setclasspath.bat.orig > setclasspath.bat
|
---|
41 |
|
---|
42 | :: Copy the modified server.xml into tomcat
|
---|
43 | cd %GSDL3HOME%\comms\jakarta
|
---|
44 | copy tomcat\conf\server.xml tomcat\conf\server.xml.bak
|
---|
45 | "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' server.xml.in > tomcat\conf\server.xml
|
---|
46 |
|
---|
47 | :: Edit the server.xml config file to set the port number
|
---|
48 | :: **** (SKIPPED) ****
|
---|
49 |
|
---|
50 | :: ---- SETUP SOAP ----
|
---|
51 | cd %GSDL3HOME%\comms\soap
|
---|
52 | "%GSDL3HOME%\winutil\7zip.exe" x soap-bin-2.3.1.zip
|
---|
53 | ren soap-2_3_1 soap
|
---|
54 | copy soap\lib\soap.jar %GSDL3HOME%\lib\java
|
---|
55 | copy DeployedServices.ds soap\webapps\soap
|
---|
56 |
|
---|
57 | :: Disable soap by renaming the web.xml file
|
---|
58 | ren soap\webapps\soap\WEB-INF\web.xml soap\webapps\soap\WEB-INF\web.xml.disabled
|
---|
59 | cd %GSDL3HOME%
|
---|
60 |
|
---|
61 | :: Edit the SOAPServer config file
|
---|
62 | cd %GSDL3HOME%\resources\java
|
---|
63 | "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' SOAPServer.cfg.in > SOAPServer.cfg
|
---|
64 |
|
---|
65 | :: ---- WEB.XML FILE ----
|
---|
66 | cd %GSDL3HOME%\web\WEB-INF
|
---|
67 | "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' web.xml.in > web.xml
|
---|
68 |
|
---|
69 | :: ---- SITE CONFIG FILES ----
|
---|
70 | :: **** (SKIPPED) ****
|
---|
71 |
|
---|
72 | :: ---- GSDL3 SCRIPTS ----
|
---|
73 | :: **** (SKIPPED) ****
|
---|
74 |
|
---|
75 | :: ---- UNPACK SAMPLE COLLECTIONS ----
|
---|
76 | cd %GSDL3HOME%\web\sites\localsite\collect
|
---|
77 |
|
---|
78 | :: Project Gutenberg
|
---|
79 | cd gberg
|
---|
80 | cd index
|
---|
81 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
82 | cd ..\..
|
---|
83 |
|
---|
84 | :: GS2 MG demo
|
---|
85 | cd gs2mgdemo
|
---|
86 | cd import
|
---|
87 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
88 | cd ..
|
---|
89 | cd index
|
---|
90 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
91 | cd ..
|
---|
92 | cd metadata
|
---|
93 | "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip
|
---|
94 | cd ..\..
|
---|
95 |
|
---|
96 | :: GS2 MGPP demo
|
---|
97 | cd gs2mgppdemo
|
---|
98 | cd import
|
---|
99 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
100 | cd ..
|
---|
101 | cd index
|
---|
102 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
103 | cd ..
|
---|
104 | cd metadata
|
---|
105 | "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip
|
---|
106 | cd ..\..
|
---|
107 |
|
---|
108 | :: GS3 MG demo
|
---|
109 | cd gs3mgdemo
|
---|
110 | cd archives
|
---|
111 | "%GSDL3HOME%\winutil\7zip.exe" x archives.zip
|
---|
112 | cd ..
|
---|
113 | cd import
|
---|
114 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
115 | cd ..
|
---|
116 | cd index
|
---|
117 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
118 | cd ..\..
|
---|
119 |
|
---|
120 | :: ---- COMPILATION ----
|
---|
121 | echo Will now configure and make the code - this may take a while
|
---|
122 |
|
---|
123 | :: Make MG and MGPP jar files, and install them
|
---|
124 | cd %GSDL3HOME%\packages\mg
|
---|
125 | call winMake compile javaonly
|
---|
126 | call winMake install javaonly
|
---|
127 |
|
---|
128 | cd %GSDL3HOME%\packages\mgpp
|
---|
129 | call winMake compile javaonly
|
---|
130 | call winMake install javaonly
|
---|
131 |
|
---|
132 | cd %GSDL3HOME%
|
---|
133 | call gs3-setup.bat
|
---|
134 | call make.bat
|
---|
135 | call make.bat install
|
---|
136 |
|
---|
137 | :: ---- COPY JAR FILES ----
|
---|
138 | :: Any jar files used by applets need to go into the web\lib directory
|
---|
139 | cd %GSDL3HOME%
|
---|
140 | copy lib\java\phind.jar web\lib
|
---|
141 | copy lib\java\xml-apis.jar web\lib
|
---|
142 | copy lib\java\xercesImpl.jar web\lib
|
---|
143 |
|
---|
144 | :: ---- SETUP MYSQL + SAMPLE DATABASES ----
|
---|
145 | :: Set up the SQL DB
|
---|
146 | cd %GSDL3HOME%\packages\mysql
|
---|
147 | "%GSDL3HOME%\winutil\7zip.exe" x mysql-4.0.20d-windows.zip
|
---|
148 | start bin\mysqld
|
---|
149 | bin\mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
|
---|
150 | bin\mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
|
---|
151 |
|
---|
152 | :: Set up any sample collections databases
|
---|
153 | bin\mysql --user=root --execute="create database localsite_gs3mgdemo;"
|
---|
154 | bin\mysql --user=root localsite_gs3mgdemo < %GSDL3HOME%\web\sites\localsite\collect\gs3mgdemo\mysqldatadump.sql
|
---|
155 |
|
---|
156 | bin\mysqladmin --user=root shutdown
|
---|
157 |
|
---|
158 | :: And provide a nice little postscript
|
---|
159 | echo.
|
---|
160 | echo ****************************************************************
|
---|
161 | echo Greenstone 3 - Installation Complete!
|
---|
162 | echo.
|
---|
163 | echo Run gs3-launch.bat to start the web server
|
---|
164 | echo.
|
---|
165 | echo ****************************************************************
|
---|
166 | echo.
|
---|
167 |
|
---|
168 | cd %GSDL3HOME%
|
---|
169 |
|
---|
170 | :exit
|
---|