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-withexamples.xml.config
|
---|
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 | cd soap\webapps\soap\WEB-INF
|
---|
59 | ren web.xml web.xml.disabled
|
---|
60 | cd %GSDL3HOME%
|
---|
61 |
|
---|
62 | :: Edit the SOAPServer config file
|
---|
63 | cd %GSDL3HOME%\resources\java
|
---|
64 | "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' SOAPServer.cfg.in > SOAPServer.cfg
|
---|
65 |
|
---|
66 | :: ---- SETUP MYSQL + SAMPLE DATABASES ----
|
---|
67 | :: Set up the SQL DB
|
---|
68 | cd %GSDL3HOME%\packages\mysql
|
---|
69 | "%GSDL3HOME%\winutil\7zip.exe" x mysql-4.0.20d-windows.zip
|
---|
70 | start bin\mysqld
|
---|
71 | bin\mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;"
|
---|
72 | bin\mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;"
|
---|
73 |
|
---|
74 | :: Set up any sample collections databases
|
---|
75 | bin\mysql --user=root --execute="create database localsite_gs3mgdemo;"
|
---|
76 | bin\mysql --user=root localsite_gs3mgdemo < %GSDL3HOME%\web\sites\localsite\collect\gs3mgdemo\mysqldatadump.sql
|
---|
77 |
|
---|
78 | bin\mysqladmin --user=root shutdown
|
---|
79 |
|
---|
80 | :: ---- WEB.XML FILE ----
|
---|
81 | cd %GSDL3HOME%\web\WEB-INF
|
---|
82 | "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' web.xml.in > web.xml
|
---|
83 |
|
---|
84 | :: ---- SITE CONFIG FILES ----
|
---|
85 | :: **** (SKIPPED) ****
|
---|
86 |
|
---|
87 | :: ---- GSDL3 SCRIPTS ----
|
---|
88 | :: We also edit the GSDL3 launching script and the SOAP deployment script
|
---|
89 | cd %GSDL3HOME%
|
---|
90 | copy gs3-launch.bat.in gs3-launch.bat
|
---|
91 | copy gs3-soap-deploy-site.bat.in gs3-soap-deploy-site.bat
|
---|
92 | :: **** (UNFINISHED) ****
|
---|
93 |
|
---|
94 | :: ---- UNPACK SAMPLE COLLECTIONS ----
|
---|
95 | cd %GSDL3HOME%\web\sites\localsite\collect
|
---|
96 |
|
---|
97 | :: Project Gutenberg
|
---|
98 | cd gberg
|
---|
99 | cd index
|
---|
100 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
101 | cd ..\..
|
---|
102 |
|
---|
103 | :: GS2 MG demo
|
---|
104 | cd gs2mgdemo
|
---|
105 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
106 | "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip
|
---|
107 | cd index
|
---|
108 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
109 | cd ..\..
|
---|
110 |
|
---|
111 | :: GS2 MGPP demo
|
---|
112 | cd gs2mgppdemo
|
---|
113 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
114 | "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip
|
---|
115 | cd index
|
---|
116 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
117 | cd ..\..
|
---|
118 |
|
---|
119 | :: GS3 MG demo
|
---|
120 | cd gs3mgdemo
|
---|
121 | "%GSDL3HOME%\winutil\7zip.exe" x import.zip
|
---|
122 | "%GSDL3HOME%\winutil\7zip.exe" x archives.zip
|
---|
123 | cd index
|
---|
124 | "%GSDL3HOME%\winutil\7zip.exe" x index.zip
|
---|
125 | cd ..\..
|
---|
126 |
|
---|
127 | :: ---- COMPILATION ----
|
---|
128 | echo Will now compile the code - this may take a while
|
---|
129 | cd %GSDL3HOME%
|
---|
130 | call gs3-compile.bat
|
---|
131 |
|
---|
132 | :: And provide a nice little postscript
|
---|
133 | echo.
|
---|
134 | echo ****************************************************************
|
---|
135 | echo Greenstone 3 - Installation Complete!
|
---|
136 | echo.
|
---|
137 | echo Run gs3-launch.bat to start the web server
|
---|
138 | echo.
|
---|
139 | echo ****************************************************************
|
---|
140 | echo.
|
---|
141 |
|
---|
142 | cd %GSDL3HOME%
|
---|
143 |
|
---|
144 | :exit
|
---|