-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.rtm
executable file
·121 lines (103 loc) · 3.13 KB
/
build.rtm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/bash
# -*- shell-script -*-
#-----------------------------------------------------------------------
# This library is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 59 Temple Place, Suite 330,
# Boston, MA 02111-1307 USA
#-----------------------------------------------------------------------
PKG_VERSION=`cat .version`
echo Making Version: $PKG_VERSION
runMe()
{
local cmdA=("$@")
local j
local jj
local i
local ignoreError
local j=0
for i in "${cmdA[@]}" ; do
ignoreError=
if [ "x${i:0:1}" = x- ]; then
i=${i:1}
ignoreError=1
fi
j=$((j+1))
jj=$(printf "%02d" $j)
echo
echo "%%---------------------------------%%"
echo " " $jj: $i
echo "%%---------------------------------%%"
echo
eval $i
if [ -z "$ignoreError" -a $? != 0 ]; then
break
fi
done
}
if [ -z "$SYSHOST" ]; then
myhost=$(hostname -f)
myhost=${myhost%.tacc.utexas.edu}
myhost=${myhost%.local}
first=${myhost%%.*}
if [ "$first" = xalt ]; then
export SYSHOST=xalt
else
export SYSHOST=${myhost#*.}
fi
fi
echo SYSHOST: $SYSHOST
readerPass="tipR3ader123@"
TipsDB=HPC_Tips
TACC_HOST=xalt-02.tacc.utexas.edu
case $SYSHOST in
mijo)
echo "Building on $SYSHOST using mijo rules"
base="$HOME/l/pkg/HPC_Tips"
CONF_OPTS="--with-host=jedrik --with-reader=readerOfTips --with-pass=$readerPass --with-db=$TipsDB --with-module=HPC_Tips"
CPPFLAGS="CPPFLAGS=-I/usr/local/include"
MAKE_OPTS="LDFLAGS=-L/usr/local/lib"
;;
jedrik)
echo "Building on $SYSHOST using jedrik rules"
base="$HOME/l/pkg/HPC_Tips"
CONF_OPTS="--with-host=localhost --with-reader=readerOfTips --with-pass=$readerPass --with-db=$TipsDB --with-module=HPC_Tips"
;;
rios)
echo "Building on $SYSHOST"
SUDO="sudo"
base="/opt/apps/HPC_Tips"
CONF_OPTS="--with-host=$TACC_HOST --with-reader=readerOfTips --with-pass=$readerPass --with-db=$TipsDB --with-module=tacc_tips"
;;
*)
echo "Building on $SYSHOST"
base="$HOME/l/pkg/HPC_Tips"
CONF_OPTS="--with-host=$TACC_HOST --with-reader=readerOfTips --with-pass=$readerPass --with-db=$TipsDB --with-module=tacc_tips --with-MySQL=no"
;;
esac
BASE_DIR=$base
pkgName=HPC_Tips
PKG=$BASE_DIR
$SUDO rm -rf $PKG/$PKG_VERSION
MAKE=make
command -v remake 2>&1 > /dev/null
if [ "$?" = 0 ]; then
MAKE=remake
fi
cmdA=("-$MAKE clobber"
"-rm -rf $PKG/$PKG_VERSION"
"$CPPFLAGS ./configure --prefix=$PKG/$PKG_VERSION $CONF_OPTS"
"$SUDO $MAKE $CPPFLAGS $MAKE_OPTS install"
"rm -f config.log"
)
runMe "${cmdA[@]}"