home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume7 / elm_update / part3 / Edit3
Encoding:
Text File  |  1986-11-30  |  29.3 KB  |  1,277 lines

  1. : Use /bin/sh
  2.  
  3. # This is the automatically generated output of the AUTODIFF program after
  4. # being run on the two directories;
  5. #    Old Directory: Elm-Posted
  6. #    New Directory: Elm
  7.  
  8. # Any problems with execution of this script should be reported to the 
  9. #     author of the program, Dave Taylor, at "hplabs!taylor".  Thanks
  10.  
  11. # first off, let's make sure we're running in SH
  12.  
  13. export PATH || (sh $0; exit $$)
  14.  
  15. # next, let's ensure the user has "ed"...
  16.  
  17. if [ ! -f /bin/ed ]
  18. then
  19.   echo I can\'t find /bin/ed\!
  20.   exit 1
  21. fi
  22.  
  23. # finally, let's get this show on the road!!
  24.  
  25. #---------------------------------
  26. # File Elm/Configure.sh is new!
  27.  
  28. echo File Elm/Configure.sh is new - extracting...
  29. if [ -f Configure.sh ]
  30. then
  31.   echo File \'Configure.sh\' is new, but you already have something called that\!
  32.   echo I\'m going to move your file to \'Configure.sh.old\'...
  33.   /bin/mv -f Configure.sh Configure.sh.old
  34. else
  35.   echo Extracting new file \'Configure.sh\'
  36. fi
  37.  
  38. cat > Configure.sh << 'END_OF_FILE'
  39. #!/bin/sh
  40. #
  41. # Configure.sh, a shell script for configuring the Elm mail system for
  42. #     your site and desires.  This script uses some ideas ripped out
  43. #    of the 'rn' install script.  Thanks Larry!
  44. #
  45.  
  46. export PATH || (sh $0 ; kill $$)
  47.  
  48. SHELL=/bin/sh
  49.  
  50. SED1=/tmp/Elm.sed1
  51. SED2=/tmp/Elm.sed2
  52.  
  53. if [ -f /bin/rm ]
  54. then
  55.   rm=/bin/rm
  56. else
  57.   rm=rm
  58. fi
  59.  
  60. $rm -f $SED1 $SED2
  61. touch $SED1 $SED2
  62. chmod 777 $SED1 $SED2
  63.  
  64. # first test - is stdin still free for answering questions??
  65. if [ ! -t 0 ]
  66. then
  67.   echo "Please use 'sh Configure.sh' rather than 'sh < Configure.sh'"
  68.   exit 1
  69. fi
  70.  
  71. # next let's see what sorta echo flag we have here...
  72.  
  73. if [ "`echo -n`" = "-n" ]
  74. then
  75.   nflag=""
  76.   cflag="\\c" 
  77. else
  78.   nflag="-n"
  79.   cflag=""
  80. fi
  81.  
  82. # now the intro blurb
  83.  
  84. cat << END_OF_INTRO
  85.  
  86.                    Elm Configuration Script, v2
  87.        
  88.       
  89.     This is the configuration script for the Elm mail system.  By using
  90.     it rather than editing the "hdrs/sysdefs.h" file, it is hoped that
  91.     the installation process will be considerably easier.
  92.  
  93.     On all questions, the value in [square brackets] is the default that 
  94.     will be used if you just press RETURN...
  95.  
  96.  
  97. END_OF_INTRO
  98.  
  99. echo "Trying to figure out what sort of OS you're on..."
  100.  
  101. # next interesting part - figure out what OS we're on
  102.  
  103. os_name=""
  104.  
  105. $rm -f .osname
  106. touch .osname
  107.  
  108. cat << 'EOF' > .get_osname
  109.  
  110. uname
  111.  
  112. if [ $? != 0 ] 
  113. then
  114.   if [ -f /vmunix ]
  115.   then
  116.     echo "bsd" > .osname
  117.   else
  118.     exit 0
  119.   fi
  120. fi
  121.  
  122. if [ "`uname -s`" != "" ]
  123. then
  124.    uname -s | tr '[A-Z]' '[a-z]' > .osname
  125. fi
  126.  
  127. exit 0
  128.  
  129. EOF
  130.  
  131. sh .get_osname > /dev/null 2>&1
  132.  
  133. if [ -f .osname ] 
  134. then
  135.   os_name="`cat .osname`"
  136.   $rm -f .osname
  137. fi
  138.  
  139. $rm -f .get_osname
  140.  
  141. if [ "$os_name" = "" ] 
  142. then
  143.   cat << THE_END
  144.  
  145. I cannot figure out what sort of operating system you're running here.  Please
  146. type in the NAME of the OS you're running or the name of the machine you're
  147. THE_END
  148.  
  149.   echo $nflag "running on.  I'll check the name in a minute : " $cflag
  150.  
  151.   read junk morejunk
  152.   
  153.   os_name=`echo $junk | tr '[A-Z]' '[a-z]'`
  154. fi
  155.  
  156. OS_FLAG="HUH??"
  157.  
  158. while [ "$OS_FLAG" = "HUH??" ]
  159. do
  160.  
  161.   case $os_name in
  162.     hp)        NAME="HP-UX"; OS_FLAG=""        ;;
  163.     hp-ux)     NAME="HP-UX"; OS_FLAG="";           ;;
  164.     vax)    NAME="BSD"; OS_FLAG="BSD";      ;;
  165.     vaxen)    NAME="BSD"; OS_FLAG="BSD";      ;;
  166.     bsd)    NAME="BSD"; OS_FLAG="BSD";      ;;
  167.     uts)    NAME="UTS"; OS_FLAG="UTS";      ;;
  168.     sun)    NAME="Sun BSD"; OS_FLAG="SUN";        ;;
  169.     pyramid)    NAME="Pyramid BSD"; OS_FLAG="PYRAMID";    ;;
  170.     amdahl)    NAME="UTS"; OS_FLAG="UTS";      ;;
  171.     v5)        NAME="System V"; OS_FLAG="";        ;;
  172.     v7)        NAME="System VII"; OS_FLAG="";        ;;
  173.     eunice)    NAME="Eunice"; OS_FLAG="";        ;;
  174.     convergent)    NAME="Convergent BSD"; OS_FLAG="BSD";        ;;
  175.     berkeley)    NAME="BSD"; OS_FLAG="BSD";        ;;
  176.     ultrix)    cat << THE_END
  177.  
  178. I know that this is a breed of Unix, but I don't know what TYPE of OS it
  179. is like.  Please enter the NAME of the OS that this is most like (e.g. "BSD")
  180. and we'll go from there.
  181.  
  182. THE_END
  183.                     ;;
  184.     xenix)    cat << THE_END
  185.  
  186. You're outta luck.  Xenix (dumb OS that it is only allows 6 character 
  187. identifier names.  You'll need to go in and LABORIOUSLY translate all the
  188. VERY LONG identifier names to the right length.   The correct response to 
  189. seeing this message is to call your vendor and get ANGRY!!!!
  190.  
  191. Meanwhile, we might as well just quit here.  Sorry.
  192. THE_END
  193. exit 1
  194.                     ;;
  195.     *)        cat << THE_END
  196.  
  197. I don't know what OS you're specifying!  The only one's I know of are;
  198.  
  199.   HP-UX, BSD, UTS, Eunice, Xenix, Ultrix, V5, and V7
  200.  
  201. I also know the machines
  202.  
  203.   HP, Amdahl, Sun, Vaxen, Convergent and Pyramid
  204.  
  205. If you're not among this list, you'll need to pick the closest OS name.  
  206. THE_END
  207.  
  208.     echo " "
  209.     echo $nflag "Please choose again: " $cflag
  210.     read os_name
  211.     ;;
  212.   esac
  213.  
  214. done
  215.  
  216. echo " "
  217. echo " "
  218. echo you\'re on the following version of Unix: $NAME
  219.  
  220. case $OS_FLAG in 
  221.   BSD) echo "s/>os-define</-DBSD/" >> $SED2
  222.        echo "s/>lib2</-lcurses/" >> $SED2
  223.        ;;
  224.  
  225.   SUN) echo "s/>os-define</"-DBSD -DSUN"/" >> $SED2
  226.        echo "s/>lib2</-lcurses/" >> $SED2
  227.        ;;
  228.  
  229.   PYRAMID) echo "s/>os-define</"-DBSD -DNO_VAR_ARGS"/" >> $SED2
  230.        echo "s/>lib2</-lcurses/" >> $SED2
  231.        ;;
  232.  
  233.   *)   echo "s/>os-define<//"    >> $SED2
  234.        echo "s/>lib2<//"         >> $SED2
  235.        ;;
  236.  
  237. esac
  238.  
  239. echo " "
  240. echo "Now we can get down to those questions..."
  241. echo " "
  242.  
  243. cat << THE_END
  244.  
  245.  
  246. Does your site receive mail with valid "Reply-To:" and "From:" fields in
  247. the messages?  (usually the answer is "no" since not all sites on the network
  248. rewrite the addresses, and this'll usually cause the return mail to fail).
  249. THE_END
  250.  
  251. answer="no"
  252. echo $nflag "Are the addresses valid (y/n) [no] ?" $cflag
  253. read answer
  254.  
  255. if [ "$answer" != "y" -a "$answer" != "yes" ]
  256. then
  257.   echo \
  258. "s/#define USE_EMBEDDED_ADDRESSES/\/** #define USE_EMBEDDED_ADDRESSES **\//" \
  259.   >> $SED1
  260. fi
  261.  
  262. cat << THE_END
  263.  
  264. -------------------------------------------------------------------------------
  265.  
  266. How about memory?  If you have a lot, you can enter a fairly large number
  267. for the next few questions...if not, you'll probably want to enter the
  268. suggested small-system values.  (This applies to the speed of the swapping
  269. on your system too - if you're on a FAST system, use the big values!)
  270.  
  271. First, how many messages should be allowed in a single folder?  (the suggested
  272. values are 1000 for blindly fast systems, 500 for average systems and 100 for
  273. THE_END
  274.  
  275. echo $nflag "slow systems).  Number of messages [500] ? " $cflag
  276.  
  277. max_headers=NONE
  278.  
  279. while [ "$max_headers" = "NONE" ]
  280. do 
  281.   read junk
  282.  
  283.   if [ "$junk" = "" ]
  284.   then
  285.     junk=500
  286.   fi
  287.  
  288.   if [ $junk -gt 1000 -o $junk -lt 50 ] 
  289.   then
  290.     echo "I think a value of $junk is pretty strange.  You better answer this"
  291.     echo "question again..."
  292.     echo " "
  293.     echo $nflag "How many messages per folder [500] ? " $cflag
  294.     read junk
  295.   else
  296.     max_headers=$junk
  297.     echo "s/>500</$max_headers/" >> $SED1
  298.   fi
  299.  
  300.   if [ $junk -lt 200 ]
  301.   then
  302.     system_size="small"
  303.   elif [ $junk -lt 750 ]
  304.   then
  305.     system_size="normal"
  306.   else
  307.     system_size="big"
  308.   fi
  309. done
  310.  
  311. case $system_size in
  312.   small)  default=223;        ;;
  313.   normal) default=503;        ;;
  314.   big)    default=739;        ;;
  315. esac
  316.  
  317. echo " "
  318.  
  319. max_saliases="NONE"
  320.  
  321. while [ "$max_saliases" = "NONE" ] 
  322. do 
  323.  
  324.   echo $nflag "Max number of system aliases available [$default] ? " $cflag
  325.  
  326.   read junk
  327.  
  328.   if [ "$junk" = "" ] 
  329.   then
  330.     junk=$default
  331.   fi
  332.  
  333.   if [ $junk -lt 50 -o $junk -gt 1000 ] 
  334.   then
  335.     echo "Pretty far out value for this question!  I think you should reconsider"
  336.     echo "your answer and try this question again..."
  337.     echo " "
  338.   else
  339.     max_saliases=$junk
  340.     echo "s/>503</$max_saliases/" >> $SED1
  341.   fi
  342. done
  343.  
  344. case $system_size in 
  345.   small)     default=127;        ;;
  346.   normal)    default=251;        ;;
  347.   big)        default=503;        ;;
  348. esac
  349.  
  350. max_ualiases="NONE"
  351.  
  352. while [ "$max_ualiases" = "NONE" ] 
  353. do 
  354.  
  355.   echo $nflag "Max number of user aliases available   [$default] ? " $cflag
  356.  
  357.   read junk
  358.  
  359.   if [ "$junk" = "" ] 
  360.   then
  361.    junk=$default
  362.   fi
  363.  
  364.   if [ $junk -lt 50 -o $junk -gt 1000 ] 
  365.   then
  366.     echo "Pretty far out value for this question!  I think you should reconsider"
  367.     echo "your answer and try this question again..."
  368.     echo " "
  369.   else
  370.     max_ualiases=$junk
  371.     echo "s/>251</$max_ualiases/" >> $SED1
  372.   fi
  373. done
  374.  
  375. case $system_size in 
  376.   small)     default=50;        ;;
  377.   normal)    default=150;        ;;
  378.   big)        default=150;        ;;
  379. esac
  380.  
  381. max_in_weedlist="NONE"
  382.  
  383. while [ "$max_in_weedlist" = "NONE" ] 
  384. do 
  385.  
  386.   echo $nflag "Max number of headers in weedout list  [$default] ? " $cflag
  387.  
  388.   read junk
  389.  
  390.   if [ "$junk" = "" ] 
  391.   then
  392.     junk=$default
  393.   fi
  394.  
  395.   if [ $junk -lt 10 -o $junk -gt 200 ] 
  396.   then
  397.     echo "Pretty strange answer to this question!  I think you should reconsider"
  398.     echo "and try this question again..."
  399.     echo " "
  400.   else
  401.     max_in_weedlist=$junk
  402.     echo "s/>150</$max_in_weedlist/" >> $SED1
  403.   fi
  404. done
  405.  
  406. cat << THE_END
  407.  
  408. The next pair of questions have to do with what to do when another program has 
  409. locked a mailbox...
  410.  
  411. First, how many times should the program check for the removal of the lock
  412. THE_END
  413.  
  414. default=6
  415.  
  416. max_attempts="NONE"
  417.  
  418. while [ "$max_attempts" = "NONE" ] 
  419. do 
  420.  
  421.   echo $nflag "file before giving up? [6] " $cflag
  422.  
  423.   read junk
  424.  
  425.   if [ "$junk" = "" ] 
  426.   then
  427.    junk=$default
  428.   fi
  429.  
  430.   if [ $junk -lt 3 -o $junk -gt 10 ] 
  431.   then
  432.     echo \
  433. "The recommended range is 3-10   ...Number of times to check lock"
  434.   else
  435.     max_attempts=$junk
  436.     echo "s/>6</$max_attempts/" >> $SED1
  437.   fi
  438. done
  439.  
  440. echo " "
  441. answer="no"
  442. echo $nflag "Should it REMOVE the lockfile after $max_attempts checks [no] ?" \
  443.      $cflag
  444. read answer
  445.  
  446. if [ "$answer" != "y" -a "$answer" != "yes" ]
  447. then
  448.   echo \
  449. "s/#define REMOVE_AT_LAST/\/** #define REMOVE_AT_LAST **\//" \
  450.   >> $SED1
  451. fi
  452.  
  453. if [ "$NAME" = "BSD" ]
  454. then 
  455.   ps="ps -cax"
  456. else
  457.   ps="ps -ef"
  458. fi
  459.  
  460. echo " "
  461. echo " "
  462. echo "poking about a bit.."
  463.  
  464. if [ "`$ps | grep sendmail | grep -v grep`" != "" ]
  465. then
  466.   echo "You're running sendmail.  Well done, I guess..."
  467.   echo "s/\/\*\* #define DONT_ADD_FROM \*\*\//#define DONT_ADD_FROM/" \
  468.     >> $SED1
  469.     echo \
  470.  "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
  471.     >> $SED1
  472. else
  473.  
  474.   cat << THE_END
  475.  
  476. Since you're not running sendmail, should I check local user entered addresses
  477. THE_END
  478.  
  479. answer="yes"
  480. echo $nflag "against the valid mailboxes on this system [yes] ? " $cflag
  481. read answer
  482.  
  483. if [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
  484. then
  485.   echo \
  486. "s/#define NOCHECK_VALIDNAME/\/** #define NOCHECK_VALIDNAME **\//" \
  487.   >> $SED1
  488. fi
  489.  
  490. cat << THE_END
  491.  
  492. Are you running a machine where you want to have a domain name appended to the
  493. THE_END
  494.  
  495. answer="yes"
  496. echo $nflag "hostname on outbound mail [no] ? " $cflag
  497. read answer
  498.  
  499. if [ "$answer" != "y" -a "$answer" != "yes" ]
  500. then
  501.     echo \
  502.  "s/#define USE_DOMAIN/\/** #define USE_DOMAIN **\//" \
  503.     >> $SED1
  504. else
  505.   echo " "
  506.   echo $nflag "Enter the domain name (include leading '.') : " $cflag
  507.   read answer
  508.   echo "s/<enter your domain here>/$answer/" >> $SED1
  509. fi
  510.  
  511. fi
  512.  
  513. # next let's see if we can find the vfork command on this system..
  514.  
  515. cat << EOF > .test.c
  516. main()
  517. {
  518.     (void) vfork();
  519. }
  520. EOF
  521.  
  522. cat << EOF > .vfork
  523. cc .test.c
  524. EOF
  525.  
  526. sh .vfork > .log 2>& 1
  527.  
  528. if [ "`wc -l .log`" -eq "0" ]
  529. then
  530.   echo "You have virtual memory system calls available.  Cool..."
  531. else
  532.   cat << THE_END
  533.  
  534. Your machine doesn't seem to have the vfork command available.  Should I assume
  535. THE_END
  536.  
  537.   answer="no"
  538.   echo $nflag "you have it, anyway [no] ? " $cflag
  539.   read answer
  540.  
  541. if [ "$answer" != "y" -a "$answer" != "yes" ]
  542.   then
  543.     echo "s/\/\*\* #define NO_VM \*\*\//#define NO_VM/" >> $SED1
  544.   fi
  545. fi
  546.  
  547. $rm -f a.out .test.c .vfork .log
  548.  
  549. # next let's see if we have the gethostname() system call...
  550.  
  551. cat << EOF > .test.c
  552. main()
  553. {
  554.     (void) gethostname();
  555. }
  556. EOF
  557.  
  558. cat << EOF > .hostname
  559. cc .test.c
  560. EOF
  561.  
  562. sh .hostname > .log 2>& 1
  563.  
  564. if [ "`wc -l .log`" -eq "0" ]
  565. then
  566.   echo "You have the 'gethostname()' system call..."
  567. else
  568.   echo "s/\/\*\* #define NEED_GETHOSTNAME \*\*\//#define NEED_GETHOSTNAME/" \
  569.   >> $SED1
  570. fi
  571.  
  572. $rm -f a.out .test.c .hostname .log
  573.  
  574. # next let's see if we have long variable names...
  575.  
  576. cat << EOF > .test.c
  577. main()
  578. {
  579.     int this_is_a_long_variable;
  580.  
  581.     (void) this_is_a_long_variable_routine_name();
  582.     
  583. }
  584. this_is_a_long_variable_routine_name() { }
  585. EOF
  586.  
  587. cat << EOF > .varnames
  588. cc .test.c
  589. EOF
  590.  
  591. sh .varnames > .log 2>& 1
  592.  
  593. if [ "`wc -l .log`" -eq "0" ]
  594. then
  595.   echo "You have long variable names.  Well done!!!!!"
  596. else
  597.   echo "How embarassing.  Your C compiler doesn't support long variables..."
  598.   echo "s/\/\*\* #define SHORTNAMES \*\*\//#define SHORTNAMES/" \
  599.   >> $SED1
  600. fi
  601.  
  602. $rm -f a.out .test.c .varname .log
  603.  
  604. cat << THE_END
  605.  
  606. When given a machine that you talk to directly, should the 'pathalias' route to
  607. THE_END
  608.  
  609. answer="no"
  610. echo $nflag "the machine be used instead [no] ? " $cflag
  611. read answer
  612.  
  613. if [ "$answer" != "y" -a "$answer" != "yes" ]
  614. then
  615.     echo \
  616.  "s/#define LOOK_CLOSE_AFTER_SEARCH/\/** #define LOOK_CLOSE_AFTER_SEARCH **\//" \
  617.     >> $SED1
  618. fi
  619.  
  620. answer="yes"
  621. echo " "
  622. echo $nflag "Is the preferred address notation 'user@host' [yes] ?" $cflag
  623. read answer
  624.  
  625. if [ "$answer" != "y" -a "$answer" != "yes" -a  "$answer" != "" ]
  626. then
  627.     echo \
  628.  "s/#define INTERNET_ADDRESS_FORMAT/\/** #define INTERNET_ADDRESS_FORMAT **\//" \
  629.     >> $SED1
  630. fi
  631.  
  632. echo " "
  633. answer="yes"
  634. echo $nflag "Am I going to be running as a setgid program [yes] ? "$cflag
  635. read answer
  636.  
  637. if [ "$answer" != "y" -a "$answer" != "yes" -a "$answer" != "" ]
  638. then
  639.   echo answer is currently equal to \"$answer\"
  640.   echo \
  641.  "s/#define SAVE_GROUP_MAILBOX_ID/\/** #define SAVE_GROUP_MAILBOX_ID **\//" \
  642.     >> $SED1
  643. fi
  644.     
  645. cat << THE_END
  646.  
  647.  
  648. For any of the questions after this point, you can press RETURN if the 
  649. questions doesn't apply, or there's no reasonable answer...
  650.  
  651. THE_END
  652.  
  653. if [ ! -f /usr/lib/nmail.paths ] 
  654. then
  655.   echo $nflag "Where does the output of pathalias live ? " $cflag
  656.   read answer
  657.  
  658.   if [ "$answer" != "" ]
  659.   then
  660.     echo "s^/usr/lib/nmail.paths^$answer^" >> $SED1
  661.   fi
  662. fi
  663.  
  664. if [ ! -f /usr/lib/domains ] 
  665. then
  666.   echo $nflag "Where does the 'domains' file live ? " $cflag
  667.   read answer
  668.  
  669.   if [ "$answer" != "" ]
  670.   then
  671.     echo "s^/usr/lib/domains^$answer^" >> $SED1
  672.   fi
  673. fi
  674.  
  675. if [ ! -f /usr/lib/uucp/L.sys ]
  676. then
  677.   echo $nflag "Where does the 'L.sys' file live ? " $cflag
  678.   read answer
  679.  
  680.   if [ "$answer" != "" ]
  681.   then
  682.     echo "s^/usr/lib/uucp/L.sys^$answer^" >> $SED1
  683.   fi
  684. fi
  685.  
  686. if [ ! -d /tmp ]
  687. then 
  688.   echo $nflag "/tmp isn't a directory!  What should I use?? " $cflag
  689.   read answer
  690.  
  691.   if [ "$answer" != "" ]
  692.   then
  693.     echo "s^/tmp^$answer^" >> $SED1
  694.   fi
  695. fi
  696.  
  697. if [ ! -f /usr/ucb/vi -a "$os_name" = "BSD" ]
  698. then
  699.   echo $nflag "I can't find the 'vi' editor!  Where is it? " $cflag
  700.   read answer
  701.  
  702.   if [ "$answer" != "" ]
  703.   then
  704.     echo "s^/usr/ucb/vi^$answer^" >> $SED1
  705.   fi
  706. elif [ ! -f /usr/bin/vi -a "$os_name" = "" ]
  707. then
  708.   echo $nflag \
  709.     "I can't find the 'vi' editor!  Where is it? " $cflag
  710.   read answer
  711.  
  712.   if [ "$answer" != "" ]
  713.   then
  714.     echo "s^/usr/bin/vi^$answer^" >> $SED1
  715.   fi
  716. fi
  717.  
  718. if [ ! -d /usr/spool/mail -a "$os_name" = "BSD" ]
  719. then
  720.   echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
  721.   read answer
  722.  
  723.   if [ "$answer" != "" ]
  724.   then
  725.     echo "s^/usr/spool/mail^$answer^" >> $SED1
  726.   fi
  727. elif [ ! -d /usr/mail -a "$os_name" = "" ]
  728. then
  729.   echo $nflag "I can't find your inbound mail directory!  Where is it? " $cflag
  730.   read answer
  731.  
  732.   if [ "$answer" != "" ]
  733.   then
  734.     echo "s^/usr/mail^$answer^" >> $SED1
  735.   fi
  736. fi
  737.  
  738. if [ ! -f /bin/rm ]
  739. then
  740.   echo $nflag "Where's the 'rm' program? " $cflag
  741.   read answer
  742.  
  743.   if [ "$answer" != "" ]
  744.   then
  745.     echo "s^/bin/rm^$answer^" >> $SED1
  746.   fi
  747. fi
  748.  
  749. if [ ! -f /bin/cat ]
  750. then
  751.   echo $nflag "Where's the 'cat' program? " $cflag
  752.   read answer
  753.  
  754.   if [ "$answer" != "" ]
  755.   then
  756.     echo "s^/bin/rm^$answer^" >> $SED1
  757.   fi
  758. fi
  759.  
  760. if [ ! -f /dev/rct ]
  761. then
  762.   if [ ! -f /dev/rmt ]
  763.   then
  764.     echo $nflag "What's the name of your remote-tape unit? " $cflag
  765.     read answer
  766.  
  767.     if [ "$answer" = "" ]
  768.     then
  769.       echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
  770.     else
  771.       if [ ! -f $answer ] 
  772.       then
  773.     if [ -f /dev/$answer ]
  774.     then
  775.           echo "s^>tapeunit<^/dev/$answer^" >> $SED2
  776.         else
  777.           echo \
  778.            "I can't find either $answer or /dev/$answer.  I'll set it to junk" 
  779.           echo "s^>tapeunit<^unknown-remote-tape-unit^" >> $SED2
  780.         fi
  781.       else
  782.         echo "s^>tapeunit<^$answer^" >> $SED2
  783.       fi
  784.     fi
  785.   else
  786.     echo "s^>tapeunit<^/dev/rmt^" >> $SED2
  787.   fi
  788. else
  789.   echo "s^>tapeunit<^/dev/rct^" >> $SED2
  790. fi
  791.  
  792. if [ ! -d /usr/local/bin ]
  793. then
  794.   echo $nflag "Where do you want the system software installed? " $cflag
  795.   read answer
  796.  
  797.   if [ "$answer" = "" ]
  798.   then
  799.     echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
  800.   else
  801.     if [ -d $answer ]
  802.     then
  803.       echo "s^>dest-dir<^$answer^" >> $SED2
  804.     else
  805.       echo "I don't know what you're talking about.  I'll set it to junk" 
  806.       echo "s^>dest-dir<^unknown-destination-directory^" >> $SED2
  807.     fi
  808.   fi
  809. else
  810.   echo "s^>dest-dir<^/usr/local/bin^" >> $SED2
  811. fi
  812.  
  813. if [ ! -f /usr/bin/troff ]
  814. then
  815.   if [ ! -f /usr/local/bin/troff ]
  816.   then
  817.     if [ ! -f /usr/contrib/bin/troff ]
  818.     then
  819.       if [ ! -f /usr/ucb/troff ]
  820.       then
  821.         if [ ! -f /bin/troff ]
  822.         then
  823.           echo $nflag "Where does the 'troff' program live? " $cflag
  824.        read answer
  825.  
  826.       if [ "$answer" = "" ]
  827.       then
  828.             echo "s/>troff</nroff/" >> $SED2
  829.       else
  830.             if [ -f $answer ]
  831.         then
  832.               echo "s^>troff<^$answer^" >> $SED2
  833.               troff=$answer
  834.         else
  835.           echo "Still can't find it.  I'll set it to \"nroff\" instead."
  836.               echo "s/>troff</nroff/" >> $SED2
  837.         fi
  838.       fi
  839.     else
  840.           echo "s^>troff<^/bin/troff^" >> $SED2
  841.           troff=/bin/troff
  842.         fi
  843.       else
  844.         echo "s^>troff<^/usr/ucb/troff^" >> $SED2
  845.         troff=/usr/ucb/troff
  846.       fi
  847.     else
  848.       echo "s^>troff<^/usr/contrib/bin/troff^" >> $SED2
  849.       troff=/usr/contribbin/troff
  850.     fi
  851.   else
  852.     echo "s^>troff<^/usr/local/bin/troff^" >> $SED2
  853.     troff=/usr/local/bin/troff
  854.   fi
  855. else
  856.   echo "s^>troff<^/usr/bin/troff^" >> $SED2
  857.   troff=/usr/bin/troff
  858. fi
  859.  
  860. # phew!
  861.  
  862. troffdir=`dirname $troff`
  863.  
  864. if [ -f $troffdir/tbl ]
  865. then
  866.   echo "s^>tbl<^$troffdir/tbl^" >> $SED2
  867. else
  868.   echo $nflag "Where does the 'tbl' program live? " $cflag
  869.   read answer
  870.  
  871.   if [ "$answer" = "" ]
  872.   then
  873.     echo "s^>tbl<^cat^" >> $SED2
  874.   elif [ -f $answer ]
  875.   then
  876.     echo "s^>tbl<^$answer^" >> $SED2
  877.   else
  878.     echo "I can't find that either.  I'll just set it to junk..."
  879.     echo "s^>tbl<^cat^" >> $SED2
  880.   fi
  881. fi
  882.  
  883. if [ -f /bin/cc ]
  884. then
  885.   echo "s^>cc<^/bin/cc^" >> $SED2
  886. else
  887.   echo $nflag "Where does the 'C' compiler live? " $cflag
  888.   read answer
  889.  
  890.   if [ "$answer" = "" ]
  891.   then
  892.     cat << THE_END
  893.  
  894. I hope you realize that without a "C" compiler there's no point in doing any
  895. of this.  If we can't compile anything then this is just so much disk filler.
  896.  
  897. In fact, thinking about it, let's just quit right now.
  898.  
  899. THE_END
  900.  
  901.     exit 1
  902.   fi
  903.  
  904.   if [ -f $answer ]
  905.   then
  906.     echo "s^>cc<^$answer^" >> $SED2
  907.   else
  908.     cat << THE_END
  909.  
  910. I couldn't find what you specified, pal.  I hope you realize that without a 
  911. "C" compiler there's no point in doing any of this.  If we can't compile 
  912. anything then this system is just so much disk filler.
  913.  
  914. In fact, thinking about it, let's just quit right now.
  915.  
  916. THE_END
  917.     exit 1
  918.   fi
  919. fi
  920.  
  921. echo "s^>rm<^$rm -f^" >> $SED2
  922.  
  923. if [ -f /bin/mv ]
  924. then
  925.   echo "s^>mv<^/bin/mv -f^" >> $SED2
  926. else
  927.   echo "s^>mv<^mv -f^" >> $SED2  
  928. fi
  929.  
  930. if [ -f /bin/cp ]
  931. then
  932.   echo "s^>cp<^/bin/cp^" >> $SED2
  933. else
  934.   echo "s^>cp<^cp^" >> $SED2  
  935. fi
  936.  
  937. cat << END
  938.  
  939. That's it.  Just  have to do some patching up and such...hang loose for a 
  940. minute or two, please...
  941.  
  942. END
  943.  
  944. # process the three Makefiles accordingly...
  945.  
  946. echo "1 - processing the file \"Makefile\"..."
  947. cat Makefile.mstr | sed -f $SED2 > Makefile
  948.  
  949. echo "2 - processing the file \"src/Makefile\"..."
  950. cat src/Makefile.mstr | sed -f $SED2 > src/Makefile
  951.  
  952. echo "3 - processing the file \"utils/Makefile\"..."
  953. cat utils/Makefile.mstr | sed -f $SED2 > utils/Makefile
  954.  
  955. # then filter the sysdefs file through the sed script we've created!
  956.  
  957. echo "Finally, processing the file \"hdrs/sysdefs.h\"..."
  958.  
  959. if [ -f hdrs/sysdefs.h ]
  960. then
  961.   mv hdrs/sysdefs.h hdrs/sysdefs.old
  962. fi
  963.  
  964. cat hdrs/sysdefs.master | sed -f $SED1 > hdrs/sysdefs.h
  965.  
  966. echo Done\!
  967.  
  968. $rm -f $SED1 $SED2
  969. exit 0
  970. END_OF_FILE
  971.  
  972. chars=`cat Configure.sh | wc -c`
  973.  
  974. if [ $chars -ne 19263 ]
  975. then
  976.   echo File damaged in transit...should be 19263 bytes, is $chars instead
  977.   echo  I suggest you check it closely...
  978. fi
  979.  
  980. #---------------------------------
  981. # File Elm/Makefile.mstr is new!
  982.  
  983. echo File Elm/Makefile.mstr is new - extracting...
  984. if [ -f Makefile.mstr ]
  985. then
  986.   echo File \'Makefile.mstr\' is new, but you already have something called that\!
  987.   echo I\'m going to move your file to \'Makefile.mstr.old\'...
  988.   /bin/mv -f Makefile.mstr Makefile.mstr.old
  989. else
  990.   echo Extracting new file \'Makefile.mstr\'
  991. fi
  992.  
  993. cat > Makefile.mstr << 'END_OF_FILE'
  994. #
  995. #  Makefile for the entire ELM mail system
  996. #
  997. #         (C) Copyright 1986, Dave Taylor
  998. #
  999. #  Last modification: July 14th, 1986
  1000.  
  1001. SHELL=/bin/sh
  1002.  
  1003. #########################
  1004. #
  1005. # The following entries need to be customized for the local site:  
  1006. #    The first is the address of the data-cassette drive to allow
  1007. # easy tape copies to be made, and the second is the final location 
  1008. # that all the software should be installed in when 'make install'
  1009. # is run.
  1010. #
  1011. #########################
  1012.  
  1013. TAPE=   >tapeunit< 
  1014. DEST=   >dest-dir<
  1015.  
  1016. LIB=    /usr/local/lib
  1017. MAN=    /usr/man/man1
  1018. CATMAN= /usr/man/cat1
  1019. SHAR=   /usr/local/bin/shar -s 60000
  1020.  
  1021. # See the Configuration Guide for further information on this stuff;
  1022. #
  1023. # if on a Berkeley system:
  1024. #   DEFINE = -DBSD
  1025. #   LIB2   = -lcurses
  1026. # else if on a UTS system:
  1027. #   DEFINE = -DUTS
  1028. #   LIB2   = -la
  1029. # else if on a Sun system:
  1030. #   DEFINE = "-DBSD -DSUN"
  1031. #   LIB2   = -lcurses
  1032. # else if on a Pyramid system:
  1033. #   DEFINE = "-DBSD -DNO_VAR_ARGS"
  1034. #   LIB2   = -lcurses
  1035. # otherwise;
  1036.  
  1037.     DEFINE = >os-define<
  1038.     LIB2   = >lib2<
  1039.  
  1040. # If you're on ACSnet (Australia) you'll want to define
  1041. # the following;
  1042.  
  1043. #   DEFINE="${DEFINE} -DACSNET"
  1044.  
  1045. #########################
  1046.  
  1047. LIBS=   -ltermcap
  1048. CFLAGS= -O
  1049. CC=    >cc<
  1050. RM=    >rm<
  1051. MV=     >mv<
  1052. CP=    >cp<
  1053.  
  1054. # if you want to use "nroff", change this...
  1055.  
  1056. FORMATTER = >troff<
  1057. TBL       = >tbl<
  1058.  
  1059. DOCS=   Config.guide Users.guide Ref.guide Alias.guide elm.1 from.1 \
  1060.     printmail.1 newalias.1 newmail.1 answer.1 messages.1 \
  1061.     grabalias.1 fastmail.1 readmsg.1 autoreply.1 wnewmail.1 \
  1062.     trim-headers.1
  1063.  
  1064. UTILSRC= utils/answer.c utils/arepdaemon.c utils/autoreply.c           \
  1065.     utils/fastmail.c utils/from.c utils/newalias.c \
  1066.     utils/newmail.c utils/printmail.c utils/readmsg.c utils/wnewmail.c \
  1067.     utils/trim-headers
  1068.  
  1069. ELMSRC=    src/addr_utils.c src/alias.c src/aliasdb.c src/aliaslib.c     \
  1070.     src/args.c src/bounceback.c src/connect_to.c src/curses.c     \
  1071.     src/date.c src/delete.c src/domains.c src/edit.c src/encode.c \
  1072.     src/errno.c src/file.c src/file_utils.c src/fileio.c src/hdrconfg.c \
  1073.     src/help.c src/initialize.c src/input_utils.c src/leavembox.c \
  1074.     src/mailmsg1.c src/mailmsg2.c src/mailtime.c src/mkhdrs.c     \
  1075.     src/elm.c src/newmbox.c src/notesfile.c src/opt_utils.c       \
  1076.     src/output_utils.c src/pattern.c src/quit.c src/read_rc.c     \
  1077.     src/remail.c src/reply.c src/return_addr.c src/savecopy.c     \
  1078.     src/screen.c src/showmsg.c src/signals.c src/softkeys.c       \
  1079.     src/strings.c src/syscall.c src/utils.c src/validname.c       \
  1080.     src/calendar.c src/sort.c src/getopt.c src/string2.c          \
  1081.     src/builtin.c
  1082.  
  1083. ################
  1084.  
  1085. all:    bin/elm utils 
  1086.     @echo Everything is up to date!
  1087.  
  1088. documentation:  doc/Users.fmtd doc/Ref.fmtd doc/Config.fmtd  doc/Alias.fmtd
  1089.     
  1090. doc/Users.fmtd: doc/Users.guide
  1091.     ${TBL} doc/Users.guide | ${FORMATTER} -mm > doc/Users.fmtd
  1092.  
  1093. doc/Ref.fmtd: doc/Ref.guide
  1094.     ${FORMATTER} -mm doc/Ref.guide > doc/Ref.fmtd
  1095.  
  1096. doc/Config.fmtd:  doc/Config.guide
  1097.     ${TBL} doc/Config.guide | ${FORMATTER} -mm > doc/Config.fmtd
  1098.  
  1099. doc/Alias.fmtd:  doc/Alias.guide
  1100.     ${FORMATTER} -mm doc/Alias.guide > doc/Alias.fmtd
  1101.  
  1102. bin/elm: ${ELMSRC}
  1103.     cd src;make DEFINE=${DEFINE} LIB2=${LIB2} ../bin/elm; cd ..
  1104.     
  1105. bin/utils: ${UTILSRC}
  1106.     cd utils; make DEFINE=${DEFINE} LIBS=${LIB2} all; cd ..
  1107.     @touch bin/utils
  1108.  
  1109. install: all
  1110.     ${CP} bin/elm          ${DEST}/elm
  1111.     ${CP} bin/from         ${DEST}/from
  1112.     ${CP} bin/newalias     ${DEST}/newalias
  1113.     ${CP} bin/printmail    ${DEST}/printmail
  1114.     ${CP} bin/fastmail     ${DEST}/fastmail
  1115.     ${CP} bin/readmsg      ${DEST}/readmsg
  1116.     ${CP} bin/newmail      ${DEST}/newmail
  1117.     ${CP} bin/wnewmail     ${DEST}/wnewmail
  1118.     ${CP} bin/checkalias   ${DEST}/checkalias
  1119.     ${CP} bin/messages     ${DEST}/messages
  1120.     ${CP} bin/trim-headers ${DEST}/trim-headers
  1121.     ${CP} bin/arepdaemon   ${DEST}/arepdaemon
  1122.     ${CP} bin/autoreply    ${DEST}/autoreply
  1123.     ${RM} ${CATMAN}/elm.1 ${CATMAN}/from.1 \
  1124.           ${CATMAN}/newalias.1 ${CATMAN}/printmail.1 \
  1125.           ${CATMAN}/fastmail.1 ${CATMAN}/elm.1 \
  1126.           ${CATMAN}/readmsg.1 ${CATMAN}/answer.1 \
  1127.           ${CATMAN}/newmail.1 ${CATMAN}/checkalias.1 \
  1128.           ${CATMAN}/autoreply.1 ${CATMAN}/wnewmail.1 \
  1129.           ${CATMAN}/messages.1 ${CATMAN}/trim-headers.1
  1130.     ${CP} doc/elm.1        ${MAN}/elm.1
  1131.     ${CP} doc/from.1       ${MAN}/from.1
  1132.     ${CP} doc/newalias.1   ${MAN}/newalias.1
  1133.     ${CP} doc/printmail.1  ${MAN}/printmail.1
  1134.     ${CP} doc/fastmail.1   ${MAN}/fastmail.1
  1135.     ${CP} doc/checkalias.1 ${MAN}/checkalias.1
  1136.     ${CP} doc/messages.1   ${MAN}/messages.1
  1137.     ${CP} doc/trim-headers.1 ${MAN}/trim-headers.1
  1138.     ${CP} doc/autoreply.1  ${MAN}/autoreply.1
  1139.     ${CP} doc/answer.1     ${MAN}/answer.1
  1140.     ${CP} doc/readmsg.1    ${MAN}/readmsg.1
  1141.     ${CP} doc/newmail.1    ${MAN}/newmail.1
  1142.     ${CP} doc/wnewmail.1   ${MAN}/wnewmail.1
  1143.     ${CP} doc/helpfile     ${LIB}/elm-help.main
  1144.     chmod a+rx ${DEST}/from ${DEST}/newalias \
  1145.            ${DEST}/printmail ${DEST}/fastmail \
  1146.            ${DEST}/readmsg ${DEST}/trim-headers \
  1147.            ${DEST}/checkalias ${DEST}/autoreply \
  1148.            ${DEST}/newmail ${DEST}/wnewmail ${DEST}/messages
  1149.     chgrp mail ${DEST}/elm
  1150.     chmod 2755 ${DEST}/elm
  1151.     @echo Done with installation.
  1152.  
  1153. rmt-install: remote-defined
  1154.     @echo " "
  1155.     @echo Warning: This assumes "install" has been done on the
  1156.     @echo "         remote machine.  If this is not the case you"
  1157.     @echo "         better hit BREAK quickly!"
  1158.     @echo " "
  1159.     ${CP} ${REMOTE}${DEST}/elm          ${DEST}/elm
  1160.     ${CP} ${REMOTE}${DEST}/from         ${DEST}/from
  1161.     ${CP} ${REMOTE}${DEST}/newalias     ${DEST}/newalias
  1162.     ${CP} ${REMOTE}${DEST}/printmail    ${DEST}/printmail
  1163.     ${CP} ${REMOTE}${DEST}/fastmail     ${DEST}/fastmail
  1164.     ${CP} ${REMOTE}${DEST}/readmsg      ${DEST}/readmsg
  1165.     ${CP} ${REMOTE}${DEST}/wnewmail     ${DEST}/wnewmail
  1166.     ${CP} ${REMOTE}${DEST}/newmail      ${DEST}/newmail
  1167.     ${CP} ${REMOTE}${DEST}/checkalias   ${DEST}/checkalias
  1168.     ${CP} ${REMOTE}${DEST}/messages     ${DEST}/messages
  1169.     ${CP} ${REMOTE}${DEST}/arepdaemon   ${DEST}/arepdaemon
  1170.     ${CP} ${REMOTE}${DEST}/autoreply    ${DEST}/autoreply
  1171.     ${RM} ${CATMAN}/elm.1 \
  1172.           ${CATMAN}/from.1 \
  1173.               ${CATMAN}/newalias.1 \
  1174.           ${CATMAN}/printmail.1 \
  1175.           ${CATMAN}/fastmail.1 \
  1176.               ${CATMAN}/checkalias.1 \
  1177.               ${CATMAN}/autoreply.1 \
  1178.           ${CATMAN}/readmsg.1 \
  1179.           ${CATMAN}/answer.1 \
  1180.           ${CATMAN}/newmail.1 \
  1181.           ${CATMAN}/wnewmail.1 \
  1182.               ${CATMAN}/elm.1
  1183.     ${CP} ${REMOTE}${MAN}/elm.1        ${MAN}/elm.1
  1184.     ${CP} ${REMOTE}${MAN}/from.1       ${MAN}/from.1
  1185.     ${CP} ${REMOTE}${MAN}/newalias.1   ${MAN}/newalias.1
  1186.     ${CP} ${REMOTE}${MAN}/printmail.1  ${MAN}/printmail.1
  1187.     ${CP} ${REMOTE}${MAN}/fastmail.1   ${MAN}/fastmail.1
  1188.     ${CP} ${REMOTE}${MAN}/checkalias.1 ${MAN}/checkalias.1
  1189.     ${CP} ${REMOTE}${MAN}/autoreply.1  ${MAN}/autoreply.1
  1190.     ${CP} ${REMOTE}${MAN}/readmsg.1    ${MAN}/readmsg.1
  1191.     ${CP} ${REMOTE}${MAN}/answer.1     ${MAN}/answer.1
  1192.     ${CP} ${REMOTE}${MAN}/wnewmail.1   ${MAN}/wnewmail.1
  1193.     ${CP} ${REMOTE}${MAN}/newmail.1    ${MAN}/newmail.1
  1194.     ${CP} ${REMOTE}${LIB}/elm-help.main ${LIB}/elm-help.main
  1195.     chmod a+rx ${DEST}/from ${DEST}/newalias ${DEST}/printmail \
  1196.                ${DEST}/fastmail ${DEST}/readmsg \
  1197.            ${DEST}/checkalias ${DEST}/autoreply ${DEST}/wnewmail \
  1198.            ${DEST}/newmail ${DEST}/messages
  1199.     chgrp mail ${DEST}/elm
  1200.     chmod 2755 ${DEST}/elm
  1201.     @echo everything is installed based on files from ${REMOTE}
  1202.  
  1203. source: 
  1204.     tar cvf ${TAPE} bin/makelisting utils/*.c src/*.c doc/* hdrs/* \
  1205.     Instructions Makefile UNIQ_SYMS README utils/Makefile src/Makefile \
  1206.     test/* utils/*.awk CHANGES Overview
  1207.  
  1208. # Note that the production for SHAR assumes a pretty snazzy shar program
  1209. # that can break down the output into a number of files as needed...
  1210. #   The current threshold is 60,000 bytes per file, for email/netnews
  1211.  
  1212. shar:   
  1213.     ${SHAR} *
  1214.  
  1215. lint:
  1216.     lint ${UTILSRC} > lint.out
  1217.  
  1218. listing:
  1219.     @echo listing all source files 
  1220.     @/bin/echo \\f > LISTING
  1221.     @echo adding file 'README'...
  1222.     @cat README >> LISTING
  1223.     @/bin/echo \\f >> LISTING
  1224.     @echo adding file 'Instructions...
  1225.     @cat Instructions >> LISTING
  1226.     @/bin/echo \\f >> LISTING
  1227.     @echo adding file 'Makefile'...
  1228.     @cat Makefile >> LISTING
  1229.     @bin/makelisting Makefile ${UTILSRC} src/Makefile src/*.c hdrs/*.h
  1230.     @echo LISTING generated.
  1231.  
  1232. elm-listing: 
  1233.     @echo listing just the ELM system source files
  1234.     @echo ' ' > src/LISTING
  1235.     @cd src ; make listing ; cd ..
  1236.     @echo LISTING generated \(in directory /src\).
  1237.  
  1238. clean:
  1239.     @cd src ; make clean ; cd ..
  1240.     @cd utils; make clean ; cd ..
  1241.     @echo All spurious files removed
  1242.  
  1243. elm: bin/elm
  1244. utils: bin/utils
  1245. utils/checkalias:
  1246. utils/messages:
  1247. doc/Users.guide:
  1248. doc/Ref.guide:
  1249. doc/Alias.guide:
  1250. doc/Config.guide:
  1251.  
  1252. remote-defined:
  1253.     @if ( "${REMOTE}" == "" ) then; \
  1254.        echo " " ; \
  1255.        echo "You need to define 'REMOTE' as the remote file system" ; \
  1256.        echo "for this particular command.   The easiest way to do " ; \
  1257.        echo "this is to type:" ;\
  1258.        echo "    make -f <makefile> REMOTE=<remote file system> rmt-install" ; \
  1259.        echo " " ; \
  1260.      endif
  1261.     @if ( "${REMOTE}" == "" ) exit 1
  1262. END_OF_FILE
  1263.  
  1264. chars=`cat Makefile.mstr | wc -c`
  1265.  
  1266. if [ $chars -ne 8850 ]
  1267. then
  1268.   echo File damaged in transit...should be 8850 bytes, is $chars instead
  1269.   echo  I suggest you check it closely...
  1270. fi
  1271.  
  1272.  
  1273. echo done with autodiff, part 2
  1274. exit 0
  1275.  
  1276. \SHAR_EOF
  1277.