File: wrapper.sh

package info (click to toggle)
uudeview 0.5.13-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 1,148 kB
  • ctags: 707
  • sloc: ansic: 11,342; tcl: 580; sh: 495; makefile: 376; awk: 13
file content (386 lines) | stat: -rw-r--r-- 13,561 bytes parent folder | download | duplicates (2)
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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
#! /bin/sh
#
# This is a super-duper do-it-all SFX-install script for uudeview.
# $Id: wrapper.sh,v 1.13 1997/01/09 14:22:05 fp Exp $
#
VERSION=0.5
PATCH=13
#
echo
echo ----------------------------------------------------------------------
echo                    UUDeview for Unix Installation
echo ----------------------------------------------------------------------
echo
echo You are about to install UUDeview for Unix, the friendly decoding
echo software. Usually, this works absolutely painlessly, but still you
echo should be ready to answer a few questions about you and your system.
echo
/bin/echo -n "Do you want to continue [y] "
read cont
if test "x$cont" != "x" && test "x$cont" != "xy" && test "x$cont" != "xyes" ; then
	echo
	echo Very well. Installation aborted.
	echo
	exit 0
fi

rm -f uudeview.tgz
if test ! -r uudeview.tgz ; then
	echo
	/bin/echo -n extracting source ...
	dd if=$0 of=uudeview.tgz bs=1k skip=12 2> /dev/null
	if test ! -s uudeview.tgz ; then
		echo error
		echo 
		echo Oops, couldn\'t extract source. The archive is probably broken. Please
		echo download this file once more and try again. Sorry.
		echo
		exit 1
	fi
	echo " done."
fi

#
# test if we have gunzip
#
/bin/echo -n checking for gunzip ... 
if gzip --version > /dev/null 2> /dev/null ; then
	echo " ok."
else
	echo " not found."
	echo
	echo It appears that you don\'t have gunzip installed. We need gunzip
	echo to extract the UUDeview archive. I strongly suggest to install
	echo the gunzip program.
	echo Or if you are sure that gunzip is installed, make sure it can
	echo be found in the \$PATH
	echo
	echo I\'m sorry, I cannot continue installation without gunzip.
	echo
	rm -rf uudeview.tgz uudeview.tar uudeview-"$VERSION"."$PATCH"
	exit 1
fi

/bin/echo -n uncompressing source ...

rm -f uudeview.tar
gzip -dc uudeview.tgz > uudeview.tar

if test "$?" != "0" || test ! -r uudeview.tar ; then
	echo " error."
	echo
	echo Oops, uncompressing the source code failed. The archive is
	echo probably broken. Please download this file once more and
	echo try again.
	echo
	echo Sorry, I cannot continue the installation.
	echo
	rm -rf uudeview.tgz uudeview.tar uudeview-*
	exit 1
else
	echo " done."
fi

/bin/echo -n extracting files from archive ...

tar xf uudeview.tar

if test "$?" != "0" || test ! -d uudeview-"$VERSION"."$PATCH" ; then
	echo " error."
	echo
	echo Oops, couldn\'t extract the archive file. This is weird.
	echo Please download this file once more and try again.
	echo
	echo Sorry, I cannot continue the installation.
	echo
	rm -rf uudeview.tgz uudeview.tar uudeview-"$VERSION"."$PATCH"
	exit 1
else
	rm -f uudeview.tar
	echo " done."
fi

cd uudeview-"$VERSION"."$PATCH"

if test "$?" != "0" ; then
	echo
	echo OOps. Could not change directory to uudeview-"$VERSION"."$PATCH". Weird.
	echo
	echo Sorry, I cannot continue the installation.
	echo
	rm -rf uudeview.tgz uudeview.tar uudeview-"$VERSION"."$PATCH"
	exit 1
fi

if test ! -x ./configure ; then
	echo
	echo OOps. Could not find ./configure. Weird.
	echo
	echo Sorry, I cannot continue the installation.
	echo
	cd ..
	rm -rf uudeview.tgz uudeview.tar uudeview-"$VERSION"."$PATCH"
	exit 1
fi

echo
echo ----------------------------------------------------------------------
echo We will now configure UUDeview for your needs.
echo ----------------------------------------------------------------------
echo

#
# check whether we are root
#

if test "x$LOGNAME" != "x" ; then
	whoami=$LOGNAME
else
	whoami=`id | sed 's/[^(]*(\([^)]*\)).*/\1/' 2>/dev/null`
	if test "x$whoami" = "x" ; then
		whoami=unknown
	fi
fi

if test "$whoami" = "root" ; then
	echo You are logged in as root. We should thus attempt a global
	echo installation of UUDeview. The default installation prefix
	echo is /usr/local, causing the binaries to go to /usr/local/bin
	echo and the manual pages to /usr/local/man.
	echo
	/bin/echo -n "Installation prefix [/usr/local] "
	read prefix
	if test "x$prefix" = "x" ; then
		prefix=/usr/local
	fi
else
	echo
	echo You are logged in as a plain user. You will probably want
	echo to install UUDeview locally, in your home directory. The
	echo installation prefix thus defaults to \$HOME, causing the
	echo binaries to go to \$HOME/bin and the manual pages to
	echo \$HOME/man. You can also choose not to install the manual
	echo pages.
	echo
	/bin/echo -n "Installation prefix [$HOME] "
	read prefix
	if test "x$prefix" = "x" ; then
		prefix=$HOME
	fi
	/bin/echo -n "Do you want manual pages [y] "
	read manuals
	if test "x$manuals" != "x" && test "x$manuals" != "xy" && test "x$manuals" != "xyes" ; then
		manopt="--disable-manuals"
	fi
fi

echo
echo If you have Tcl version 7.5 or greater, and Tk version 4.1 or greater
echo installed, UUDeview will add support for a Tcl/Tk extension, plus the
echo graphical frontend, xdeview.
echo Usually, the configuration script finds out by itself where and if you
echo have these two packages installed. On the following prompts, you can
echo either accept the default [y], which means to add support if available,
echo \'no\' or \'none\' to disable support, or you can give a base directory
echo where the package can be found \(we will need DIR/include for the
echo include files and DIR/lib for the libraries\).
echo
/bin/echo -n "Add Tcl support if possible [y] "
read tcl
if test "x$tcl" = "x" || test "x$tcl" = "xy" || test "x$tcl" = "xyes" ; then
	tclopt=""
	tkopt="y"
else
if test "x$tcl" = "xn" || test "x$tcl" = "xno" || test "x$tcl" = "xnone" ; then
	tclopt="--disable-tcl"
	tkopt="--disable-tk"
else
	tclopt="--enable-tcl=$tcl"
	tkopt="$tcl"
fi
fi
if test "x$tkopt" != "x--disable-tk" ; then
	/bin/echo -n "Add Tk  support if possible [$tkopt] "
	read tk
	if test "x$tk" = "x" ; then
		tk=$tkopt
	fi
	if test "x$tk" = "xy" || test "x$tk" = "xyes" ; then
		tkopt=""
	else
	if test "x$tk" = "xn" || test "x$tk" = "xno" || test "x$tk" = "xnone" ; then
		tkopt="--disable-tk"
	else
		tkopt="$tk"
	fi
	fi
fi

#
# get domain name
#

domainname=`grep '^domain' /etc/resolv.conf | tr -d ' 	' | sed 's/domain//'`

echo
echo If you want to post directly from uuenview, we might need to know
echo the internet domain you are in. The \"domain\" is the fully qualified
echo name of your host minus the hostname. For example, if your host is
echo bogus.cs.cms.edu, then the domain is cs.cms.edu. If you do not con-
echo figure a domain name, a bogus default will be used. In that case,
echo users will not be able to reply to your postings.
echo
/bin/echo -n "Your domain [$domainname] "
read domain
if test "x$domain" != "x" ; then
	domopt="--enable-domain=$domain"
fi

echo
echo We will now complete the configuration. This might take a while.
echo

./configure --prefix=$prefix $manopt $tclopt $tkopt

echo
echo ----------------------------------------------------------------------
echo Configuration finished. Building UUDeview.
echo ----------------------------------------------------------------------
echo
echo The package is now configured and ready to build. Do you want to
/bin/echo -n "build UUDeview now [y] "
read build
if test "x$build" != "x" && test "x$build" != "xy" && test "x$build" != "xyes" ; then
	echo
	echo Very well. Installation aborted.
	echo
	echo You can compile the package later by changing to `pwd`
	echo and running first \"make\", then \"make install\".
	echo
	exit 0
fi

echo
echo building UUDeview. This might take a while.
echo

make

if test ! -x ./unix/uudeview || test ! -x ./unix/uuenview ; then
	echo
	echo Compilation failed. Please examine the error messages above
	echo and try to figure out what\'s wrong. Sorry, can\'t help you
	echo here.
	echo
	exit 1
fi

if test ! -w $prefix && test "$whoami" != "root" ; then
	echo
	echo You want to install UUDeview globally but aren\'t logged in as
	echo root. I cannot install the package now. Please log in as root,
	echo change to `pwd` and enter the command \"make install\" to
	echo complete the installation.
	echo
	exit 0
fi

echo
echo ----------------------------------------------------------------------
echo Building finished. Installing UUDeview.
echo ----------------------------------------------------------------------
echo
echo I am now ready to install UUdeview. Do you want to complete
/bin/echo -n "the Installation now [y] "
read install
if test "x$install" != "x" && test "x$install" != "xy" && test "x$install" != "xyes" ; then
	echo
	echo Very well. Installation aborted. You can later install the package
	echo by running \"make install\" from `pwd`.
	echo
	exit 0
fi

echo
echo Installing Package.
echo

make install
cd ..

echo
echo ----------------------------------------------------------------------
echo Installation finished. Removing source files.
echo ----------------------------------------------------------------------
echo
/bin/echo -n "Do you want the source to be removed [y] "
read rem
if test "x$rem" = "x" || test "x$rem" = "xy" || test "x$rem" = "xyes" ; then
	rm -rf uudeview.tgz uudeview.tar uudeview-"$VERSION"."$PATCH"
fi
echo
echo Congratulations, you should now have a complete installation of
echo UUDeview. Now make sure that the binary directory $prefix/bin
echo is in your \$PATH. Then I suggest reading the manual pages.
echo Have fun!
echo
exit 0

################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################
################# Padding characters to fill 12 Kilobytes #################