source: main/trunk/release-kits/bin/rk@ 21417

Last change on this file since 21417 was 21394, checked in by oranfry, 14 years ago

moving specific stuff out of general area

  • Property svn:executable set to *
File size: 1.8 KB
RevLine 
[18904]1#!/bin/bash
[21362]2
[18904]3function show_title() {
[21386]4 echo "RK_HOME: $RK_HOME"
[19006]5 echo "O---------------------------------------------O"
6 echo
7 echo " $rk_name ";
8 echo " $rk_fullname ";
9 echo
10 echo "O---------------------------------------------O"
11
[18904]12}
13
[16540]14function show_help {
[21394]15 echo "usage: {rk2|rk3|sork2|sork2|cdrk2|derk} [-help|-cmd] [ANT_ARGS]"
16 echo " -help show this help screen"
17 echo " -cmd show the ant command being used by the releas kit"
18 echo " ANT_ARGS additional arguments to be passed to ant"
[16540]19}
20
[21386]21#determine requested release kit
22rk_name="$(basename $0)"
23export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)"
24
25if [ "$rk_name" == "rk2" ]; then
26 rk_fullname="Release Kit for Greenstone2"
27elif [ "$rk_name" == "rk3" ]; then
28 rk_fullname="Release Kit for Greenstone3"
29else
[21394]30 show_help
[21386]31 exit
32fi
33
34
[17633]35#cd up a level or two if needed
[21386]36if [ -e "$rk_name-build.properties" ]; then
[21394]37 pushd . &>/dev/null
[21386]38elif [ -e "../$rk_name-build.properties" ]; then
[21394]39 pushd .. &>/dev/null
[21386]40elif [ -e "../../$rk_name-build.properties" ]; then
[21394]41 pushd ../.. &>/dev/null
[21386]42else
43 echo "couldn't find file $rk_name-build.properties"
44 echo "it should exist in the top level of the release"
45 exit
[17633]46fi
47
[21386]48#make sure ant has enough memory
[17401]49export ANT_OPTS=-Xmx800M
[16732]50
[16540]51#create the command
[21394]52toexec="ant -lib \"`pwd`/installer/classes\" -f \"$RK_HOME/kits/$rk_name/ant-scripts/build.xml\" \"-Dbasedir=`pwd`\" \"-Drk.home=$RK_HOME\" \"-Drk.name=$rk_name\""
[16540]53
54#pass on the arguments
55while [ "$1" != "" ]; do
56
57 if [ "$1" == "-help" ]; then
58 show_help
59 exit
[18904]60 elif [ "$1" == "-cmd" ]; then
61 show_cmd=true
[16540]62 else
[21394]63 toexec="$toexec \"$1\""
[16540]64 fi
[16802]65 shift
[16540]66
67done
[16802]68
[21386]69#show the command to be executed
[18904]70if [ "$show_cmd" == "true" ]; then
71 echo $toexec
[21386]72#execute
[18904]73else
74 show_title | tee ${rk_name}.out
75 $toexec 2>&1 | tee -a ${rk_name}.out
76fi
77
[21386]78#go back to original dir
[21394]79popd &>/dev/null
Note: See TracBrowser for help on using the repository browser.