~ubuntu-branches/debian/lenny/fpc/lenny

« back to all changes in this revision

Viewing changes to install/sunos/install.sh

  • Committer: Bazaar Package Importer
  • Author(s): Mazen Neifer, Torsten Werner, Mazen Neifer
  • Date: 2008-05-17 17:12:11 UTC
  • mfrom: (3.1.9 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080517171211-9qi33xhd9evfa0kg
Tags: 2.2.0-dfsg1-9
[ Torsten Werner ]
* Add Mazen Neifer to Uploaders field.

[ Mazen Neifer ]
* Moved FPC sources into a version dependent directory from /usr/share/fpcsrc
  to /usr/share/fpcsrc/${FPCVERSION}. This allow installing more than on FPC
  release.
* Fixed far call issue in compiler preventing building huge binearies.
  (closes: #477743)
* Updated building dependencies, recomennded and suggested packages.
* Moved fppkg to fp-utils as it is just a helper tool and is not required by
  compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# Free Pascal installation script for Solaris
 
4
# Copyright 1996-2002 Michael Van Canneyt and Peter Vreman
 
5
#
 
6
# Don't edit this file. 
 
7
# Everything can be set when the script is run.
 
8
#
 
9
 
 
10
# Release Version
 
11
VERSION=1.0.8
 
12
 
 
13
# some useful functions
 
14
# ask displays 1st parameter, and ask new value for variable, whose name is
 
15
# in the second parameter.
 
16
ask ()
 
17
{
 
18
askvar=$2
 
19
eval old=\$$askvar
 
20
eval echo -n \""$1 [$old] : "\" 
 
21
read $askvar
 
22
eval test -z \"\$$askvar\" && eval $askvar=\'$old\'
 
23
}
 
24
# yesno gives 1 on no, 0 on yes $1 gives text to display.
 
25
yesno ()
 
26
{
 
27
  while true; do
 
28
  echo -n "$1 (Y/n) ? "
 
29
  read ans
 
30
  case X$ans in
 
31
   X|Xy|XY) return 0;;
 
32
   Xn|XN) return 1;;
 
33
  esac
 
34
  done
 
35
}
 
36
 
 
37
# Untar files ($3,optional) from  file ($1) to the given directory ($2)
 
38
unztar ()
 
39
{
 
40
 ./gzip -d $HERE/$1.tar.gz
 
41
 ./gtar -xvf $HERE/$1.tar --directory $2 $3
 
42
}
 
43
 
 
44
# Make all the necessary directories to get $1
 
45
makedirhierarch ()
 
46
{
 
47
  OLDDIR=`pwd`
 
48
  case $1 in
 
49
    /*) cd /;;
 
50
  esac
 
51
  OLDIFS=$IFS;IFS=/;eval set $1; IFS=$OLDIFS
 
52
  for i
 
53
  do
 
54
    test -d $i || mkdir $i || break
 
55
    cd $i ||break
 
56
  done
 
57
  cd $OLDDIR
 
58
}
 
59
 
 
60
# check to see if something is in the path
 
61
checkpath ()
 
62
{
 
63
 ARG=$1
 
64
 OLDIFS=$IFS; IFS=":";eval set $PATH;IFS=$OLDIFS
 
65
 for i
 
66
 do
 
67
   if [ $i = $ARG ]; then
 
68
     return 0
 
69
   fi
 
70
 done 
 
71
 return 1
 
72
}
 
73
 
 
74
# --------------------------------------------------------------------------
 
75
# welcome message.
 
76
#
 
77
 
 
78
clear
 
79
echo "This shell script will attempt to install the Free Pascal Compiler"
 
80
echo "version $VERSION with the items you select"
 
81
echo 
 
82
 
 
83
# Here we start the thing.
 
84
HERE=`pwd`
 
85
 
 
86
# Install in /usr/local or /usr ?
 
87
if checkpath /usr/local/bin; then
 
88
    PREFIX=/usr/local
 
89
else
 
90
    PREFIX=/usr
 
91
fi
 
92
ask "Install prefix (/usr or /usr/local) " PREFIX
 
93
makedirhierarch $PREFIX
 
94
 
 
95
# Set some defaults.
 
96
LIBDIR=$PREFIX/lib/fpc
 
97
SRCDIR=$PREFIX/src/fpc
 
98
DOCDIR=$PREFIX/doc/fpc
 
99
DEMODIR=$DOCDIR/examples
 
100
EXECDIR=$PREFIX/bin
 
101
 
 
102
# Install compiler/RTL. Mandatory.
 
103
echo Unpacking ...
 
104
tar xf binary.tar
 
105
echo Installing compiler and RTL ...
 
106
unztar basesun $PREFIX
 
107
rm -f $EXECDIR/ppc386
 
108
ln -sf $LIBDIR/$VERSION/ppc386 $EXECDIR/ppc386
 
109
echo Installing GNU Assembler and Linker Mandatory.
 
110
unztar asldsun $PREFIX
 
111
echo Installing utilities...
 
112
unztar utilsun $PREFIX
 
113
if yesno "Install GNU Tools"; then
 
114
    unztar makesun $PREFIX
 
115
fi
 
116
if yesno "Install FCL"; then
 
117
    unztar ufclsun $PREFIX
 
118
fi
 
119
if yesno "Install Regular expression Package"; then
 
120
    unztar uregexprsun $PREFIX
 
121
fi
 
122
if yesno "Install paszlib Package"; then
 
123
    unztar upaszlibsun $PREFIX
 
124
fi
 
125
rm -f *sun.tar.gz
 
126
echo Done.
 
127
echo
 
128
 
 
129
# Install the sources. Optional.
 
130
if yesno "Install sources"; then
 
131
  echo Unpacking ...
 
132
  tar xf sources.tar
 
133
  echo Installing sources in $SRCDIR ...
 
134
  unztar basesrc $PREFIX      
 
135
  if yesno "Install compiler source"; then
 
136
    unztar compilersrc $PREFIX
 
137
  fi    
 
138
  if yesno "Install RTL source"; then
 
139
    unztar rtlsrc $PREFIX
 
140
  fi    
 
141
  if yesno "Install FCL source"; then
 
142
    unztar fclsrc $PREFIX
 
143
  fi    
 
144
  if yesno "Install paszlib source"; then
 
145
    unztar upaszlibsrc $PREFIX
 
146
  fi    
 
147
  if yesno "Install regexpr source"; then
 
148
    unztar uregexprsrc $PREFIX
 
149
  fi   
 
150
  if yesno "Install Utils source"; then
 
151
    unztar utilssrc $PREFIX
 
152
  fi
 
153
  rm -f *src.tar.gz
 
154
  echo Done.
 
155
fi
 
156
echo
 
157
 
 
158
# Install the documentation. Optional.
 
159
if yesno "Install documentation"; then
 
160
  echo Installing documentation in $DOCDIR ...
 
161
  unztar fpcdoc $PREFIX/doc
 
162
  echo Done.
 
163
fi
 
164
echo
 
165
 
 
166
# Install the demos. Optional.
 
167
if yesno "Install demos"; then
 
168
  ask "Install demos in" DEMODIR
 
169
  echo Installing demos in $DEMODIR ...
 
170
  makedirhierarch $DEMODIR
 
171
  unztar demo $DEMODIR
 
172
  echo Done.
 
173
fi
 
174
echo
 
175
 
 
176
# Install /etc/fpc.cfg, this is done using the samplecfg script
 
177
$LIBDIR/$VERSION/samplecfg $LIBDIR/$VERSION
 
178
 
 
179
# The End
 
180
echo
 
181
echo End of installation. 
 
182
echo
 
183
echo Refer to the documentation for more information.
 
184
echo