File: configure.install

package info (click to toggle)
xcingb 2.3.02-5
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,492 kB
  • ctags: 877
  • sloc: ansic: 9,779; sh: 1,460; makefile: 299; awk: 12
file content (731 lines) | stat: -rwxr-xr-x 21,318 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
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
#!/bin/sh
#
#  This is part of auto-configuration of the xcin-2.3 package.
# 
#         Written by Tung-Han Hsieh     May, 1997
#
#  Usage: configure.install [-root=root-dir] [-PREFIX=PREFIX] 
#			[-bin-PREFIX=PREFIX] [-x-font-PREFIX=PREFIX]

#
#  General setup.
#

for arg in $@; do
    case $arg in
    -root=*) 
	ROOTDIR=`echo $arg | sed 's/[-a-z]*=//'` ;;
    -prefix=*)
	PREFIX=`echo $arg | sed 's/[-a-z]*=//'` ;;
    -bin-prefix=*)
	BIN_PREFIX=`echo $arg | sed 's/[-a-z]*=//'` ;;
    -x-font-prefix=*)
	X_FONT_PREFIX=`echo $arg | sed 's/[-a-z]*=//'` ;;
    *)  echo "Invalid arguement $arg.  Stop."
	exit 1 ;;
    esac
done

test -z "ROOTDIR" && ROOTDIR=..

STATUSFILE=$ROOTDIR/install.status
ROOTDIR=$ROOTDIR/script
HELPFILE=$ROOTDIR/configure.help

myecho() {
    echo "$1\c"
}
if [ -z "`echo -n test | grep n`" ]; then 
    ECHO='echo -n'
else
    ECHO='myecho'
fi


GetData() {
    grep $1 $STATUSFILE | sed "s%$1=%%"
}
if [ -f "$STATUSFILE" ]; then
    echo "Reading configurations from $STATUSFILE ....."

    INSTALL_XCIN=`GetData INSTALL_XCIN`
    INSTALL_CRXVT=`GetData INSTALL_CRXVT`
    INSTALL_FONTS=`GetData INSTALL_FONTS`
    INSTALL_INPTABS=`GetData INSTALL_INPTABS`
    INSTALL_DOCS=`GetData INSTALL_DOCS`
    INSTALL_UTILS=`GetData INSTALL_UTILS`

    PATH_XCIN_BIN=`GetData PATH_XCIN_BIN`
    PATH_XCIN_DIR=`GetData PATH_XCIN_DIR`
    PATH_XCIN_MAN=`GetData PATH_XCIN_MAN`
    PATH_XCIN_CFONT=`GetData PATH_XCIN_CFONT`
    PATH_XCIN_EFONT=`GetData PATH_XCIN_EFONT`
    PATH_XCIN_ETEN=`GetData PATH_XCIN_ETEN`

    OPT_XCIN_DELETEK=`GetData OPT_XCIN_DELETEK`
    OPT_XCIN_CFONT=`GetData OPT_XCIN_CFONT`
    OPT_XCIN_EFONT=`GetData OPT_XCIN_EFONT`
    OPT_CRXVT_CFONT=`GetData OPT_CRXVT_CFONT`
    OPT_CRXVT_EFONT=`GetData OPT_CRXVT_EFONT`
    OPT_FONT_ET15=`GetData OPT_FONT_ET15`
    OPT_FONT_ET24K=`GetData OPT_FONT_ET24K`
    OPT_FONT_ET24L=`GetData OPT_FONT_ET24L`
    OPT_FONT_ET24S=`GetData OPT_FONT_ET24S`
    OPT_FONT_ET24M=`GetData OPT_FONT_ET24M`
    OPT_FONT_ET24R=`GetData OPT_FONT_ET24R`
    OPT_FONT_ET24B=`GetData OPT_FONT_ET24B`
    OPT_FONT_ETV8=`GetData OPT_FONT_ETV8`
    OPT_FONT_ETV12=`GetData OPT_FONT_ETV12`
    OPT_UTIL_CLIOBJ=`GetData OPT_UTIL_CLIOBJ`
    OPT_UTIL_ET2BDF=`GetData OPT_UTIL_ET2BDF`
    OPT_UTIL_CIN2TAB=`GetData OPT_UTIL_CIN2TAB`
    OPT_UTIL_TSINTOOLS=`GetData OPT_UTIL_TSINTOOLS`
    OPT_INPTAB_PINYIN=`GetData OPT_INPTAB_PINYIN`
    OPT_INPTAB_SHUANPIN=`GetData OPT_INPTAB_SHUANPIN`
    OPT_INPTAB_WUBI=`GetData OPT_INPTAB_WUBI`
    OPT_INPTAB_ZHIRANMA=`GetData OPT_INPTAB_ZHIRANMA`

else
    INSTALL_XCIN=yes
    INSTALL_CRXVT=yes
    INSTALL_FONTS=no
    INSTALL_INPTABS=yes
    INSTALL_DOCS=yes
    INSTALL_UTILS=yes

    PATH_XCIN_BIN=/usr/bin
    PATH_XCIN_DIR=/usr/lib/xcingb
    PATH_XCIN_MAN=/usr/share/man
    PATH_XCIN_CFONT=/usr/X11R6/lib/X11/fonts/misc
    PATH_XCIN_EFONT=/usr/X11R6/lib/X11/fonts/misc
    PATH_XCIN_ETEN=

    OPT_XCIN_DELETEK=0
    OPT_XCIN_CFONT=hanzigb16fs
    OPT_XCIN_EFONT=8x16
    OPT_CRXVT_CFONT=hanzigb16fs
    OPT_CRXVT_EFONT=8x16
    OPT_FONT_ET15=no
    OPT_FONT_ET24K=no
    OPT_FONT_ET24L=no
    OPT_FONT_ET24S=no
    OPT_FONT_ET24M=no
    OPT_FONT_ET24R=no
    OPT_FONT_ET24B=no
    OPT_FONT_ETV8=no
    OPT_FONT_ETV12=no
    OPT_UTIL_CLIOBJ=no
    OPT_UTIL_ET2BDF=no
    OPT_UTIL_CIN2TAB=yes
    OPT_UTIL_TSINTOOLS=no
    OPT_INPTAB_PINYIN=yes
    OPT_INPTAB_SHUANPIN=yes
    OPT_INPTAB_WUBI=yes
    OPT_INPTAB_ZHIRANMA=yes
fi

test ! -z "$PREFIX" && PATH_XCIN_BIN=`echo $PREFIX | sed 's/\/$//'`/bin \
		    && PATH_XCIN_DIR=`echo $PREFIX | sed 's/\/$//'`/xcin \
		    && PATH_XCIN_MAN=`echo $PREFIX | sed 's/\/$//'`/man 
test ! -z "$BIN_PREFIX" && PATH_XCIN_BIN=`echo $BIN_PREFIX | sed 's/\/$//'`/bin
test ! -z "$X_FONT_PREFIX" && PATH_XCIN_CFONT=`echo $X_FONT_PREFIX | sed 's/\/$//'`/chinese \
			   && PATH_XCIN_EFONT=`echo $X_FONT_PREFIX | sed 's/\/$//'`/misc

#
#  General functions.
#
PrintHelp() {
    echo "<<<  $1  >>>" >&2
    echo >&2
    grep "$1" $HELPFILE | sed "s/$1://" >&2
    echo >&2
    $ECHO 'Press return to continue .....' >&2
    read ch3
}
AskForYesNo() {
    if [ "$1" = 'yes' ]; then
	ch2=no
    else
	ch2=yes
    fi
}
AskForPath() {
    cnt=0
    if [ "$3" = '0' ]; then
        ch3=$3
    else
        for f in $2; do echo [$cnt]$f; cnt=`expr $cnt + 1`; done
        $ECHO 'Please select one: '
        read ch3
    fi
    if [ $ch3 -lt $3 ]; then 
	cnt=0
	for f in $2; do
	    test "$ch3" = "$cnt" && ch2=$f && break
	    cnt=`expr $cnt + 1`
	done
    elif [ "$ch3" = "$3" ]; then
        echo "Please input the $1 pathname: " >&2
        read ch2
    else
	ch2=
    fi
}
MainOptions() {
    grep $2 $HELPFILE | sed "s/$2://" >&2
    echo 'For details, press "H" to see the help.' >&2
    echo >&2
    $ECHO "Do you want to install $1 [y/n/h]? " >&2
}

#
#  Main Program.
#
ch=0

WithoutSave=0
while [ "$ch" != 's' ] && [ "$ch" != 'S' ]; do
    fontopts=
if [ ! -z "$PATH_XCIN_ETEN" ]; then
    if [ "$OPT_FONT_ET15" = 'yes' ]; then fontopts="$fontopts et15"; fi 
    if [ "$OPT_FONT_ET24K" = 'yes' ]; then fontopts="$fontopts et24k"; fi 
    if [ "$OPT_FONT_ET24L" = 'yes' ]; then fontopts="$fontopts et24l"; fi
    if [ "$OPT_FONT_ET24S" = 'yes' ]; then fontopts="$fontopts et24s"; fi
    if [ "$OPT_FONT_ET24M" = 'yes' ]; then fontopts="$fontopts et24m"; fi
    if [ "$OPT_FONT_ET24R" = 'yes' ]; then fontopts="$fontopts et24r"; fi
    if [ "$OPT_FONT_ET24B" = 'yes' ]; then fontopts="$fontopts et24b"; fi
    if [ "$OPT_FONT_ETV8" = 'yes' ]; then fontopts="$fontopts etv8"; fi
    if [ "$OPT_FONT_ETV12" = 'yes' ]; then fontopts="$fontopts etv24"; fi
else
    OPT_FONT_ET15=no
    OPT_FONT_ET24K=no
    OPT_FONT_ET24L=no
    OPT_FONT_ET24S=no
    OPT_FONT_ET24M=no
    OPT_FONT_ET24R=no
    OPT_FONT_ET24B=no
    OPT_FONT_ETV8=no
    OPT_FONT_ETV12R=no
fi
    utilopts=
    if [ "$OPT_UTIL_CIN2TAB" = 'yes' ]; then utilopts="$utilopts cin2tab"; fi
    if [ "$OPT_UTIL_TSINTOOLS" = 'yes' ]; then utilopts="$utilopts tsintools"; fi
    if [ "$OPT_UTIL_CLIOBJ" = 'yes' ]; then utilopts="$utilopts cliobj"; fi
    if [ "$OPT_UTIL_ET2BDF" = 'yes' ]; then utilopts="$utilopts et2bdf"; fi

    inptabopts=
    if [ "$OPT_INPTAB_PINYIN" = 'yes' ]; then inptabopts="$inptabopts pinyin"; fi
    if [ "$OPT_INPTAB_SHUANPIN" = 'yes' ]; then inptabopts="$inptabopts shuangpin"; fi
    if [ "$OPT_INPTAB_WUBI" = 'yes' ]; then inptabopts="$inptabopts wubi"; fi
    if [ "$OPT_INPTAB_ZHIRANMA" = 'yes' ]; then inptabopts="$inptabopts ziranma"; fi

    cat >&2 << EOF
<<< Welcome to Auto-Configuration Program of XCIN-2.3.01 >>>
Packages:
   [X]Xcin  ------------------  <${INSTALL_XCIN}>
      Options: C_Font=$OPT_XCIN_CFONT E_Font=$OPT_XCIN_EFONT Delete_K=$OPT_XCIN_DELETEK
   [C]Crxvt  -----------------  <${INSTALL_CRXVT}>
      Options: C_Font=$OPT_CRXVT_CFONT E_Font=$OPT_CRXVT_EFONT
   [F]Fonts  -----------------  <${INSTALL_FONTS}>
      Options: $fontopts
   [I]Input Tables -----------  <${INSTALL_INPTABS}>
      Options: $inptabopts
   [D]Documentations ---------  <${INSTALL_DOCS}>
      Options: <none>
   [U]Utilities --------------  <${INSTALL_UTILS}>
      Options: $utilopts
Paths:
   [1]Binaries:         $PATH_XCIN_BIN
   [2]Xcin main path:   $PATH_XCIN_DIR
   [3]Xcin manual path: $PATH_XCIN_MAN
   [4]Chinese fonts:    $PATH_XCIN_CFONT
   [5]English fonts:    $PATH_XCIN_EFONT
   [6]ETen system:      $PATH_XCIN_ETEN
[H]Help;   [S]Save and Continue;   [Q]Quit and Stop;

EOF
$ECHO 'Your choice [CDFHISQUX123456] : '

#read ch
ch=s
echo

case $ch in
x|X) 
  while [ 1 ]; do
     MainOptions xcin XCIN_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
	 INSTALL_XCIN=yes
         ch1=0
         while [ "$ch1" != 'M' ] && [ "$ch1" != 'm' ]; do
	     echo >&2
	     echo "Options: [0]C_Font=$OPT_XCIN_CFONT" >&2
	     echo "         [1]E_Font=$OPT_XCIN_EFONT" >&2
	     echo "         [2]Delete_K=$OPT_XCIN_DELETEK" >&2
             echo "         [M]Main menu" >&2
             $ECHO "Please select one [012M]: " >&2
             read ch1
	     case $ch1 in
	       0) $ECHO 'Please input the default Chinese font name for xcin: ' >&2
		  read ch2
		  test ! -z $ch1 && OPT_XCIN_CFONT=$ch2
		  ;;
	       1) $ECHO 'Please input the default English font name for xcin: ' >&2
		  read ch2
		  test ! -z $ch1 && OPT_XCIN_EFONT=$ch2
		  ;;
	       2) if [ "$OPT_XCIN_DELETEK" = 1 ]; then
		      OPT_XCIN_DELETEK=0
		  else
		      OPT_XCIN_DELETEK=1
		  fi
		  ;;
	     esac
	 done
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
	 INSTALL_XCIN=no
 	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp XCIN_HELP
     fi
  done
  ;;

c|C) 
  while [ 1 ]; do
     MainOptions crxvt CRXVT_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
         INSTALL_CRXVT=yes
         ch1=0
         while [ "$ch1" != 'M' ] && [ "$ch1" != 'm' ]; do
	     echo >&2
	     echo "Options: [0]C_Font=$OPT_CRXVT_CFONT" >&2
	     echo "         [1]E_Font=$OPT_CRXVT_EFONT" >&2
             echo "         [M]Main menu" >&2
             $ECHO "Please select one [01M]: " >&2
             read ch1
	     case $ch1 in
	       0) $ECHO 'Please input the default Chinese font name for crxvt: ' >&2
		  read ch2
		  test ! -z $ch1 && OPT_CRXVT_CFONT=$ch2
		  ;;
	       1) $ECHO 'Please input the default English font name for crxvt: ' >&2
		  read ch2
		  test ! -z $ch1 && OPT_CRXVT_EFONT=$ch2
		  ;;
	     esac
	 done
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
         INSTALL_CRXVT=no
	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp CRXVT_HELP
     fi
  done
  ;;

f|F) 
if [ -z "$PATH_XCIN_ETEN" ]; then
  MainOptions fonts FONTS_SHORT
  read ch1
  if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
    INSTALL_FONTS=yes
    echo
    echo "We are sorry that currently xcin-2.3.02 can only transform the" 
    echo "fonts of ETen system.  Because you do not set the correct"
    echo "path of the ETen system, so the configure program assumes"
    echo "that you do not have the ETen system and therefore you can not"
    echo "select for the ETen fonts.  We will try to find other FREE"
    echo "Chinese fonts and add them into the xcin package in the future."
    echo
    echo "If you have other fonts you want to install, please move it into"
    echo "the directory xcin-2.3.02/fonts/ then the install process will"
    echo "install it automatically. To make the fonts works, be sure to"
    echo "write a fonts.alias for your own. For details, please see"
    echo "xcin-2.3.02/docs/howto/xcin.HOWTO(.ps)."
    echo
    echo "Press any key to continue ....."
    read  ch3
  else
    INSTALL_FONTS=no
  fi
else
  while [ 1 ]; do
     MainOptions fonts FONTS_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
         INSTALL_FONTS=yes
	 ch1=0
	 while [ "$ch1" != 'm' ] && [ "$ch1" != 'M' ]; do
	     echo >&2
	     cat >&2 <<EOF
Options: [1]ETen15  fonts ------------------ <${OPT_FONT_ET15}>
         [2]ETen24K fonts ------------------ <${OPT_FONT_ET24K}>
         [3]ETen24S fonts ------------------ <${OPT_FONT_ET24S}>
         [4]ETen24M fonts ------------------ <${OPT_FONT_ET24M}>
         [5]ETen24B fonts ------------------ <${OPT_FONT_ET24B}>
         [6]ETen24L fonts ------------------ <${OPT_FONT_ET24L}>
         [7]ETen24R fonts ------------------ <${OPT_FONT_ET24R}>
         [8]ETen vga8x15 fonts ------------- <${OPT_FONT_ETV8}>
         [9]ETen vga12x24 fonts ------------ <${OPT_FONT_ETV12}>
EOF
	     echo "         [M]Main menu" >&2
	     if [ ! -z "$PATH_XCIN_ETEN" ]; then
		 $ECHO 'Please select one [0123456789M]: ' >&2
	     else
		 $ECHO 'Please select one [0M]: ' >&2
	     fi

	     ch2=
	     read ch1
	     case $ch1 in
	     1) AskForYesNo $OPT_FONT_ET15
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET15=$ch2; fi
		;;
	     2) AskForYesNo $OPT_FONT_ET24K
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24K=$ch2; fi
		;;
	     3) AskForYesNo $OPT_FONT_ET24S
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24S=$ch2; fi
		;;
	     4) AskForYesNo $OPT_FONT_ET24M
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24M=$ch2; fi
		;;
	     5) AskForYesNo $OPT_FONT_ET24B
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24B=$ch2; fi
		;;
	     6) AskForYesNo $OPT_FONT_ET24L
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24L=$ch2; fi
		;;
	     7) AskForYesNo $OPT_FONT_ET24R
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ET24R=$ch2; fi
		;;
	     8) AskForYesNo $OPT_FONT_ETV8
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ETV8=$ch2; fi
		;;
	     9) AskForYesNo $OPT_FONT_ETV12
		if [ ! -z "$PATH_XCIN_ETEN" ]; then OPT_FONT_ETV12=$ch2; fi
		;;
	     esac
         done
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
         INSTALL_FONTS=no
         OPT_FONT_ET15=no
         OPT_FONT_ET24K=no
         OPT_FONT_ET24L=no
         OPT_FONT_ET24S=no
         OPT_FONT_ET24M=no
         OPT_FONT_ET24R=no
         OPT_FONT_ET24B=no
         OPT_FONT_ETV8=no
         OPT_FONT_ETV12=no
	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp FONTS_HELP
     fi
  done
fi
  ;;

i|I) 
  while [ 1 ]; do
     MainOptions 'input-method tables' INPTAB_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
	 INSTALL_INPTABS=yes

	 ch1=0
	 while [ "$ch1" != 'm' ] && [ "$ch1" != 'M' ]; do
cat >&2 <<EOF

Options: [0]3-Dayi    Input table ------- <${OPT_INPTAB_PINYIN}>
	 [1]Phone     Input table ------- <${OPT_INPTAB_SHUANPIN}>
	 [2]PinYin    Input table ------- <${OPT_INPTAB_WUBI}>
	 [3]zmd-Bosh  Input table ------- <${OPT_INPTAB_ZHIRANMA}>
EOF
	     echo "         [M]Main menu" >&2
		 $ECHO 'Please select one [0123M]: ' >&2

	     inptabopts=
	     read ch1
	     case $ch1 in
	     0) AskForYesNo $OPT_INPTAB_PINYIN
		OPT_INPTAB_PINYIN=$ch2
		;;
	     1) AskForYesNo $OPT_INPTAB_SHUANPIN
		OPT_INPTAB_SHUANPIN=$ch2
		;;
	     2) AskForYesNo $OPT_INPTAB_WUBI
		OPT_INPTAB_WUBI=$ch2
		;;
	     3) AskForYesNo $OPT_INPTAB_ZHIRANMA
		OPT_INPTAB_ZHIRANMA=$ch2
		;;
	     esac
	 done
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
         INSTALL_INPTABS=no
         OPT_INPTAB_PINYIN=no
         OPT_INPTAB_SHUANPIN=no
         OPT_INPTAB_WUBI=no
         OPT_INPTAB_ZHIRANMA=no
         OPT_INPTAB_AR30=no
         OPT_INPTAB_ETCJ=no
         OPT_INPTAB_ETPHO=no
         OPT_INPTAB_ETAR30=no
	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp INPTAB_HELP
     fi
  done
  ;;


d|D) 
  while [ 1 ]; do
     MainOptions documents DOCS_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
         INSTALL_DOCS=yes
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
         INSTALL_DOCS=no
	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp DOCS_HELP
     fi
  done
  ;;

u|U)
  while [ 1 ]; do 
     MainOptions utilities UTILS_SHORT
     read ch1
     if [ "$ch1" = 'y' ] || [ "$ch1" = 'Y' ]; then
         INSTALL_UTILS=yes

	 ch1=0
	 while [ "$ch1" != 'm' ] && [ "$ch1" != 'M' ]; do
	     cat >&2 <<EOF
Options: [0]cin2tab: input table convertor ---------------- <${OPT_UTIL_CIN2TAB}>
         [1]tsintools: tsin manage tools ------------------ <${OPT_UTIL_TSINTOOLS}>
         [2]cliobj: xcin server & client interface -------- <${OPT_UTIL_CLIOBJ}>
         [3]et2bdf: ETen fonts to .pcf font convertor  ---- <${OPT_UTIL_ET2BDF}>
         [M]Main menu
EOF
	     $ECHO "Please select [0123M]: "
	     read ch1
	     utilopts=
	     case $ch1 in
	     0) AskForYesNo $OPT_UTIL_CIN2TAB
		OPT_UTIL_CIN2TAB=$ch2
		;;
	     1) AskForYesNo $OPT_UTIL_TSINTOOLS
		OPT_UTIL_TSINTOOLS=$ch2
		;;
	     2) AskForYesNo $OPT_UTIL_CLIOBJ
		OPT_UTIL_CLIOBJ=$ch2
		;;
	     3) AskForYesNo $OPT_UTIL_ET2BDF
		OPT_UTIL_ET2BDF=$ch2
		;;
	     esac
         done
	 break;
     elif [ "$ch1" = 'n' ] || [ "$ch1" = 'N' ]; then
         INSTALL_UTILS=no
         OPT_UTIL_CLIOBJ=no
         OPT_UTIL_ET2BDF=no
         OPT_UTIL_CIN2TAB=no
         OPT_UTIL_TSINTOOLS=no
	 break;
     elif [ "$ch1" = 'h' ] || [ "$ch1" = 'H' ]; then
	 PrintHelp UTILS_HELP
     fi
  done
  ;;


h|H) $ECHO 'Which one [CDFIUX123456] ? '
     read ch1

     case $ch1 in
     x|X) PrintHelp XCIN_HELP
          ;;
     c|C) PrintHelp CRXVT_HELP
	  ;;
     f|F) PrintHelp FONTS_HELP
	  ;;
     d|D) PrintHelp DOCS_HELP
          ;;
     u|U) PrintHelp UTILS_HELP
	  ;;
     i|I) PrintHelp INPTAB_HELP
	  ;;
     1|2|3|4|5|6) PrintHelp PATHS_HELP
	  ;;
     esac
     ;;

  1) pathlist=
     pathcnt=0
     test ! -z "$BIN_PREFIX" && pathlist="$pathlist $BIN_PREFIX" && pathcnt=`expr $pathcnt + 1`
     test ! -z "$PREFIX" && pathlist="$pathlist $PREFIX/bin" && pathcnt=`expr $pathcnt + 1`
     for f in /usr/local/bin /usr/X11R6/bin /usr/bin $HOME/bin /usr/ucb/bin /bin; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     test ! -z "$BIN_PREFIX" -a "$f" = "$BIN_PREFIX" && continue
	     test ! -z "$PREFIX" -a "$f" = "$PREFIX/bin" && continue
	     pathlist="$pathlist $f" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'binary' "$pathlist" $pathcnt
     test ! -z "$ch2" && PATH_XCIN_BIN=$ch2
     ;;
  2) pathlist=
     pathcnt=0
     test ! -z "$PREFIX" && pathlist="$pathlist $PREFIX/lib/xcin" && pathcnt=`expr $pathcnt + 1`
     for f in /usr/local/lib /usr/X11R6/lib/X11 /usr/lib $HOME/lib /usr/ucb/lib; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     test ! -z "$PREFIX" -a "$f" = "$PREFIX/lib" && continue
	     pathlist="$pathlist $f/xcin" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'xcin main' "$pathlist" $pathcnt
     test ! -z "$ch2" && PATH_XCIN_DIR=$ch2
     ;;
  3) pathlist=
     pathcnt=0
     test ! -z "$PREFIX" && pathlist="$pathlist $PREFIX/man" && pathcnt=`expr $pathcnt + 1`
     for f in /usr/local/man /usr/X11R6/man /usr/man $HOME/man /usr/ucb/man; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     test ! -z "$PREFIX" -a "$f" = "$PREFIX/lib" && continue
	     pathlist="$pathlist $f" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'manual' "$pathlist" $pathcnt
     test ! -z "$ch2" && PATH_XCIN_MAN=$ch2
     ;;
  4) pathlist=
     pathcnt=0
     test ! -z "$X_FONT_PREFIX" && pathlist="$pathlist $X_FONT_PREFIX/chinese" && pathcnt=`expr $pathcnt + 1`
     for f in /usr/X11R6/lib/fonts/chinese /usr/X11R6/lib/fonts/misc /usr/X11R6/lib/fonts $HOME/fonts; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     test ! -z "$X_FONT_PREFIX" -a "$f" = "$X_FONT_PREFIX/chinese" && continue
	     pathlist="$pathlist $f" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'Chinese fonts' "$pathlist" $pathcnt
     test ! -z "$ch2" && PATH_XCIN_CFONT=$ch2
     ;;
  5) pathlist=
     pathcnt=0
     test ! -z "$X_FONT_PREFIX" && pathlist="$pathlist $X_FONT_PREFIX/misc" && pathcnt=`expr $pathcnt + 1`
     for f in /usr/X11R6/lib/fonts/misc /usr/X11R6/lib/fonts/chinese /usr/X11R6/lib/fonts $HOME/fonts; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     test ! -z "$X_FONT_PREFIX" -a "$f" = "$X_FONT_PREFIX/misc" && continue
	     pathlist="$pathlist $f" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'English fonts' "$pathlist" $pathcnt
     test ! -z "$ch2" && PATH_XCIN_EFONT=$ch2
     ;;
  6) pathlist=
     pathcnt=0
     for f in /msdos/et3 /dos/et3 /tmp/et3; do
	 if [ $pathcnt -lt 5 ] && [ -d "$f" ]; then 
	     pathlist="$pathlist $f" 
	     pathcnt=`expr $pathcnt + 1`
	 else
	     break;
	 fi
     done
     pathlist="$pathlist Others"
     AskForPath 'ETen system' "$pathlist" $pathcnt
     if [ ! -z "$ch2" ] && [ ! -d "$ch2" ]; then
	 echo >&2
	 $ECHO "Not valid pathname. Press return to continue ....." >&2
	 read ch3
     else
	 PATH_XCIN_ETEN=$ch2
     fi
     ;;
q|Q) WithoutSave=1
     exit 1
     ;;
esac
done


#
#  Writing the configuration into the 'install.status' file.
#
if [ -f $STATUSFILE ] && [ "$WithoutSave" = 1 ]; then
    exit 0
fi

rm -f $STATUSFILE
cat > $STATUSFILE <<EOF
INSTALL_XCIN=$INSTALL_XCIN
INSTALL_CRXVT=$INSTALL_CRXVT
INSTALL_FONTS=$INSTALL_FONTS
INSTALL_INPTABS=$INSTALL_INPTABS
INSTALL_DOCS=$INSTALL_DOCS
INSTALL_UTILS=$INSTALL_UTILS

PATH_XCIN_BIN=$PATH_XCIN_BIN
PATH_XCIN_DIR=$PATH_XCIN_DIR
PATH_XCIN_MAN=$PATH_XCIN_MAN
PATH_XCIN_CFONT=$PATH_XCIN_CFONT
PATH_XCIN_EFONT=$PATH_XCIN_EFONT
PATH_XCIN_ETEN=$PATH_XCIN_ETEN

OPT_XCIN_DELETEK=$OPT_XCIN_DELETEK
OPT_XCIN_CFONT=$OPT_XCIN_CFONT
OPT_XCIN_EFONT=$OPT_XCIN_EFONT
OPT_CRXVT_CFONT=$OPT_CRXVT_CFONT
OPT_CRXVT_EFONT=$OPT_CRXVT_EFONT
OPT_FONT_ET15=$OPT_FONT_ET15
OPT_FONT_ET24K=$OPT_FONT_ET24K
OPT_FONT_ET24L=$OPT_FONT_ET24L
OPT_FONT_ET24S=$OPT_FONT_ET24S
OPT_FONT_ET24M=$OPT_FONT_ET24M
OPT_FONT_ET24R=$OPT_FONT_ET24R
OPT_FONT_ET24B=$OPT_FONT_ET24B
OPT_FONT_ETV8=$OPT_FONT_ETV8
OPT_FONT_ETV12=$OPT_FONT_ETV12
OPT_UTIL_CLIOBJ=$OPT_UTIL_CLIOBJ
OPT_UTIL_ET2BDF=$OPT_UTIL_ET2BDF
OPT_UTIL_CIN2TAB=$OPT_UTIL_CIN2TAB
OPT_UTIL_TSINTOOLS=$OPT_UTIL_TSINTOOLS
OPT_INPTAB_PINYIN=$OPT_INPTAB_PINYIN
OPT_INPTAB_SHUANPIN=$OPT_INPTAB_SHUANPIN
OPT_INPTAB_WUBI=$OPT_INPTAB_WUBI
OPT_INPTAB_ZHIRANMA=$OPT_INPTAB_ZHIRANMA

EOF