| 1 |
#! /bin/bash |
| 2 |
# .COPYRIGHT: Copyright (c) 2011 European Southern Observatory, |
| 3 |
# all rights reserved |
| 4 |
# .TYPE command |
| 5 |
# .NAME install3.sh |
| 6 |
# .LANGUAGE shell script |
| 7 |
# .ENVIRONMENT Unix Systems. Executable under SHELL and C-SHELL |
| 8 |
# .COMMENTS Installation procedure of the MIDAS system starting from |
| 9 |
# scratch. |
| 10 |
# Usage: install system [options] |
| 11 |
# |
| 12 |
# .AUTHOR Klaus Banse |
| 13 |
# .VERSION |
| 14 |
# 110825 creation |
| 15 |
# 190322 last modif take out continue statements, |
| 16 |
# and fix for being called from config |
| 17 |
|
| 18 |
|
| 19 |
#*************** building dummy NAG library ********************* |
| 20 |
|
| 21 |
# the install3 script is called from install1 with one parameter |
| 22 |
# par1 = manual (to use an edited make_options file), |
| 23 |
# or = -a (via autoconfig) |
| 24 |
# or no parameter at all |
| 25 |
|
| 26 |
cd $MID_HOME/system/ext |
| 27 |
make |
| 28 |
if [ $? != 0 ]; then |
| 29 |
echo "Error building esoext." |
| 30 |
exit 1 |
| 31 |
fi |
| 32 |
# |
| 33 |
cd $MID_HOME/libsrc/nag |
| 34 |
rm -f ../../lib/libnag.a |
| 35 |
|
| 36 |
make all |
| 37 |
if [ $? != 0 ]; then |
| 38 |
echo "Error creating dummy NAG library." |
| 39 |
exit 1 |
| 40 |
fi |
| 41 |
|
| 42 |
#************************************************************** |
| 43 |
|
| 44 |
|
| 45 |
cd $MID_INSTALL |
| 46 |
|
| 47 |
echo "" |
| 48 |
echo "MIDAS INSTALLATION PROCEDURE" |
| 49 |
echo "============================" |
| 50 |
echo "MIDASHOME: $MIDASHOME" |
| 51 |
echo "MIDVERS: $MIDVERS" |
| 52 |
|
| 53 |
if [ $1 = "manual" ]; then |
| 54 |
echo "Your own MAKE_OPTIONS after checks and/or editing:" |
| 55 |
else |
| 56 |
echo "Your final MAKE_OPTIONS after all checks:" |
| 57 |
fi |
| 58 |
|
| 59 |
echo "<$MID_HOME/local/make_options>" |
| 60 |
|
| 61 |
awk -F# '{if ($1 != "") {printf "\t %s\n",$1} }' $MID_HOME/local/make_options |
| 62 |
echo "" |
| 63 |
|
| 64 |
echo "Do you want to check the OS library [yn]? (y): " $SV_NONL |
| 65 |
unset answ |
| 66 |
if [ "$1" != "-a" ]; then |
| 67 |
read answ |
| 68 |
fi |
| 69 |
if [ -z "$answ" ]; then |
| 70 |
answ=y |
| 71 |
fi |
| 72 |
if [ "$answ" = "y" -o "$answ" = "Y" ] |
| 73 |
then |
| 74 |
cd $MID_HOME/libsrc/os/unix |
| 75 |
rm -f $MID_HOME/lib/libos.a |
| 76 |
make clean_exec |
| 77 |
make clean |
| 78 |
make all |
| 79 |
make testos.exe |
| 80 |
if [ $? != 0 ]; then |
| 81 |
echo "" |
| 82 |
echo " **********************************************" |
| 83 |
echo " * ATTENTION *" |
| 84 |
echo " * There was a severe error in your <oslib.a> *" |
| 85 |
echo " * that should be corrected before continuing *" |
| 86 |
echo " * with the MIDAS installation. *" |
| 87 |
echo " * *" |
| 88 |
echo " * Go to $MID_HOME/libsrc/os/unix " |
| 89 |
echo " * and type by hand: *" |
| 90 |
echo " * *" |
| 91 |
echo " * make clean_exec *" |
| 92 |
echo " * make clean *" |
| 93 |
echo " * make all *" |
| 94 |
echo " * make testos.exe *" |
| 95 |
echo " * *" |
| 96 |
echo " * The sequence above should be executed *" |
| 97 |
echo " * without any error (Warnings are tolerated) *" |
| 98 |
echo " * MIDAS installation will be aborted !! *" |
| 99 |
echo " * *" |
| 100 |
echo " * For help contact ESO's Midas support: *" |
| 101 |
echo " * [email protected] *" |
| 102 |
echo " **********************************************" |
| 103 |
echo "" |
| 104 |
$echo "Type return to exit: " $SV_NONL |
| 105 |
read return |
| 106 |
exit 1 |
| 107 |
fi |
| 108 |
fi |
| 109 |
|
| 110 |
echo "" |
| 111 |
echo "WARNING: MIDAS installation will delete all dependent files." |
| 112 |
echo "" |
| 113 |
echo "Do you want to continue [yn]? (y): " $SV_NONL |
| 114 |
unset answ |
| 115 |
if [ "$1" != "-a" ]; then |
| 116 |
read answ |
| 117 |
fi |
| 118 |
if [ -z "$answ" ]; then |
| 119 |
answ=y |
| 120 |
fi |
| 121 |
if [ "$answ" != "y" -a "$answ" != "Y" ] |
| 122 |
then |
| 123 |
echo "Bye" |
| 124 |
exit 0 |
| 125 |
fi |
| 126 |
|
| 127 |
# |
| 128 |
# if $MID_HOME/tmp does not exist then create it |
| 129 |
# |
| 130 |
if [ ! -d $MID_HOME/tmp ]; then |
| 131 |
mkdir $MID_HOME/tmp |
| 132 |
fi |
| 133 |
|
| 134 |
# do we have the 'time' command? |
| 135 |
if [ $CMND_YES = 2 ] ; then |
| •136 |
/bin/bash $MID_INSTALL/install -i |
| 137 |
else |
| •138 |
time /bin/bash $MID_INSTALL/install -i |
| 139 |
fi |
| 140 |
|
| 141 |
exit 0 |