blob: 57ec227eaf05e63f5ecef12fbea7fb5a6a59e9a2 (
plain)
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
|
#!/bin/sh
#
# Free Pascal installation script for Solaris
# Copyright 1996-2002 Michael Van Canneyt and Peter Vreman
#
# Don't edit this file.
# Everything can be set when the script is run.
#
# Release Version
VERSION=1.0.8
# some useful functions
# ask displays 1st parameter, and ask new value for variable, whose name is
# in the second parameter.
ask ()
{
askvar=$2
eval old=\$$askvar
eval echo -n \""$1 [$old] : "\"
read $askvar
eval test -z \"\$$askvar\" && eval $askvar=\'$old\'
}
# yesno gives 1 on no, 0 on yes $1 gives text to display.
yesno ()
{
while true; do
echo -n "$1 (Y/n) ? "
read ans
case X$ans in
X|Xy|XY) return 0;;
Xn|XN) return 1;;
esac
done
}
# Untar files ($3,optional) from file ($1) to the given directory ($2)
unztar ()
{
./gzip -d $HERE/$1.tar.gz
./gtar -xvf $HERE/$1.tar --directory $2 $3
}
# Make all the necessary directories to get $1
makedirhierarch ()
{
OLDDIR=`pwd`
case $1 in
/*) cd /;;
esac
OLDIFS=$IFS;IFS=/;eval set $1; IFS=$OLDIFS
for i
do
test -d $i || mkdir $i || break
cd $i ||break
done
cd $OLDDIR
}
# check to see if something is in the path
checkpath ()
{
ARG=$1
OLDIFS=$IFS; IFS=":";eval set $PATH;IFS=$OLDIFS
for i
do
if [ $i = $ARG ]; then
return 0
fi
done
return 1
}
# --------------------------------------------------------------------------
# welcome message.
#
clear
echo "This shell script will attempt to install the Free Pascal Compiler"
echo "version $VERSION with the items you select"
echo
# Here we start the thing.
HERE=`pwd`
# Install in /usr/local or /usr ?
if checkpath /usr/local/bin; then
PREFIX=/usr/local
else
PREFIX=/usr
fi
ask "Install prefix (/usr or /usr/local) " PREFIX
makedirhierarch $PREFIX
# Set some defaults.
LIBDIR=$PREFIX/lib/fpc
SRCDIR=$PREFIX/src/fpc
DOCDIR=$PREFIX/doc/fpc
DEMODIR=$DOCDIR/examples
EXECDIR=$PREFIX/bin
# Install compiler/RTL. Mandatory.
echo Unpacking ...
tar xf binary.tar
echo Installing compiler and RTL ...
unztar basesun $PREFIX
rm -f $EXECDIR/ppc386
ln -sf $LIBDIR/$VERSION/ppc386 $EXECDIR/ppc386
echo Installing GNU Assembler and Linker Mandatory.
unztar asldsun $PREFIX
echo Installing utilities...
unztar utilsun $PREFIX
if yesno "Install GNU Tools"; then
unztar makesun $PREFIX
fi
if yesno "Install FCL"; then
unztar ufclsun $PREFIX
fi
if yesno "Install Regular expression Package"; then
unztar uregexprsun $PREFIX
fi
if yesno "Install paszlib Package"; then
unztar upaszlibsun $PREFIX
fi
rm -f *sun.tar.gz
echo Done.
echo
# Install the sources. Optional.
if yesno "Install sources"; then
echo Unpacking ...
tar xf sources.tar
echo Installing sources in $SRCDIR ...
unztar basesrc $PREFIX
if yesno "Install compiler source"; then
unztar compilersrc $PREFIX
fi
if yesno "Install RTL source"; then
unztar rtlsrc $PREFIX
fi
if yesno "Install FCL source"; then
unztar fclsrc $PREFIX
fi
if yesno "Install paszlib source"; then
unztar upaszlibsrc $PREFIX
fi
if yesno "Install regexpr source"; then
unztar uregexprsrc $PREFIX
fi
if yesno "Install Utils source"; then
unztar utilssrc $PREFIX
fi
rm -f *src.tar.gz
echo Done.
fi
echo
# Install the documentation. Optional.
if yesno "Install documentation"; then
echo Installing documentation in $DOCDIR ...
unztar fpcdoc $PREFIX/doc
echo Done.
fi
echo
# Install the demos. Optional.
if yesno "Install demos"; then
ask "Install demos in" DEMODIR
echo Installing demos in $DEMODIR ...
makedirhierarch $DEMODIR
unztar demo $DEMODIR
echo Done.
fi
echo
# Install /etc/fpc.cfg, this is done using the samplecfg script
$LIBDIR/$VERSION/samplecfg $LIBDIR/$VERSION
# The End
echo
echo End of installation.
echo
echo Refer to the documentation for more information.
echo
|