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

Last change on this file since 29393 was 29393, checked in by sjm84, 9 years ago

Related to commit 29387. Changes to allow the release-kits to preserve the source code, to better enable debugging of differences in the release-kits. Tested with GS3 on the 32 bit linux: without setting the new KEEP_SRC env var in bin/rk, it still removes the src code as before and produces a binary of the same size as before. With the KEEP_SRC env var set to true in bin/rk, src code (gs2build/common-src, gli/src and GS3/src) is preserved. Untested on Windows or with gs2 since the gs2 binary generation on linux 32 is not working at present.

  • Property svn:executable set to *
File size: 2.1 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=-Xmx1024M
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# Generally, an ant property can be true|on|yes vs false|off|no (or left unset)
49# see https://ant.apache.org/manual/properties.html#if+unless
50# However, the release-kit code requires envvar KEEP_SRC to be "true" in order to stop it deleting source code
51#KEEP_SRC=true
52if test -n $KEEP_SRC ; then
53 toexec="$toexec \"-Dkeep.src=$KEEP_SRC\""
54fi
55
56#pass on the arguments
57while [ "$1" != "" ]; do
58
59 if [ "$1" == "-help" ]; then
60 show_help
61 exit
62 elif [ "$1" == "-cmd" ]; then
63 show_cmd=true
64 else
65 toexec="$toexec \"$1\""
66 fi
67 shift
68
69done
70
71#show the command to be executed
72if [ "$show_cmd" == "true" ]; then
73 echo $toexec
74#execute
75else
76 show_title | tee ${rk_name}.out
77 $toexec 2>&1 | tee -a ${rk_name}.out
78fi
79
Note: See TracBrowser for help on using the repository browser.