This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
forked from pragmagrid/lifemapper-compute
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-prep-rpm-roll.sh
101 lines (85 loc) · 2.32 KB
/
make-prep-rpm-roll.sh
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
# Purpose: make all lifemapper-compute roll rpms
#
# This script is run by a superuser
usage ()
{
echo "Usage: bash $0
echo "This script is run by the superuser. It will make all rpms for the"
echo "lifemapper-compute roll."
echo " "
echo "The output of the script is in `/bin/basename $0`.log"
}
### define varibles
SetDefaults () {
# directory
BASEDIR=/state/partition1/workspace/lifemapper-compute
LMGDAL_COUNT=`rpm -qa | grep lifemapper-gdal | wc -l`
if [ $LMGDAL_COUNT = 0 ]; then
echo "Error: $BASEDIR/bootstrap has not been executed" | tee -a $LOG
exit 1
fi
# Logfile
LOG=$BASEDIR/`/bin/basename $0`.log
rm -f $LOG
touch $LOG
}
### build entire roll
MakeProfile () {
echo "*************************" | tee -a $LOG
echo "Making the profile ... " | tee -a $LOG
echo "*************************" | tee -a $LOG
cd $BASEDIR
make profile 2>&1 | tee -a $LOG
}
TimeStamp () {
echo $1 `/bin/date` >> $LOG
}
### make ready-to-bake rpms
MakeSimpleRpms () {
declare -a easyrpms=("cctools" "gdal" "geos"
"openmodeller" "proj" "pyparsing" "requests"
"rocks-lmcompute" "scipy" "tiff" "usersguide")
for i in "${easyrpms[@]}"
do
echo " " | tee -a $LOG
echo "*************************" | tee -a $LOG
echo "Packaging $i..." | tee -a $LOG
echo "*************************" | tee -a $LOG
cd $BASEDIR/src/"$i"
make rpm 2>&1 | tee -a $LOG
done
}
### make rpms that need data prep
MakePreppedRpms () {
declare -a preprpms=("lmdata-env" "lmcompute")
for i in "${preprpms[@]}"
do
echo " " | tee -a $LOG
echo "*************************" | tee -a $LOG
echo "Packaging $i..." | tee -a $LOG
echo "*************************" | tee -a $LOG
cd $BASEDIR/src/"$i"
make prep 2>&1 | tee -a $LOG
make rpm 2>&1 | tee -a $LOG
done
}
### build entire roll
BuildRoll () {
echo "*************************" | tee -a $LOG
echo "Building the roll ... " | tee -a $LOG
echo "*************************" | tee -a $LOG
cd $BASEDIR
make roll 2>&1 | tee -a $LOG
}
### Main ###
if [ $# -ne 0 ]; then
usage
exit 0
fi
SetDefaults
TimeStamp "# Start"
MakeProfile
MakeSimpleRpms
MakePreppedRpms
BuildRoll
TimeStamp "# End"