Debian Codegraph @

install/unix/install3

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
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 " It will run in background and the output will be sent to"
113 echo " the file <$MID_HOME/tmp/install.$$>"
114 echo ""
115 echo "Do you want to continue [yn]? (y): " $SV_NONL
116 unset answ
117 if [ "$1" != "-a" ]; then
118 read answ
119 fi
120 if [ -z "$answ" ]; then
121 answ=y
122 fi
123 if [ "$answ" != "y" -a "$answ" != "Y" ]
124 then
125 echo "Bye"
126 exit 0
127 fi
128
129 #
130 # if $MID_HOME/tmp does not exist then create it
131 #
132 if [ ! -d $MID_HOME/tmp ]; then
133 mkdir $MID_HOME/tmp
134 fi
135
136 # do we have the 'time' command?
137 if [ $CMND_YES = 2 ] ; then
138 /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
139 else
140 time /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
141 fi
142
143 echo "Running install in background"
144 echo "Results are coming in $MID_HOME/tmp/install.$$"
145
146 if [ "$1" = "-a" -o "$1" = "auto" ]; then
147 echo "Waiting for MIDAS installation to finish..." $SV_NONL
148 wait
149 echo "Finished."
150 echo ""
151 fi
152 exit 0