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

Last change on this file since 21622 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
Line 
1#!/bin/bash
2
3function show_title() {
4 echo "RK_HOME: $RK_HOME"
5 echo "O---------------------------------------------O"
6 echo
7 echo " $rk_name ";
8 echo " $rk_fullname ";
9 echo
10 echo "O---------------------------------------------O"
11
12}
13
14function show_help {
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"
19}
20
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
30 show_help
31 exit
32fi
33
34
35#cd up a level or two if needed
36if [ -e "$rk_name-build.properties" ]; then
37 pushd . &>/dev/null
38elif [ -e "../$rk_name-build.properties" ]; then
39 pushd .. &>/dev/null
40elif [ -e "../../$rk_name-build.properties" ]; then
41 pushd ../.. &>/dev/null
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
46fi
47
48#make sure ant has enough memory
49export ANT_OPTS=-Xmx800M
50
51#create the command
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\""
53
54#pass on the arguments
55while [ "$1" != "" ]; do
56
57 if [ "$1" == "-help" ]; then
58 show_help
59 exit
60 elif [ "$1" == "-cmd" ]; then
61 show_cmd=true
62 else
63 toexec="$toexec \"$1\""
64 fi
65 shift
66
67done
68
69#show the command to be executed
70if [ "$show_cmd" == "true" ]; then
71 echo $toexec
72#execute
73else
74 show_title | tee ${rk_name}.out
75 $toexec 2>&1 | tee -a ${rk_name}.out
76fi
77
78#go back to original dir
79popd &>/dev/null
Note: See TracBrowser for help on using the repository browser.