~ubuntu-branches/debian/sid/eso-midas/sid

« back to all changes in this revision

Viewing changes to .pc/output-to-stdout.patch/install/unix/install3

  • Committer: Package Import Robot
  • Author(s): Ole Streicher
  • Date: 2014-04-22 14:44:58 UTC
  • Revision ID: package-import@ubuntu.com-20140422144458-sl34juxohmn4aty4
Tags: 13.09pl1.2+dfsg-1
Initial release. (Closes: #740702)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
# 111206        last modif
 
16
 
 
17
 
 
18
#*************** building dummy NAG library *********************
 
19
 
 
20
# the install3 script is called from install1 with one parameter
 
21
# par1   = manual (to use an edited make_options file),
 
22
# or     = -a (via  autoconfig)
 
23
# or no parameter at all
 
24
 
 
25
cd $MID_HOME/system/ext
 
26
make 
 
27
if [ $? !=  0 ]; then
 
28
   echo "Error building esoext."
 
29
   exit 1
 
30
fi
 
31
#
 
32
cd $MID_HOME/libsrc/nag
 
33
rm -f ../../lib/libnag.a
 
34
 
 
35
make all
 
36
if [ $? !=  0 ]; then
 
37
   echo "Error creating dummy NAG library."
 
38
   exit 1
 
39
else
 
40
   continue
 
41
fi
 
42
 
 
43
#**************************************************************
 
44
 
 
45
 
 
46
cd $MID_INSTALL
 
47
 
 
48
echo ""
 
49
echo "MIDAS INSTALLATION PROCEDURE"
 
50
echo "============================"
 
51
echo "MIDASHOME: $MIDASHOME"
 
52
echo "MIDVERS:   $MIDVERS"
 
53
 
 
54
if [ $1 = "manual" ]; then
 
55
   echo "Your own MAKE_OPTIONS after checks and/or editing:"
 
56
else
 
57
   echo "Your final MAKE_OPTIONS after all checks:"
 
58
fi
 
59
 
 
60
echo "<$MID_HOME/local/make_options>"
 
61
 
 
62
awk -F# '{if ($1 != "") {printf "\t  %s\n",$1} }' $MID_HOME/local/make_options
 
63
echo ""
 
64
 
 
65
echo "Do you want to check the OS library [yn]? (y): " $SV_NONL
 
66
unset answ
 
67
if [ "$1" != "-a" ]; then    
 
68
  read answ
 
69
fi
 
70
if [ -z "$answ" ]; then
 
71
    answ=y
 
72
fi
 
73
if [ "$answ" != "y" -a "$answ" != "Y" ]
 
74
then
 
75
    continue
 
76
else
 
77
    cd $MID_HOME/libsrc/os/unix
 
78
    rm -f $MID_HOME/lib/libos.a
 
79
    make clean_exec
 
80
    make clean
 
81
    make all
 
82
    make testos.exe
 
83
    if [ $? != 0 ]; then
 
84
        echo ""
 
85
        echo " **********************************************"
 
86
        echo " *               ATTENTION                    *"
 
87
        echo " * There was a severe error in your <oslib.a> *"
 
88
        echo " * that should be corrected before continuing *"
 
89
        echo " * with the MIDAS installation.               *"
 
90
        echo " *                                            *"
 
91
        echo " * Go to $MID_HOME/libsrc/os/unix "
 
92
        echo " * and type by hand:                          *"
 
93
        echo " *                                            *"
 
94
        echo " *     make clean_exec                        *"
 
95
        echo " *     make clean                             *"
 
96
        echo " *     make all                               *"
 
97
        echo " *     make testos.exe                        *"
 
98
        echo " *                                            *"
 
99
        echo " * The sequence above should be executed      *"
 
100
        echo " * without any error (Warnings are tolerated) *"
 
101
        echo " * MIDAS installation will be aborted !!      *"
 
102
        echo " *                                            *"
 
103
        echo " * For help contact ESO's Midas support:      *"
 
104
        echo " * midas@eso.org                              *"
 
105
        echo " **********************************************"
 
106
        echo ""
 
107
        $echo "Type return to exit: " $SV_NONL
 
108
        read return
 
109
        exit 1
 
110
    fi
 
111
fi
 
112
 
 
113
echo ""
 
114
echo "WARNING: MIDAS installation will delete all dependent files."
 
115
echo "         It will run in background and the output will be sent to"
 
116
echo "         the file <$MID_HOME/tmp/install.$$>"
 
117
echo ""
 
118
echo "Do you want to continue [yn]? (y): " $SV_NONL
 
119
unset answ
 
120
if [ "$1" != "-a" ]; then 
 
121
  read answ
 
122
fi
 
123
if [ -z "$answ" ]; then
 
124
    answ=y
 
125
fi
 
126
if [ "$answ" != "y" -a "$answ" != "Y" ]
 
127
then
 
128
    echo "Bye"
 
129
    exit 0
 
130
fi
 
131
 
 
132
#
 
133
# if $MID_HOME/tmp does not exist then create it
 
134
#
 
135
if [ ! -d $MID_HOME/tmp ]; then
 
136
    mkdir $MID_HOME/tmp
 
137
fi
 
138
 
 
139
# do we have the 'time' command?
 
140
if [ $CMND_YES = 2 ] ; then
 
141
   /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
 
142
else
 
143
   time /bin/bash $MID_INSTALL/install -i > $MID_HOME/tmp/install.$$ 2>&1 &
 
144
fi
 
145
 
 
146
echo "Running install in background"
 
147
echo "Results are coming in $MID_HOME/tmp/install.$$"
 
148
if [ "$1" = "-a" ]; then 
 
149
  echo "Waiting for MIDAS installation to finish..."  $SV_NONL
 
150
  wait
 
151
  echo "Finished."
 
152
  echo ""
 
153
fi
 
154
exit 0