@echo off if exist gs3-setup.bat goto begin echo You must run this script from within the Greenstone 3 home directory goto exit :begin call gs3-setup.bat echo %GSDL3HOME%| "%GSDL3HOME%\winutil\sed.exe" 's,\\,\\\\,g' | "%GSDL3HOME%\winutil\setvar.exe" GSDL3HOME_ESCAPED >setgsdl3e.bat call setgsdl3e.bat del setgsdl3e.bat :: ---- CHECK NECESSARY BITS ---- if not "%CVSROOT%" == "" goto start echo You need to set the environment variable CVSROOT before running echo this script. Please use the same path that you used to check out echo the Greenstone repository. If you are not using anonymous cvs, you echo also need to set the variable CVS_RSH to ssh. goto exit :start :: ---- GET INFO FROM USER ---- :: **** (SKIPPED) **** :: ---- CHECKOUT ALL THE BITS FROM CVS ---- cvs update -dRP cd %GSDL3HOME%\packages cvs checkout -P mgpp cd %GSDL3HOME% :: ---- SETUP TOMCAT ---- cd %GSDL3HOME%\comms\jakarta "%GSDL3HOME%\winutil\7zip.exe" x jakarta-tomcat-4.1.30.zip ren jakarta-tomcat-4.1.30 tomcat :: Edit the Tomcat setclasspath script to add our classpath cd %GSDL3HOME%\comms\jakarta\tomcat\bin ren setclasspath.bat setclasspath.bat.orig "%GSDL3HOME%\winutil\sed.exe" 's,set CLASSPATH=,set CLASSPATH=%%CLASSPATH%%;,' setclasspath.bat.orig > setclasspath.bat :: Copy the modified server.xml into tomcat cd %GSDL3HOME%\comms\jakarta copy tomcat\conf\server.xml tomcat\conf\server-withexamples.xml.config "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' server.xml.in > tomcat\conf\server.xml :: Edit the server.xml config file to set the port number :: **** (SKIPPED) **** :: ---- SETUP SOAP ---- cd %GSDL3HOME%\comms\soap "%GSDL3HOME%\winutil\7zip.exe" x soap-bin-2.3.1.zip ren soap-2_3_1 soap copy soap\lib\soap.jar %GSDL3HOME%\lib\java copy DeployedServices.ds soap\webapps\soap :: Disable soap by renaming the web.xml file cd soap\webapps\soap\WEB-INF ren web.xml web.xml.disabled cd %GSDL3HOME% :: Edit the SOAPServer config file cd %GSDL3HOME%\resources\java "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' SOAPServer.cfg.in > SOAPServer.cfg :: ---- SETUP MYSQL + SAMPLE DATABASES ---- :: Set up the SQL DB cd %GSDL3HOME%\packages\mysql "%GSDL3HOME%\winutil\7zip.exe" x mysql-4.0.20d-windows.zip start bin\mysqld bin\mysql --user=root --execute="GRANT SELECT,INSERT,DELETE,UPDATE,DROP,CREATE ON *.* TO gsdl3admin@localhost;" bin\mysql --user=root --execute="GRANT SELECT ON *.* TO gsdl3reader@localhost;" :: Set up any sample collections databases bin\mysql --user=root --execute="create database localsite_gs3mgdemo;" bin\mysql --user=root localsite_gs3mgdemo < %GSDL3HOME%\web\sites\localsite\collect\gs3mgdemo\mysqldatadump.sql bin\mysqladmin --user=root shutdown :: ---- WEB.XML FILE ---- cd %GSDL3HOME%\web\WEB-INF "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' web.xml.in > web.xml :: ---- SITE CONFIG FILES ---- :: **** (SKIPPED) **** :: ---- GSDL3 SCRIPTS ---- :: We also edit the GSDL3 launching script and the SOAP deployment script cd %GSDL3HOME% copy gs3-launch.bat.in gs3-launch.bat copy gs3-soap-deploy-site.bat.in gs3-soap-deploy-site.bat :: **** (UNFINISHED) **** :: ---- UNPACK SAMPLE COLLECTIONS ---- cd %GSDL3HOME%\web\sites\localsite\collect :: Project Gutenberg cd gberg cd index "%GSDL3HOME%\winutil\7zip.exe" x index.zip cd ..\.. :: GS2 MG demo cd gs2mgdemo "%GSDL3HOME%\winutil\7zip.exe" x import.zip "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip cd index "%GSDL3HOME%\winutil\7zip.exe" x index.zip cd ..\.. :: GS2 MGPP demo cd gs2mgppdemo "%GSDL3HOME%\winutil\7zip.exe" x import.zip "%GSDL3HOME%\winutil\7zip.exe" x metadata.zip cd index "%GSDL3HOME%\winutil\7zip.exe" x index.zip cd ..\.. :: GS3 MG demo cd gs3mgdemo "%GSDL3HOME%\winutil\7zip.exe" x import.zip "%GSDL3HOME%\winutil\7zip.exe" x archives.zip cd index "%GSDL3HOME%\winutil\7zip.exe" x index.zip cd ..\.. :: ---- COMPILATION ---- echo Will now compile the code - this may take a while cd %GSDL3HOME% call gs3-compile.bat :: And provide a nice little postscript echo. echo **************************************************************** echo Greenstone 3 - Installation Complete! echo. echo Run gs3-launch.bat to start the web server echo. echo **************************************************************** echo. cd %GSDL3HOME% :exit