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

Last change on this file since 21652 was 21652, checked in by oranfry, 12 years ago

got properties target working for all kits, plus some fixes

  • 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"
29elif [ "$rk_name" == "sork2" ]; then
30 rk_fullname="Source Code Release Kit for Greenstone2"
31elif [ "$rk_name" == "sork3" ]; then
32 rk_fullname="Source Code Release Kit for Greenstone3"
33elif [ "$rk_name" == "cdrk2" ]; then
34 rk_fullname="CD-ROM Release Kit for Greenstone2"
35elif [ "$rk_name" == "derk" ]; then
36 rk_fullname="Documented Examples Release Kit"
37else
38 show_help
39 exit
40fi
41
42#make sure ant has enough memory
43export ANT_OPTS=-Xmx800M
44
45#create the command
46toexec="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\""
47
48#pass on the arguments
49while [ "$1" != "" ]; do
50
51 if [ "$1" == "-help" ]; then
52 show_help
53 exit
54 elif [ "$1" == "-cmd" ]; then
55 show_cmd=true
56 else
57 toexec="$toexec \"$1\""
58 fi
59 shift
60
61done
62
63#show the command to be executed
64if [ "$show_cmd" == "true" ]; then
65 echo $toexec
66#execute
67else
68 show_title | tee ${rk_name}.out
69 $toexec 2>&1 | tee -a ${rk_name}.out
70fi
71
Note: See TracBrowser for help on using the repository browser.