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

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

rearranging into one release kit

  • 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 "$rk_name - $rk_fullname"
16 echo "Automatically creates Greenstone releases"
17 echo
18 echo "usage: $rk_name [-help|-cmd] [ANT_ARGS]"
19 echo " -help"
20 echo " show this help screen"
21 echo
22 echo " -cmd"
23 echo " show the ant command being used by $rk_name"
24 echo
25 echo " ANT_ARGS"
26 echo " Additional arguments to be passed to ant"
27}
28
29#determine requested release kit
30rk_name="$(basename $0)"
31export RK_HOME="$(cd "$(dirname "$0")/.." && pwd)"
32
33if [ "$rk_name" == "rk2" ]; then
34 rk_fullname="Release Kit for Greenstone2"
35elif [ "$rk_name" == "rk3" ]; then
36 rk_fullname="Release Kit for Greenstone3"
37else
38 echo "Unrecognised release-kit name '$rk_name'" >&2
39 exit
40fi
41
42
43#cd up a level or two if needed
44if [ -e "$rk_name-build.properties" ]; then
45 pushd .
46elif [ -e "../$rk_name-build.properties" ]; then
47 pushd ..
48elif [ -e "../../$rk_name-build.properties" ]; then
49 pushd ../..
50else
51 echo "couldn't find file $rk_name-build.properties"
52 echo "it should exist in the top level of the release"
53 exit
54fi
55
56#make sure ant has enough memory
57export ANT_OPTS=-Xmx800M
58
59#create the command
60toexec="ant -lib `pwd`/installer/classes -f $RK_HOME/$rk_name/ant-scripts/build.xml -Dbasedir=`pwd` -D$rk_name.home=$RK_HOME"
61
62#pass on the arguments
63while [ "$1" != "" ]; do
64
65 if [ "$1" == "-help" ]; then
66 show_help
67 exit
68 elif [ "$1" == "-cmd" ]; then
69 show_cmd=true
70 else
71 toexec="$toexec $1"
72 fi
73 shift
74
75done
76
77#show the command to be executed
78if [ "$show_cmd" == "true" ]; then
79 echo $toexec
80#execute
81else
82 show_title | tee ${rk_name}.out
83 $toexec 2>&1 | tee -a ${rk_name}.out
84fi
85
86#go back to original dir
87popd
Note: See TracBrowser for help on using the repository browser.