Changeset 6293


Ignore:
Timestamp:
2003-12-17T18:07:57+13:00 (20 years ago)
Author:
mdewsnip
Message:

Many improvements to Windows scripts. Now uses some utilities (gunzip, sed, setvar and tar) to make things easier and the scripts more powerful.

Location:
trunk/gsdl3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/install.bat

    r5069 r6293  
    11@echo off
    22
    3 :: Check that %GSDL3HOME% is set
    4 if not "%GSDL3HOME%" == "" goto envOK
    5   echo "You need to run `setup.bat' before running this install file"
    6   goto end
     3:: ---- Check that %GSDL3HOME% is set ----
     4if not "%GSDL3HOME%" == "" goto start
     5    echo You need to run setup.bat before running this install file
     6    goto exit
    77
    8 :envOK
    9 
    10 :: Make sure we have the current GSDL3 - this also prunes empty directories
     8:start
     9:: ---- Make sure we have the current GSDL3 (also prunes empty directories) ----
    1110cvs update -dRP
    1211
    13 :: Check out mgpp
    14 rem cd %GSDL3HOME%\packages
    15 rem cvs co mgpp
    16 rem cd %GSDL3HOME%
     12:: ---- Check out mgpp ----
     13cd %GSDL3HOME%\packages
     14cvs co mgpp
    1715
     16:: ---- Unpack Tomcat and rename folder ----
     17echo Unpacking Tomcat...
     18cd %GSDL3HOME%\comms\jakarta
     19"%GSDL3HOME%\winutil\gunzip.exe" tomcat-4.1.24.tar.gz
     20"%GSDL3HOME%\winutil\tar.exe" xf tomcat-4.1.24.tar
     21ren jakarta-tomcat-4.1.24 tomcat
    1822
    19 :: Resolve the @gsdl3home@s in the web\WEB-INF\web.xml file
    20 echo If you haven't already done so, you need to edit the web\WEB-INF\web.xml
    21 echo   file, replacing both instances of "@gsdl3home@" with "%GSDL3HOME%".
     23:: ---- Edit the Tomcat setclasspath script to add our classpath ----
     24echo Fixing setclasspath.bat...
     25cd %GSDL3HOME%\comms\jakarta\tomcat\bin
     26ren setclasspath.bat setclasspath.bat.orig
     27"%GSDL3HOME%\winutil\sed.exe" 's,set CLASSPATH=,set CLASSPATH="%%CLASSPATH%%":,' setclasspath.bat.orig > setclasspath.bat
    2228
    23 cd %CATALINA_HOME%\bin
    24 echo sset CLASSPATH=%%JAVA_HOME%%\lib\tools.jar> setclasspath.bat.fix
    25 echo .>> setclasspath.bat.fix
    26 echo set CLASSPATH=%%CLASSPATH%%;%%JAVA_HOME%%\lib\tools.jar>> setclasspath.bat.fix
    27 echo e>> setclasspath.bat.fix
    28 edlin setclasspath.bat < setclasspath.bat.fix > nul
    29 del setclasspath.bat.fix
    30 del setclasspath.bak
     29:: ---- Unpack the sample collections ----
     30echo Unpacking sample collections...
     31cd %GSDL3HOME%\web\sites\localsite\collect
     32
     33cd chinesedemo\index
     34"%GSDL3HOME%\winutil\gunzip.exe" chinese-index-files.tar.gz
     35"%GSDL3HOME%\winutil\tar.exe" xf chinese-index-files.tar
     36cd ..\..
     37
     38cd demo\index
     39"%GSDL3HOME%\winutil\gunzip.exe" mg-indexfiles.tar.gz
     40"%GSDL3HOME%\winutil\tar.exe" xf mg-indexfiles.tar
     41cd ..\..
     42
     43cd gberg\index
     44"%GSDL3HOME%\winutil\gunzip.exe" gberg-indexfiles.tgz
     45"%GSDL3HOME%\winutil\tar.exe" xf gberg-indexfiles.tar
     46cd ..\..
     47
     48cd mgppdemo\index
     49"%GSDL3HOME%\winutil\gunzip.exe" mgpp-indexfiles.tar.gz
     50"%GSDL3HOME%\winutil\tar.exe" xf mgpp-indexfiles.tar
     51cd ..\..
     52
     53:: ---- Enter the correct paths in various files ----
     54if "%1" == "-for_distribution" goto done
     55
     56    :: ---- Set up the servlet information for Tomcat ----
     57    echo Setting up servlet information for Tomcat...
     58    cd %GSDL3HOME%\web\WEB-INF
     59    echo %GSDL3HOME%| "%GSDL3HOME%\winutil\sed.exe" 's,\\,\\\\,g' | "%GSDL3HOME%\winutil\setvar.exe" GSDL3HOME_ESCAPED >setgsdl3e.bat
     60    call setgsdl3e.bat
     61    del setgsdl3e.bat
     62    "%GSDL3HOME%\winutil\sed.exe" 's,@gsdl3home@,%GSDL3HOME_ESCAPED%,' web.xml.in > web.xml
     63    set GSDL3HOME_ESCAPED=
     64
     65:done
    3166cd %GSDL3HOME%
    3267
    33 echo.
    34 echo ----------------
    35 echo.
    36 echo Some sample collections are included with this distribution. To use these,
    37 echo you need to unpack the collection indexes.
    38 echo These are located in the index folder of each collection in
    39 echo %GSDL3HOME%\web\sites\localsite\collect\.
    40 echo.
     68:exit
  • trunk/gsdl3/setup.bat

    r4848 r6293  
    11@echo off
    22
    3 if exist setup.bat goto dirOK
    4   echo You must source the script from within the Greenstone home directory
    5   goto end
     3if exist setup.bat goto start
     4  echo This script must be run from within the Greenstone 3 home directory
     5  goto exit
    66
    7 :dirOK
    8 
    9 :: Set the GSDL3HOME variable to the current directory
    10 :: This is an unbelievably disgusting process under Windows - improvements anyone?
    11 echo e 100 "set GSDL3HOME=" > sethome.tmp
    12 echo rcx >> sethome.tmp
    13 echo e >> sethome.tmp
    14 echo n sethome.bat >> sethome.tmp
    15 echo w >> sethome.tmp
    16 echo q >> sethome.tmp
    17 debug < sethome.tmp > nul
    18 del sethome.tmp
    19 cd >> sethome.bat
    20 call sethome.bat
    21 del sethome.bat
     7:start
     8:: ---- Set the GSDL3HOME variable to the current directory ----
     9cd | winutil\setvar.exe GSDL3HOME > setgsdl3.bat
     10call setgsdl3.bat
     11del setgsdl3.bat
    2212echo GSDL3HOME: %GSDL3HOME%
    2313
    24 :: Set other important environment variables
     14:: ---- Set other important environment variables ----
    2515set GSDLOS=windows
    2616set PATH=%PATH%;%GSDL3HOME%\bin;%GSDL3HOME%\bin\script;%GSDL3HOME%\lib
     
    2919set CATALINA_OPTS="-Djava.util.prefs.syncInterval=2000000 -DGSDL3HOME=%GSDL3HOME% -DGSDLOS=%GSDLOS% -DGSDLHOME= -DPATH=%PATH%"
    3020
    31 :: Set the CLASSPATH environment variable
    32 :: This should work but doesn't: for %%j in (*.jar) do set CLASSPATH=%CLASSPATH%;%GSDL3HOME%\lib\java\%%j
     21:: ---- Set the CLASSPATH environment variable ----
    3322set CLASSPATH=%GSDL3HOME%\resources\java;%GSDL3HOME%\src\java;%CATALINA_HOME%\common\lib\servlet.jar
    3423cd %GSDL3HOME%\lib\java
     
    4029
    4130cd %GSDL3HOME%
    42 :end
     31
     32:exit
Note: See TracChangeset for help on using the changeset viewer.