home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1459 < prev    next >
Encoding:
Internet Message Format  |  1990-12-28  |  61.8 KB

  1. From: sob@lib.tmc.edu (Stan Barber)
  2. Newsgroups: alt.sources
  3. Subject: rrn/rn combo kit part 2 of 9
  4. Message-ID: <428@lib.tmc.edu>
  5. Date: 14 Jun 90 03:26:40 GMT
  6.  
  7. #! /bin/sh
  8.  
  9. # Make a new directory for the rn sources, cd to it, and run kits 1 thru 9 
  10. # through sh.  When all 9 kits have been run, read README.
  11.  
  12. echo "This is rn kit 2 (of 9).  If kit 2 is complete, the line"
  13. echo '"'"End of kit 2 (of 9)"'" will echo at the end.'
  14. echo ""
  15. export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
  16. echo Extracting Configure
  17. cat >Configure <<'!STUFFY!FUNK!'
  18. #!/bin/sh
  19. #
  20. # If these # comments don't work, trim them.  Don't worry about the other
  21. # shell scripts, Configure will trim # comments from them for you.
  22. #
  23. # $Header: Configure,v 4.3.2.25 90/05/12 17:34:53 sob Exp $
  24. #
  25. # $Log:    Configure,v $
  26. # Revision 4.3.2.25  90/05/12  17:34:53  sob
  27. # Still more XENIX fixes and fixes for using socketlib when rrn and not when
  28. # just rn.
  29. # Revision 4.3.2.24  90/05/12  14:07:43  sob
  30. # Fixed up LDFLAGS for xenix 286
  31. # Revision 4.3.2.23  90/05/04  00:42:31  sob
  32. # Fixes for Pyramids, more on the return value of signal() and
  33. # syncing up the use of socketlib.
  34. # Revision 4.3.2.22  90/04/17  15:44:24  sob
  35. # Added better directory structure detection.
  36. # Revision 4.3.2.21  90/04/14  19:36:38  sob
  37. # Added better support for the NeXT.
  38. # Revision 4.3.2.20  90/04/14  01:53:36  sob
  39. # Spelling Problem!
  40. # Revision 4.3.2.19  90/03/17  21:33:21  sob
  41. # Reworked VOIDSIG into SIGRET.
  42. # Revision 4.3.2.18  90/03/17  17:45:25  sob
  43. # Changes to detect when to use termio and when not to.
  44. # Revision 4.3.2.17  90/03/17  16:53:11  sob
  45. # Applied a patch to correctly determine being on a Sun running OS 4.0 or
  46. # later.
  47. # Revision 4.3.2.16  89/12/20  23:20:38  sob
  48. # Added hp-ux support suggested by tml@hemuli.atk.vtt.fi. Also,
  49. # corrected some bugs reported by tml@hemuli.atk.vtt.fi.
  50. # Revision 4.3.2.15  89/12/18  00:02:04  sob
  51. # Fixed bug reported by Jim Thompson <jthomp@sun.com> on the
  52. # use of ypmatch against the so-called services.byname YP map.
  53. # Sigh. Will YP EVER work?
  54. # Revision 4.3.2.14  89/12/17  12:55:39  sob
  55. # Minor bug fix to yp detection code.
  56. # Revision 4.3.2.13  89/12/17  01:53:21  sob
  57. # Changed from using ypcat to using ypmatch
  58. # Revision 4.3.2.12  89/12/15  19:35:20  sob
  59. # getpwent was not getting defined when YP is present.
  60. # bug reported by dglo@ads.com
  61. # Revision 4.3.2.11  89/12/13  00:42:59  sob
  62. # Included suggested patches by weening@gang-of-four.stanford.edu.
  63. # Revision 4.3.2.10  89/12/09  01:47:49  sob
  64. # Configure now removes myread when exiting.
  65. # Revision 4.3.2.9  89/12/08  22:41:14  sob
  66. # Added minor changes suggested by weening@Gang-of-Four.Stanford.EDU and
  67. # jik@pit-manager.mit.edu
  68. # Revision 4.3.2.8  89/11/28  00:30:06  sob
  69. # Attempted to make some of the references to the news software version
  70. # levels more clear for the benefit of novice news installers.
  71. # Revision 4.3.2.7  89/11/27  02:25:26  sob
  72. # Better detection of SunOS 4.0 and getpwent will be used on systems
  73. # that support YP, just in case.
  74. # Revision 4.3.2.6  89/11/27  01:32:56  sob
  75. # Added some changes suggested by various usenet postings.
  76. # Limited support for NeXT.
  77. # Revision 4.3.2.5  89/11/08  04:47:27  sob
  78. # Added VOIDSIG handling for SunOS 4.X
  79. # Revision 4.3.2.4  89/11/06  00:05:38  sob
  80. # Added RRN support originally distributed with NNTP 1.5
  81. # Revision 4.3.2.3  89/11/05  23:35:43  sob
  82. # Added checks for ultrix and sun
  83. #
  84. # Revision 4.3.1.6  86/07/24  14:41:18  lwall
  85. # Handles missing Relay-Version: from news 2.10.3 headers.
  86. #
  87. # Revision 4.3.1.5  85/05/23  11:23:22  lwall
  88. # filexp flubs sed command.
  89. # Revision 4.3.1.4  85/05/20  17:13:11  lwall
  90. # Makes sure -lcurses is really a terminfo library.
  91. # Puts single instead of double quotes around defs in config.sh.
  92. # Revision 4.3.1.3  85/05/16  16:48:48  lwall
  93. # Took space from end of filexp output.
  94. # Revision 4.3.1.2  85/05/13  15:54:35  lwall
  95. # Libraries in /usr/local/lib shouldn't use -l switch.
  96. # Revision 4.3.1.1  85/05/10  11:29:20  lwall
  97. # Branch for patches.
  98. # Revision 4.3  85/05/01  11:31:23  lwall
  99. # Baseline for release with 4.3bsd.
  100.  
  101. # Yes, you may rip this off to use in other distribution packages.
  102.  
  103. n=''
  104. c=''
  105. libc=''
  106. eunicefix=''
  107. eunice=''
  108. cpp=''
  109. shsharp=''
  110. spitshell=''
  111. startsh=''
  112. test=''
  113. expr=''
  114. sed=''
  115. echo=''
  116. cat=''
  117. rm=''
  118. mv=''
  119. cp=''
  120. tail=''
  121. tr=''
  122. mkdir=''
  123. sort=''
  124. uniq=''
  125. inews=''
  126. grep=''
  127. egrep=''
  128. ypmatch=''
  129. contains=''
  130. lib=''
  131. nametype=''
  132. cc=''
  133. iandd=''
  134. include=''
  135. rrninclude=''
  136. termlib=''
  137. jobslib=''
  138. ndirlib=''
  139. socketlib=''
  140. dirtype=''
  141. dirinc=''
  142. libndir=''
  143. usendir=''
  144. ndirc=''
  145. ndiro=''
  146. pager=''
  147. mailer=''
  148. internet=''
  149. rnbin=''
  150. filexp=''
  151. distlist=''
  152. Log=''
  153. Header=''
  154. sitename=''
  155. domain=''
  156. orgname=''
  157. isadmin=''
  158. newsadmin=''
  159. rnlib=''
  160. mansrc=''
  161. manext=''
  162. maildir=''
  163. spool=''
  164. active=''
  165. myactive=''
  166. mininact=''
  167. pref=''
  168. defeditor=''
  169. rootid=''
  170. mboxchar=''
  171. locpref=''
  172. orgpref=''
  173. citypref=''
  174. statepref=''
  175. cntrypref=''
  176. contpref=''
  177. strchr=''
  178. novoid=''
  179. novfork=''
  180. portable=''
  181. passnam=''
  182. berknam=''
  183. usgnam=''
  184. whoami=''
  185. termio=''
  186. fcntl=''
  187. ioctl=''
  188. normsig=''
  189. sigblock=''
  190. sigret=''
  191. getuidgid=''
  192. getcwd=''
  193. havetlib=''
  194. getpwent=''
  195. gethostname=''
  196. douname=''
  197. phostname=''
  198. hostcmd=''
  199. norelay=''
  200. isrrn=''
  201. rdchk=''
  202. serverfile=''
  203. NNTPSRC=''
  204. CONFIG=''
  205.  
  206. echo "Beginning of configuration questions for rn kit."
  207. : Eunice requires " " instead of "", can you believe it
  208. echo " "
  209.  
  210. : sanity checks
  211. PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc'
  212. export PATH || (echo "OOPS, this isn't sh.  Desperation time.  I will feed myself to sh."; sh $0; kill $$)
  213.  
  214. if test ! -t 0; then
  215.     echo "Type 'sh Configure', not 'sh <Configure'"
  216.     exit 1
  217. fi
  218.  
  219. : some greps do not return status, grrr.
  220. echo "grimblepritz" >grimble
  221. if grep blurfldyick grimble >/dev/null 2>&1 ; then
  222.     contains=contains
  223. else
  224.     if grep grimblepritz grimble >/dev/null 2>&1 ; then
  225.     contains=grep
  226.     else
  227.     contains=contains
  228.     fi
  229. fi
  230.  
  231. : the following should work in any shell
  232. case $contains in
  233. contains*)
  234.     echo " "
  235.     echo "AGH!  Grep doesn't return a status.  Attempting remedial action."
  236.     cat >contains <<'EOSS'
  237. grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
  238. EOSS
  239. chmod 755 contains
  240. esac
  241.  
  242. : first determine how to suppress newline on echo command
  243. echo "Checking echo to see how to suppress newlines..."
  244. (echo "hi there\c" ; echo " ") >.echotmp
  245. if $contains c .echotmp >/dev/null 2>&1 ; then
  246.     echo "...using -n."
  247.     n='-n'
  248.     c=''
  249. else
  250.     echo "...using \\\c."
  251.     n=''
  252.     c='\c'
  253. fi
  254. echo $n "Type carriage return to continue.  Your cursor should be here-->$c"
  255. read ans
  256. rm .echotmp
  257.  
  258. : now set up to do reads with possible shell escape
  259. : if this does not work on your machine, 1,$s/. myread/read ans/
  260. cat <<EOSC >myread
  261. ans='!'
  262. while expr "X\$ans" : "X!" >/dev/null; do
  263.     read ans
  264.     case "\$ans" in
  265.     !)
  266.     sh
  267.     echo " "
  268.     echo $n "Your answer: $c"
  269.     ;;
  270.     !*)
  271.     set \`expr "X\$ans" : "X!\(.*\)\$"\`
  272.     sh -c "\$*"
  273.     echo " "
  274.     echo $n "Your answer: $c"
  275.     ;;
  276.     esac
  277. done
  278. EOSC
  279.  
  280. : general instructions
  281. cat <<'EOH'
  282.  
  283. This installation shell script will examine your system and ask you questions
  284. to determine how rn and its auxiliary files should be installed.  If you
  285. get stuck on a question, you may use a ! shell escape to start a subshell or
  286. execute a command.  Many of the questions will have default answers in
  287. square brackets--typing carriage return will give you the default.
  288.  
  289. On some of the questions which ask for file or directory names you are
  290. allowed to use the ~name construct to specify the login directory belonging
  291. to "name", even if you don't have a shell which knows about that.  Questions
  292. where this is allowed will be marked "(~name ok)".
  293.  
  294. Much effort has been expended to ensure that this shell script will run
  295. on any Unix system.  If despite that it blows up on you, your best bet is
  296. to edit Configure and run it again.  (Trying to install rn without having run
  297. Configure is well nigh impossible.)  Also, tell Stan Barber (rrn@lib.tmc.edu)
  298. how he blew it.
  299.  
  300. This installation script affects things in two ways: 1) it does direct
  301. variable substitutions on some of the files included in this kit, and
  302. 2) it builds a config.h file for inclusion in C programs.  You may edit
  303. any of these files as the need arises after running this script.
  304.  
  305. EOH
  306. echo $n "[Type carriage return to continue] $c"
  307. . myread
  308. : get old answers, if there is a config file out there
  309. if test -f config.sh; then
  310.     echo " "
  311.     echo "(Fetching default answers from your old config.sh file...)"
  312.     . config.sh
  313. fi
  314.  
  315. : get list of predefined functions in a handy place
  316. echo " "
  317. if test -f /lib/libc.a; then
  318.     echo "Your C library is in /lib/libc.a.  You're normal."
  319.     libc=/lib/libc.a
  320. else
  321.     if test -f /lib/Llibc.a; then
  322.     echo "Your C library is in /lib/Llibc.a.  I smell Xenix!"
  323.     libc=/lib/Llibc.a
  324.     else
  325.     if test -f /usr/lib/libc.a; then
  326.         echo "Your C library is in /usr/lib/libc.a, of all places."
  327.         libc=/usr/lib/libc.a
  328.     else
  329.         if test -f "$libc"; then
  330.         echo "Your C library is in $libc, like you said before."
  331.         else
  332.         cat <<'EOM'
  333.  
  334. I can't seem to find your C library.  I've looked for /lib/libc.a and
  335. /usr/lib/libc.a, but neither of those are there.  What is the full name
  336. EOM
  337.         echo $n "of your C library? $c"
  338.         . myread
  339.         libc="$ans"
  340.         fi
  341.     fi
  342.     fi
  343. fi
  344. echo " "
  345. echo $n "Extracting names from $libc for later perusal...$c"
  346. if ar t $libc > libc.list; then
  347.     echo "done"
  348. else
  349.     echo " "
  350.     echo "The archiver doesn't think $libc is a reasonable library."
  351.     exit 1
  352. fi
  353. : make some quick guesses about what we are up against
  354. echo " "
  355. echo $n "Hmm...  $c"
  356. if $contains SIGTSTP /usr/include/signal.h >/dev/null 2>&1 ; then
  357.     echo "Looks kind of like a BSD system, but we'll see..."
  358.     echo exit 0 >bsd
  359.     echo exit 1 >usg
  360.     echo exit 1 >v7
  361. else
  362.     if $contains SIGTSTP /usr/include/sys/signal.h >/dev/null 2>&1 ; then
  363.     echo "Looks sort of like a BSD system, but we'll see..."
  364.     echo exit 0 >bsd
  365.     echo exit 1 >usg
  366.     echo exit 1 >v7
  367.     else
  368.     if $contains fcntl.o libc.list >/dev/null 2>&1 ; then
  369.         echo "Looks kind of like a USG system, but we'll see..."
  370.         echo exit 1 >bsd
  371.         echo exit 0 >usg
  372.         echo exit 1 >v7
  373.     else
  374.         echo "Looks kind of like a version 7 system, but we'll see..."
  375.         echo exit 1 >bsd
  376.         echo exit 1 >usg
  377.         echo exit 0 >v7
  378.     fi
  379.     fi
  380. fi
  381. if $contains vmssystem.o libc.list >/dev/null 2>&1 ; then
  382.     cat <<'EOI'
  383. There is, however, a strange, musty smell in the air that reminds me of
  384. something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
  385. EOI
  386.     echo "exit 0" >eunice
  387.     eunicefix=unixtovms
  388.     eunice=define
  389. : it so happens the Eunice I know will not run shell scripts in Unix format
  390. else
  391.     echo " "
  392.     echo "Congratulations.  You aren't running Eunice."
  393.     eunicefix=':'
  394.     eunice=undef
  395.     echo "exit 1" >eunice
  396. fi
  397. chmod 755 bsd usg v7 eunice
  398. $eunicefix bsd usg v7 eunice
  399. : see how we invoke the C preprocessor
  400. echo " "
  401. echo "Checking to see how your C preprocessor is invoked..."
  402. cat <<'EOT' >testcpp.c
  403. #define ABC abc
  404. #define XYZ xyz
  405. ABC+XYZ
  406. EOT
  407. echo 'Maybe "cc -E" will work...'
  408. cc -E testcpp.c >testcpp.out 2>&1
  409. if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  410.     echo "Yup, it does."
  411.     cpp='cc -E'
  412. else
  413.     echo 'Nope...maybe "cc -P" will work...'
  414.     cc -P testcpp.c >testcpp.out 2>&1
  415.     if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  416.     echo "Yup, that does."
  417.     cpp='cc -P'
  418.     else
  419.     echo 'Nixed again...maybe "/lib/cpp" will work...'
  420.     /lib/cpp testcpp.c >testcpp.out 2>&1
  421.     if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  422.         echo "Hooray, it works!  I was beginning to wonder."
  423.         cpp='/lib/cpp'
  424.     else
  425.         if $contains 'abc +xyz' testcpp.out >/dev/null 2>&1 ; then
  426.         echo "Found it!  You're on a NeXT, aren't you?"
  427.         cpp='/lib/cpp'
  428.         else
  429.         echo 'Hmm...maybe you already told me...'
  430.         case "$cpp" in
  431.         '') ;;
  432.         *) $cpp testcpp.c >testcpp.out 2>&1;;
  433.         esac
  434.         if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  435.             echo "Hooray, you did!  I was beginning to wonder."
  436.         else
  437.             echo "Nope. I can't find a C preprocessor.  Name one: $c"
  438.             . myread
  439.             cpp="$ans"
  440.             $cpp testcpp.c >testcpp.out 2>&1
  441.             if $contains 'abc+xyz' testcpp.out >/dev/null 2>&1 ; then
  442.             echo "OK, that will do."
  443.             else
  444.             echo "Sorry, I can't get that to work.  Go find one."
  445.             exit 1
  446.             fi
  447.         fi
  448.         fi
  449.     fi
  450.     fi
  451. fi
  452. rm -f testcpp.c testcpp.out
  453. : check for pdp11
  454. echo " "
  455. cat <<'EOT' >pdp11.c
  456. #ifdef pdp11
  457. exit 0
  458. #else
  459. exit 1
  460. #endif
  461. EOT
  462. $cpp pdp11.c | grep exit >pdp11
  463. chmod 755 pdp11
  464. $eunicefix pdp11
  465. rm pdp11.c
  466. if pdp11; then
  467.     echo "This looks like a pdp11 to me."
  468. fi
  469. : check for ultrix
  470. cat <<'EOT' >ultrix.c
  471. #ifdef ultrix
  472. exit 0
  473. #else
  474. exit 1
  475. #endif
  476. EOT
  477. $cpp ultrix.c | grep exit >ultrix
  478. chmod 755 ultrix
  479. $eunicefix ultrix
  480. rm ultrix.c
  481. if ultrix; then
  482.     echo "Running ultrix, eh?"
  483. fi
  484.  
  485. : check for sun 4.0
  486. cat <<'EOT' >sun.c
  487. #ifdef sun
  488. exit 0
  489. #else
  490. exit 1
  491. #endif
  492. EOT
  493. $cpp sun.c | grep exit >sun
  494. chmod 755 sun
  495. $eunicefix sun
  496. rm sun.c
  497. if sun; then
  498.     echo "This looks like a sun to me."
  499.     if test -f /etc/ld.so.cache ; then
  500.     echo "And it appears you are running SunOS 4.0 or greater."
  501.     fi
  502. fi
  503. : check for hp-ux
  504. cat <<'EOT' >hp-ux.c
  505. #ifdef hpux
  506. exit 0
  507. #else
  508. exit 1
  509. #endif
  510. EOT
  511. $cpp hp-ux.c | grep exit >hp-ux
  512. chmod 755 hp-ux
  513. $eunicefix hp-ux
  514. rm hp-ux.c
  515. if hp-ux; then
  516.     echo "Hewlett-Packard must have built this..."
  517.     socketlib=-lbsdipc
  518. fi
  519.  
  520. : check for sgi
  521. cat <<'EOT' >sgi.c
  522. #ifdef sgi
  523. exit 0
  524. #else
  525. exit 1
  526. #endif
  527. EOT
  528. $cpp sgi.c | grep exit >sgi
  529. chmod 755 sgi
  530. $eunicefix sgi
  531. rm sgi.c
  532. if sgi; then
  533.     echo "Silicon Graphics must have built this..."
  534.     include=-I/usr/include/bsd
  535.     rrninclude="-I/usr/include/bsd -DUSG"
  536.     socketlib=-lbsd
  537. fi
  538.  
  539. : check for XENIX
  540. cat <<'EOT' >xenix.c
  541. #ifdef M_XENIX
  542. exit 0
  543. #else
  544. exit 1
  545. #endif
  546. EOT
  547. $cpp xenix.c | grep exit >xenix
  548. chmod 755 xenix
  549. $eunicefix xenix
  550. rm xenix.c
  551. if xenix; then
  552.     echo "Kinda looks like XENIX....hmmm"
  553.     rrninclude="-DUSG -DLAI_TCP"
  554.     socketlib=-lsocket
  555.     sigret=void
  556.     rdchk=define
  557.     dirtype=dirent
  558. else
  559.     rdchk=undef
  560. fi
  561.  
  562. : check for Pyramid OSx
  563. cat <<'EOT' >pyr.c
  564. #ifdef pyr
  565. exit 0
  566. #else
  567. exit 1
  568. #endif
  569. EOT
  570. $cpp pyr.c | grep exit >pyr
  571. chmod 755 pyr
  572. $eunicefix pyr
  573. rm pyr.c
  574. if pyr; then
  575.     echo "This looks like a Pyramid to me."
  576. fi
  577.  
  578. if bsd; then
  579.     getuidgid=define
  580. else
  581.     getuidgid=undef
  582. fi
  583.  
  584. : see if sh knows # comments
  585. echo " "
  586. echo "Checking your sh to see if it knows about # comments..."
  587. if sh -c '#' >/dev/null 2>&1 ; then
  588.     echo "Your sh handles # comments correctly."
  589.     shsharp=true
  590.     spitshell=cat
  591.     echo " "
  592.     echo "Okay, let's see if #! works on this system..."
  593.     echo "#!/bin/echo hi" > try
  594.     $eunicefix try
  595.     chmod 755 try
  596.     try > today
  597.     if test -s today; then
  598.     echo "It does."
  599.     sharpbang='#!'
  600.     else
  601.     echo "#! /bin/echo hi" > try
  602.     $eunicefix try
  603.     chmod 755 try
  604.     try > today
  605.     if test -s today; then
  606.         echo "It does."
  607.         sharpbang='#! '
  608.     else
  609.         echo "It doesn't."
  610.         sharpbang=': use '
  611.     fi
  612.     fi
  613. else
  614.     echo "Your sh doesn't grok # comments--I will strip them later on."
  615.     shsharp=false
  616.     echo "exec grep -v '^#'" >spitshell
  617.     chmod 755 spitshell
  618.     $eunicefix spitshell
  619.     spitshell=`pwd`/spitshell
  620.     echo "I presume that if # doesn't work, #! won't work either!"
  621.     sharpbang=': use '
  622. fi
  623.  
  624. : figure out how to guarantee sh startup
  625. echo " "
  626. echo "Checking out how to guarantee sh startup..."
  627. startsh=$sharpbang'/bin/sh'
  628. echo "Let's see if '$startsh' works..."
  629. cat >try <<EOSS
  630. $startsh
  631. set abc
  632. test "$?abc" != 1
  633. EOSS
  634.  
  635. chmod 755 try
  636. $eunicefix try
  637. if try; then
  638.     echo "Yup, it does."
  639. else
  640.     echo "Nope.  You may have to fix up the shell scripts to make sure sh runs them."
  641. fi
  642. rm -f try today
  643.  
  644. : find out where common programs are
  645. echo " "
  646. echo "Locating common programs..."
  647. pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /usr/etc /usr/5bin"
  648. cat <<EOSC >loc
  649. $startsh
  650. thing=\$1
  651. shift
  652. dflt=\$1
  653. shift
  654. for dir in \$*; do
  655.     case "\$thing" in
  656.     .)
  657.     if test -d \$dir/\$thing; then
  658.         echo \$dir
  659.         exit 0
  660.     fi
  661.     ;;
  662.     *)
  663.     if test -f \$dir/\$thing; then
  664.         echo \$dir/\$thing
  665.         exit 0
  666.     fi
  667.     ;;
  668.     esac
  669. done
  670. echo \$dflt
  671. exit 1
  672. EOSC
  673. chmod 755 loc
  674. $eunicefix loc
  675. loclist="expr sed echo cat rm mv cp tail tr mkdir sort uniq grep"
  676. trylist="test inews egrep more pg Mcc ypmatch"
  677. for file in $loclist; do
  678.     xxx=`loc $file $file $pth`
  679.     eval $file=$xxx
  680.     case "$xxx" in
  681.     /*)
  682.     echo $file is in $xxx.
  683.     ;;
  684.     *)
  685.     echo "I don't know where $file is.  I hope it's in everyone's PATH."
  686.     ;;
  687.     esac
  688. done
  689. echo " "
  690. echo "Don't worry if any of the following aren't found..."
  691. for file in $trylist; do
  692.     xxx=`loc $file $file $pth`
  693.     eval $file=$xxx
  694.     case "$xxx" in
  695.     /*)
  696.     echo $file is in $xxx.
  697.     ;;
  698.     *)
  699.     echo "I don't see $file out there, offhand."
  700.     ;;
  701.     esac
  702. done
  703. case $egrep in
  704. egrep)
  705.     echo "Substituting grep for egrep."
  706.     egrep=$grep
  707.     ;;
  708. esac
  709. case $test in
  710. test)
  711.     echo "Hopefully test is built into your sh."
  712.     ;;
  713. /bin/test)
  714.     echo " "
  715.     echo $n 'Is your "test" built into sh? [n] (OK to guess) '"$c"
  716.     . myread
  717.     case $ans in
  718.     y*) test=test ;;
  719.     esac
  720.     ;;
  721. *)
  722.     test=test
  723.     ;;
  724. esac
  725. case $echo in
  726. echo)
  727.     echo "Hopefully echo is built into your sh."
  728.     ;;
  729. /bin/echo)
  730.     echo " "
  731.     echo "Checking compatibility between /bin/echo and builtin echo (if any)..."
  732.     $echo $n "hi there$c" >foo1
  733.     echo $n "hi there$c" >foo2
  734.     if cmp foo1 foo2 >/dev/null 2>&1; then
  735.     echo "They are compatible.  In fact, they may be identical."
  736.     else
  737.     echo "They are not compatible--the echo builtin will be used."
  738.     echo=echo
  739.     fi
  740.     $rm -f foo1 foo2
  741.     ;;
  742. *)
  743.     echo=echo
  744.     ;;
  745. esac
  746. $echo " "
  747. : test yp
  748. case $ypmatch in
  749. ypmatch)
  750.     $echo "I don't see ypmatch out there, so YP is not available. We'll search the"
  751.     $echo "passwd file the old fashioned way!"
  752.     ;;
  753. *)
  754.     $ypmatch 513/tcp services > /dev/null 2>/dev/null
  755.     status=$?
  756.     if $test $status  -ne 0 ; then
  757.     $echo "YP installed, but not operational. We won't use it."
  758.     else
  759.         $echo "YP installed and operational."
  760.     fi
  761.     
  762.     ;;
  763. esac
  764. if $test "$ypmatch" = "ypmatch"; then
  765.     ypmatch=""
  766. fi
  767.  
  768. : decide how portable to be
  769. case "$portable" in
  770. define) dflt=y;;
  771. *)    dflt=n;;
  772. esac
  773. $cat <<'EOH'
  774.  
  775. I can set things up so that your shell scripts and binaries are more portable,
  776. at what may be a noticable cost in performance.  In particular, if you
  777. ask to be portable, the following happens:
  778.  
  779.      1) shell scripts will rely on the PATH variable rather than using
  780.     the paths derived above.
  781.      2) ~username interpretations will be done at run time rather than
  782.     by Configure.
  783.      3) the system name will be determined at run time, if at all possible.
  784.  
  785. EOH
  786. $echo $n "Do you expect to run these scripts and binaries on multiple machines? [$dflt] $c"
  787. . myread
  788. case $ans in
  789. '') ans=$dflt;;
  790. esac
  791. case $ans in
  792.     y*) portable=define
  793.     for file in $loclist; do
  794.         eval $file=$file
  795.     done
  796.     ;;
  797.     *)  portable=undef ;;
  798. esac
  799.  
  800. : set up shell script to do ~ expansion
  801. cat >filexp <<EOSS
  802. $startsh
  803. : expand filename
  804. case \$1 in
  805. ~/*|~)
  806.     $echo \$1 | $sed "s|~|\${HOME-\$LOGDIR}|"
  807.     ;;
  808. ~*)
  809.     if $test -f /bin/csh; then
  810.     /bin/csh -f -c "glob \$1"
  811.     $echo ""
  812.     else
  813.     name=\`$expr x\$1 : '..\([^/]*\)'\`
  814.     if $test "$ypmatch" != ""; then
  815.          dir=\`$ypmatch \$name passwd 2>/dev/null | $sed "s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/"'\`
  816.     fi
  817.     if $test "\$dir" = ""; then
  818.         dir=\`$sed </etc/passwd -n -e "/^\${name}:/{s/^[^:]*:[^:]*:[^:]*:[^:]*:[^:]*:\([^:]*\).*"'\$'"/\1/" -e p -e q -e '}'\`
  819.     fi
  820.     if $test ! -d "\$dir"; then
  821.         me=\`basename \$0\`
  822.         $echo "\$me: can't locate home directory for: \$name" >&2
  823.         exit 1
  824.     fi
  825.     case \$1 in
  826.     */*)
  827.         $echo \$dir/\`$expr x\$1 : '..[^/]*/\(.*\)'\`
  828.         ;;
  829.     *)
  830.         $echo \$dir
  831.         ;;
  832.     esac
  833.     fi
  834.     ;;
  835. *)
  836.     $echo \$1
  837.     ;;
  838. esac
  839. EOSS
  840. chmod 755 filexp
  841. $eunicefix filexp
  842.  
  843. : now get the site name
  844. $echo " "
  845. $echo "Figuring out site name..."
  846. $echo 'Maybe "hostname" will work...'
  847. if ans=`sh -c hostname 2>&1` ; then
  848.     sitename=$ans
  849.     hostcmd=hostname
  850. else
  851.     $echo 'No, maybe "uuname -l" will work...'
  852.     if ans=`sh -c 'uuname -l' 2>&1` ; then
  853.     sitename=$ans
  854.     hostcmd='uuname -l'
  855.     else
  856.     $echo 'Strange.  Maybe "uname -n" will work...'
  857.     if ans=`sh -c 'uname -n' 2>&1` ; then
  858.         sitename=$ans
  859.         hostcmd='uname -n'
  860.     else
  861.         $echo 'Oh well, maybe I can mine it out of whoami.h...'
  862.         if ans=`sh -c $contains' sysname /usr/include/whoami.h' 2>&1` ; then
  863.         sitename=`$echo "$ans" | $sed 's/^.*"\(.*\)"/\1/'`
  864.         hostcmd="sed -n -e '"'/sysname/s/^.*\"\\(.*\\)\"/\1/{'"' -e p -e q -e '}' </usr/include/whoami.h"
  865.         else
  866.         case "$sitename" in
  867.         '') $echo "Does this machine have an identity crisis or something?"
  868.             hostcmd=''
  869.             ;;
  870.         *)  $echo "Well, you said $sitename before...";;
  871.         esac
  872.         fi
  873.     fi
  874.     fi
  875. fi
  876. : you do not want to know about this
  877. set $sitename
  878. sitename=$1
  879.  
  880. : translate upper to lower case. This is mostly to help UUCP work right.
  881. case $sitename in
  882.     *[A-Z]*)
  883.     sitename=`$echo $sitename | tr '[A-Z]' '[a-z]'`
  884.     $echo "(Normalizing case in your site name)"
  885.     ;;
  886. esac
  887.  
  888. : verify guess
  889. if $test "$sitename" ; then
  890.     $echo 'Your site name appears to be "'$sitename'".'
  891.     $echo $n "Is this correct? [y] $c"
  892.     . myread
  893.     case $ans in
  894.       y*|'')  ;;
  895.       *)      sitename='' ;;
  896.     esac
  897. fi
  898.  
  899. : bad guess or no guess
  900. while $test "X$sitename" = X ; do
  901.     $echo $n "Please type the (one word) name of your site: $c"
  902.     . myread
  903.     sitename="$ans"
  904.     case $hostcmd in
  905.     sed*)
  906.     $echo "(That doesn't agree with your whoami.h file, by the way.)"
  907.     ;;
  908.     *)
  909.     $echo "(That doesn't agree with your $hostcmd command, by the way.)"
  910.     ;;
  911.     esac
  912.     hostcmd=''
  913. done
  914.  
  915. : try to deal with domains
  916. $cat << 'EOH'
  917.  
  918. Please enter your domain name.  This will be used in conjunction
  919. with the site name for return addresses on news articles and
  920. mail.  If you use the 4.3ism of having your domain in your
  921. hostname, all the posting programs will figure this out on the
  922. fly, so don't worry.
  923.  
  924. Examples of some valid domains:
  925.  
  926.     berkeley.edu
  927.     nasa.gov
  928. Example of an invalid domain in common use:
  929.     uucp
  930. EOH
  931.  
  932. case "$domain" in
  933. '') dflt="uucp";;
  934. *)  dflt="$domain" ;;
  935. esac
  936. $echo $n "Your domain: [$dflt] $c"
  937. . myread
  938. case "$ans" in
  939. '') domain="$dflt";;
  940. *)  domain="$ans" ;;
  941. esac
  942.  
  943. if $test $portable = "undef" ; then
  944.     case $sitename in
  945.     *.*)    ;;
  946.     *)    sitename=$sitename.$domain
  947.         ;;
  948.     esac
  949. fi
  950.  
  951. : get organizaton name
  952. longshots='/usr/src/new /usr/src/local /usr/local/src'
  953. case "$orgname" in
  954. '') if xxx=`loc news/src/defs.h x $longshots`; then
  955.     dflt=`$sed -n 's/^.*MYORG[     ]*"\(.*\)".*$/\1/p' $xxx`
  956.     else
  957.     dflt='no default'
  958.     fi
  959.     ;;
  960. *)  dflt="$orgname";;
  961. esac
  962. $cat << 'EOH'
  963.  
  964. Please type the name of your organization as you want it to appear on the
  965. Organization line of outgoing articles.  (It's nice if this also specifies
  966. your location.  Your city name is probably sufficient if well known.)
  967. For example:
  968.  
  969.     University of Southern North Dakota, Hoople
  970.  
  971. You may also put the name of a file, as long as it begins with a slash.
  972. For example:
  973.  
  974.     /etc/organization
  975.  
  976. EOH
  977. orgname="no default"
  978. while test "X$orgname" = "Xno default"; do
  979.     $echo $n "Organization: [$dflt] $c"
  980.     . myread
  981.     case "$ans" in
  982.     '') orgname="$dflt";;
  983.     *)  orgname="$ans" ;;
  984.     esac
  985. done
  986.  
  987. : get news administrator name
  988. case "$newsadmin" in
  989. '')
  990.     if $contains "^news:" /etc/passwd >/dev/null 2>&1 ; then
  991.     dflt=news
  992.     else
  993.     if $contains "^usenet:" /etc/passwd >/dev/null 2>&1 ; then
  994.         dflt=usenet
  995.     else
  996.         if eunice; then
  997.         dflt=system
  998.         else
  999.         dflt=root
  1000.         fi
  1001.     fi
  1002.     fi
  1003.     ;;
  1004. *)  dflt="$newsadmin"
  1005.     ;;
  1006. esac
  1007. cat <<'EOM'
  1008.  
  1009. Many systems keep their news in a private directory, or have a non-superuser
  1010. in charge of administering news.  (If you don't have such a user, take the
  1011. default answer.)  What is the login name (not directory) that is used for news
  1012. EOM
  1013. $echo $n "administration? [$dflt] $c"
  1014. . myread
  1015. newsadmin="$ans"
  1016. case $newsadmin in
  1017. '') newsadmin=$dflt ;;
  1018. esac
  1019. case $newsadmin in
  1020. root) isadmin=undef ;;
  1021. *)    isadmin=define ;;
  1022. esac
  1023.  
  1024. : figure out news library
  1025. case "$lib" in
  1026. '')
  1027.     dflt=/usr/lib/news
  1028.     ;;
  1029. *)  dflt=$lib ;;
  1030. esac
  1031. libexp=$lib
  1032. libexp='blurfl/dyick'
  1033. while $test ! -d "$libexp"; do
  1034.     $echo " "
  1035.     case "$libexp" in
  1036.     blurfl*) ;;
  1037.     *) $echo "Directory $libexp not found";;
  1038.     esac
  1039.     $echo "(If you are building this as rrn, it is a good idea"
  1040.     $echo "to make your news library directory the same as where the rn"
  1041.     $echo "library directory is, usually /usr/local/lib/rn)"
  1042.     $echo " "
  1043.     $echo $n "Where is your news library (~name okay)? [$dflt] $c"
  1044.     . myread
  1045.     case "$ans" in
  1046.     '') ans="$dflt";;
  1047.     esac
  1048.     lib="$ans"
  1049.     case $lib in
  1050.     ~*)
  1051.     libexp=`filexp $lib`
  1052.     $echo "(That is $libexp on this particular system.)"
  1053.     case $portable in
  1054.       undef) lib=$libexp ;;
  1055.     esac
  1056.     ;;
  1057.     *)
  1058.     libexp=$lib
  1059.     ;;
  1060.     esac
  1061. done
  1062. if $test -f $libexp/inews; then
  1063.     $echo "Aha!  Inews is really in $libexp!"
  1064.     $echo "Maybe this is Bnews 2.10.2 or later, or rrn."
  1065.     inews=$libexp/inews
  1066. fi
  1067.  
  1068. : determine where manual pages go
  1069. case "$mansrc" in
  1070. '')
  1071.     dflt=`loc . /usr/man/man1 /usr/man/mann /usr/man/local/man1 /usr/man/u_man/man1 /usr/man/man1`
  1072.     ;;
  1073. *)  dflt="$mansrc"
  1074.     ;;
  1075. esac
  1076. mansrc='blurfl/dyick'
  1077. while $test ! -d "$mansrc" ; do
  1078.     case $mansrc in
  1079.       blurfl*) ;;
  1080.       *) $echo "$mansrc does not appear to exist." ;;
  1081.     esac
  1082.     $echo " "
  1083.     $echo $n "Where do the manual pages (source) go? [$dflt] $c"
  1084.     . myread
  1085.     mansrc=`filexp "$ans"`
  1086.     case $mansrc in
  1087.       '') mansrc=$dflt ;;
  1088.     esac
  1089. done
  1090. case "$mansrc" in
  1091. *l)
  1092.     manext=l
  1093.     ;;
  1094. *n)
  1095.     manext=n
  1096.     ;;
  1097. *)
  1098.     manext=1
  1099.     ;;
  1100. esac
  1101.  
  1102. : determine where mail is spooled
  1103. case "$maildir" in
  1104. '')
  1105.     dflt=`loc . /usr/spool/mail /usr/spool/mail /usr/mail`
  1106.     ;;
  1107. *)  dflt="$maildir"
  1108.     ;;
  1109. esac
  1110. maildir='blurfl/dyick'
  1111. while $test ! -d "$maildir" ; do
  1112.     case $maildir in
  1113.       blurfl*) ;;
  1114.       *) $echo "$maildir does not appear to exist." ;;
  1115.     esac
  1116.     $echo " "
  1117.     $echo $n "Where is yet-to-be-read mail spooled? [$dflt] $c"
  1118.     . myread
  1119.     maildir=`filexp "$ans"`
  1120.     case $maildir in
  1121.       '') maildir=$dflt ;;
  1122.     esac
  1123. done
  1124.  
  1125. : find out how to find out full name
  1126. $echo " "
  1127. case "$berkname" in
  1128. define)
  1129.     dflt=y;;
  1130. undef)
  1131.     dflt=n;;
  1132. *)
  1133.     if bsd; then
  1134.     dflt=y
  1135.     else
  1136.     dflt=n
  1137.     fi
  1138.     ;;
  1139. esac
  1140. $echo "Does your /etc/passwd file keep full names in Berkeley/V7 format (name first"
  1141. $echo $n "thing after ':' in GCOS field)? [$dflt] $c"
  1142. . myread
  1143. case $ans in
  1144.   '') ans=$dflt ;;
  1145. esac
  1146. case $ans in
  1147.   y*)
  1148.     passnam=define
  1149.     berknam=define
  1150.     usgnam=undef
  1151.     nametype=bsd
  1152.     ;;
  1153.   *)
  1154.     $echo " "
  1155.     case "$usgname" in
  1156.     define)
  1157.     dflt=y;;
  1158.     undef)
  1159.     dflt=n;;
  1160.     *)
  1161.     if usg; then
  1162.         dflt=y
  1163.     else
  1164.         dflt=n
  1165.     fi
  1166.     ;;
  1167.     esac
  1168.     $echo "Does your passwd file keep full names in USG format (name sandwiched"
  1169.     $echo $n "between a '-' and a '(')? [$dflt] $c"
  1170.     . myread
  1171.     case $ans in
  1172.       '') ans=$dflt ;;
  1173.     esac
  1174.     case $ans in
  1175.       n*)
  1176.     $echo "Full name will be taken from ~/.fullname"
  1177.     passnam=undef
  1178.     berknam=undef
  1179.     usgnam=undef
  1180.     nametype=other
  1181.     ;;
  1182.       *)
  1183.     passnam=define
  1184.     berknam=undef
  1185.     usgnam=define
  1186.     nametype=usg
  1187.     ;;
  1188.     esac
  1189.     ;;
  1190. esac
  1191.  
  1192. : see if we need a special compiler
  1193. $echo " "
  1194. if usg; then
  1195.     case "$cc" in
  1196.     '')
  1197.     case "$Mcc" in
  1198.     /*) dflt='Mcc'
  1199.         ;;
  1200.     *)
  1201.         if $contains '\-M' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1202.         dflt='cc -M'
  1203.         else
  1204.         dflt='cc'
  1205.         fi
  1206.         ;;
  1207.     esac
  1208.     ;;
  1209.     *)  dflt="$cc";;
  1210.     esac
  1211.     $cat <<'EOM'
  1212.  
  1213. On some systems the default C compiler will not resolve multiple global
  1214. references that happen to have the same name.  On some such systems the
  1215. "Mcc" command may be used to force these to be resolved.  On other systems
  1216. a "cc -M" command is required.  What command will force resolution on
  1217. EOM
  1218.     $echo $n "this system? [$dflt] $c"
  1219.     . myread
  1220.     cc="$ans"
  1221.     case "$cc" in
  1222.     '') cc="$dflt" ;;
  1223.     esac
  1224. else
  1225.     $echo "Not a USG system--assuming cc can resolve multiple definitions."
  1226.     cc=cc
  1227. fi
  1228.  
  1229. : see if we should throw a -i into the Makefile
  1230. $echo " "
  1231. if pdp11; then
  1232.     if $contains '\-i' $mansrc/cc.1 >/dev/null 2>&1 ; then
  1233.     $echo $n "Your system appears to have separate I and D space.  Is this true? [y] $c"
  1234.     . myread
  1235.     case $ans in
  1236.         n*|f*) iandd='' ;;
  1237.         *)     iandd='-i' ;;
  1238.     esac
  1239.     else
  1240.     $echo "Your system appears to NOT have separate I and D space."
  1241.     $echo $n "Is this correct? [y] $c"
  1242.     . myread
  1243.     case $ans in
  1244.         n*|f*) iandd='-i' ;;
  1245.         *)     iandd='' ;;
  1246.     esac
  1247.     fi
  1248. else
  1249.     $echo "Not a pdp11--assuming no separate I and D."
  1250. fi
  1251.  
  1252. : index or strcpy
  1253. $echo " "
  1254. if $contains index.o libc.list >/dev/null 2>&1 ; then
  1255.     $echo "Your system appears to use index() and rindex() rather than strchr()"
  1256.     $echo $n "and strrchr().  Is this correct? [y] $c"
  1257.     . myread
  1258.     case $ans in
  1259.     n*|f*) strchr='define' ;;
  1260.     *)     strchr='undef' ;;
  1261.     esac
  1262. else
  1263.     $echo "Your system appears to use strchr() and strrchr() rather than index()"
  1264.     $echo $n "and rindex().  Is this correct? [y] $c"
  1265.     . myread
  1266.     case $ans in
  1267.     n*|f*) strchr=undef ;;
  1268.     *)     strchr=define ;;
  1269.     esac
  1270. fi
  1271.  
  1272. : determine how to determine when a file is a mailbox
  1273. case "$mboxchar" in
  1274. '') dflt=F;;
  1275. *)  dflt="$mboxchar";;
  1276. esac
  1277. $cat <<'EOM'
  1278.  
  1279. In saving articles, rn wants to differentiate between saving to mailbox
  1280. format files and normal files.  It does this by examining the first character
  1281. of the file in question.  On most systems the first line starts "From...",
  1282. so the first character is F.  On other systems there are magic cookies like
  1283. control codes between articles, so one of those would be first.  On your
  1284. system, if a file is in mailbox format, what is the first character of
  1285. EOM
  1286. $echo $n "that file? [$dflt] $c"
  1287. . myread
  1288. mboxchar="$ans"
  1289. case $mboxchar in
  1290. '') mboxchar="$dflt" ;;
  1291. esac
  1292. case $mboxchar in
  1293. 'F') ;;
  1294. *)  cat <<'EOM'
  1295. You will need to edit the shell script mbox.saver to properly append an
  1296. article to a mailbox.  The arguments to the script are documented in
  1297. EOM
  1298.     case $shsharp in
  1299.     false)
  1300.     $echo "comments in mbox.saver.std."
  1301.     ;;
  1302.     true)
  1303.     $echo "comments in the shell script itself."
  1304.     ;;
  1305.     esac
  1306. esac
  1307. $rm -f grimble
  1308. : where do we get termlib routines from
  1309. $echo " "
  1310. ans=`loc libcurses.a x /usr/lib /usr/local/lib /lib`
  1311. case "$ans" in
  1312. /*)
  1313.     ar t $ans >grimble
  1314.     if $contains tputs.o grimble >/dev/null 2>&1; then
  1315.     termlib='-lcurses'
  1316.     havetlib=define
  1317.     $echo "Terminfo library found."
  1318.     else
  1319.     ans=x
  1320.     fi
  1321.     ;;
  1322. esac
  1323. case "$ans" in
  1324. x)
  1325.     ans=`loc libtermlib.a x /usr/lib /usr/local/lib /lib`
  1326.     case "$ans" in
  1327.     /usr/lib*|/lib*)
  1328.     termlib='-ltermlib'
  1329.     havetlib=define
  1330.     $echo "Termlib library found."
  1331.     ;;
  1332.     /*)
  1333.     termlib="$ans"
  1334.     havetlib=define
  1335.     $echo "Termlib library found."
  1336.     ;;
  1337.     *)
  1338.     if xenix; then
  1339.         ans=/lib/Llibtermcap.a
  1340.     else
  1341.         ans=`loc libtermcap.a x /usr/lib /usr/local/lib /lib`
  1342.     fi
  1343.     case "$ans" in
  1344.     /usr/lib*|/lib*)
  1345.         termlib='-ltermcap'
  1346.         havetlib=define
  1347.         $echo "Termcap library found."
  1348.         ;;
  1349.     /*)
  1350.         termlib="$ans"
  1351.         havetlib=define
  1352.         $echo "Termcap library found."
  1353.         ;;
  1354.     *)
  1355.         case "$termlib" in
  1356.         '')
  1357.         $echo $n "Your system appears to NOT have termlib-style routines.  Is this true? [y] $c"
  1358.         . myread
  1359.         case $ans in
  1360.             n*|f*) havetlib=define
  1361.               $echo "Then where are the termlib-style routines kept (specify either -llibname"
  1362.               $echo $n " or full pathname (~name ok))? $c"
  1363.               . myread
  1364.               termlib=`filexp $ans`
  1365.               ;;
  1366.             *)    havetlib=undef
  1367.               termlib=''
  1368.               $echo "You will have to play around with term.c then."
  1369.               ;;
  1370.         esac
  1371.         $echo " "
  1372.         ;;
  1373.         *)  $echo "You said termlib was $termlib before."
  1374.         ;;
  1375.         esac
  1376.         ;;
  1377.     esac
  1378.     ;;
  1379.     esac
  1380.     ;;
  1381. esac
  1382. : see if there is a whoami file
  1383. if $test -r /usr/include/whoami.h ; then
  1384.     whoami=define
  1385.     $echo "whoami.h found."
  1386. else
  1387.     whoami=undef
  1388. fi
  1389.  
  1390. : see if this is a termio system
  1391. ultrix ; ultrix=$?
  1392. sun ; sun=$?
  1393. pyr ; pyr=$?
  1394. if $test -r /usr/include/termio.h -a $ultrix -ne 0 -a $sun -ne 0 -a $pyr -ne 0; then
  1395.       termio=define
  1396.       $echo "termio.h found."
  1397.   else
  1398.     if $test -r /usr/include/sgtty.h ; then
  1399.     termio=undef
  1400.     $echo "sgtty.h found."
  1401.     else
  1402.     termio=undef
  1403.     $echo "Neither termio.h nor sgtty.h found--you could have problems."
  1404.     fi
  1405. fi
  1406.  
  1407. : see if this system has fcntl
  1408. if $test -r /usr/include/fcntl.h ; then
  1409.     fcntl=define
  1410.     $echo "fcntl.h found."
  1411. else
  1412.     fcntl=undef
  1413.     $echo "No fcntl.h found, but that's ok."
  1414. fi
  1415.  
  1416. : see if ioctl defs are in sgtty/termio or sys/ioctl
  1417. if $test -r /usr/include/sys/ioctl.h ; then
  1418.     ioctl=define
  1419.     $echo "sys/ioctl.h found."
  1420. else
  1421.     ioctl=undef
  1422.     $echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h."
  1423. fi
  1424.  
  1425. : see if the system has sigblock
  1426. if $contains sigblock.o libc.list >/dev/null 2>&1 ; then
  1427.     $echo "sigblock() found."
  1428.     sigblock=define
  1429. else
  1430.     sigblock=undef
  1431. fi
  1432.  
  1433. : see if the system has getwd
  1434. if $contains getwd.o libc.list >/dev/null 2>&1 ; then
  1435.     $echo "getwd() found."
  1436.     getcwd=undef
  1437. else
  1438. : see if the system has getcwd
  1439. if $contains getcwd.o libc.list >/dev/null 2>&1 ; then
  1440.     $echo "getcwd() found."
  1441.     getcwd=define
  1442. else
  1443.     getcwd=undef
  1444. fi
  1445. fi
  1446.  
  1447. : see if there is a vfork
  1448. if $contains vfork.o libc.list >/dev/null 2>&1 ; then
  1449.     $echo "vfork() found."
  1450.     novfork='undef'
  1451. else
  1452.     $echo "No vfork() found--will use fork() instead."
  1453.     novfork='define'
  1454. fi
  1455.  
  1456. : see if YP could be running here
  1457. if $contains yp_master.o libc.list >/dev/null 2>&1 ; then
  1458.     $echo "YP may be running -- will use getpwent(), just in case."
  1459.     getpwent='define'
  1460. else
  1461. : see if there is a getpw
  1462. if $contains getpw.o libc.list >/dev/null 2>&1 ; then
  1463.     $echo "getpw() found."
  1464.     getpwent='undef'
  1465. else
  1466.     $echo "No getpw() found--will use getpwent() instead."
  1467.     getpwent='define'
  1468. fi
  1469. fi
  1470.  
  1471. : default
  1472. sigret=int
  1473. : determine type of signal function
  1474. if [ -f /usr/include/signal.h ]
  1475. then
  1476.     WHITE='[     ]'; : between the brackets are a tab and a space.
  1477.     if grep "$WHITE*void$WHITE*(\*signal())();" \
  1478.                     /usr/include/signal.h >/dev/null
  1479.     then
  1480.         sigret=void
  1481.     fi
  1482. fi
  1483. if [ -f /usr/include/sys/signal.h ]
  1484. then
  1485.     WHITE='[     ]'; : between the brackets are a tab and a space.
  1486.     if grep "$WHITE*void$WHITE*(\*signal())();" \
  1487.                     /usr/include/sys/signal.h >/dev/null
  1488.     then
  1489.         sigret=void
  1490.     fi
  1491. fi
  1492. $echo "signal() returns $sigret on this system"
  1493. : see how we will look up site name
  1494. douname=undef
  1495. gethostname=undef
  1496. phostname=undef
  1497. if $contains gethostname.o libc.list >/dev/null 2>&1 ; then
  1498.     $echo "gethostname() found."
  1499.     gethostname=define
  1500. else
  1501.     if $contains uname.o libc.list >/dev/null 2>&1 ; then
  1502.     $echo "uname() found."
  1503.     douname=define
  1504.     else
  1505.     case $hostcmd in
  1506.       '') ;;
  1507.       *)
  1508.         $cat <<EOT
  1509.  
  1510. There is no gethostname() or uname() on this system.  You have two
  1511. possibilites at this point:
  1512.  
  1513. 1)  You can have your site name ($sitename) compiled into rn, which lets rn
  1514.     start up faster, but makes your binaries non-portable, or
  1515. 2)  you can have rn use a
  1516.     
  1517.     popen("$hostcmd","r")
  1518.  
  1519.     which will start slower but be more portable.
  1520.  
  1521. Option 1 will use whoami.h if you have one.  If you want option 2 but with
  1522. a different command, you can edit config.h after this shell script is done.
  1523.  
  1524. EOT
  1525.         case "$phostname" in
  1526.         define) dflt=n;;
  1527.         undef)  dflt=y;;
  1528.         '')
  1529.         case $portable in
  1530.         define) dflt=n ;;
  1531.         *)      dflt=y ;;
  1532.         esac
  1533.         ;;
  1534.         esac
  1535.         $echo $n "Do you want your site name compiled in? [$dflt] $c"
  1536.         . myread
  1537.         case $ans in
  1538.         '') ans=$dflt;;
  1539.         esac
  1540.         case $ans in
  1541.           n*) phostname=define ;;
  1542.           *)  hostcmd='' phostname=undef;;
  1543.         esac
  1544.         ;;
  1545.     esac
  1546.     case $hostcmd in
  1547.       '')
  1548.         case $whoami in
  1549.           define)
  1550.         $echo 'No hostname function--using whoami.h.'
  1551.         ;;
  1552.           undef)
  1553.         $echo 'No hostname function--hardwiring "'$sitename'".'
  1554.         ;;
  1555.         esac
  1556.         ;;
  1557.     esac
  1558.     fi
  1559. fi
  1560.  
  1561. : see if we need -ljobs and if we have sigset, etc.
  1562. if $test -r /usr/lib/libjobs.a || $test -r /usr/local/lib/libjobs.a ; then
  1563.     $echo "Jobs library found."
  1564.     normsig=undef
  1565.     jobslib='-ljobs'
  1566. else
  1567.     if bsd; then
  1568.     $echo "No jobs library found.  (I suppose this is at least 4.2...)"
  1569.     else
  1570.     $echo "No jobs library found.  (That's okay, we all have our faults.)"
  1571.     fi
  1572.     normsig=define
  1573.     jobslib=''
  1574. fi
  1575. : set the right options for cc and include the x library for XENIX
  1576. if xenix; then
  1577.     if $test -d /lib/386 ; then
  1578.     iandd="-M3e"
  1579.     else
  1580.     iandd="-M2let8 -LARGE -F 3000"
  1581.     fi
  1582. jobslib=-lx
  1583. fi
  1584. : see if there are directory access routines out there
  1585. if $test -r /usr/lib/libndir.a || $test -r /usr/local/lib/libndir.a ; then
  1586.     $echo "Ndir library found."
  1587.     if $test -r /usr/lib/libndir.a; then
  1588.     ndirlib='-lndir'
  1589.     else
  1590.     ndirlib="/usr/local/lib/libndir.a"
  1591.     fi
  1592.     libndir=define
  1593.     usendir=undef
  1594.     ndirc=''
  1595.     ndiro=''
  1596.     dirtype=direct
  1597. else
  1598.     ndirlib=''
  1599.     libndir=undef
  1600.     if $contains readdir.o libc.list >/dev/null 2>&1 ; then
  1601.     $echo "No ndir library found, but you have readdir() so we'll use that."
  1602.     usendir=undef
  1603.     ndirc=''
  1604.     ndiro=''
  1605.     if sgi ; then
  1606.     dirtype=direct
  1607.     dirinc="<sys/dir.h>"
  1608.     $echo "Using direct directory structure."
  1609.     else 
  1610.         if $test -r /usr/include/dirent.h ; then
  1611.             $echo "Using dirent directory structure."
  1612.                 dirtype=dirent
  1613.             dirinc="<dirent.h>"
  1614.         else
  1615.             $echo "Using direct directory structure."
  1616.                 dirtype=direct
  1617.             dirinc="<sys/dir.h>"
  1618.         fi
  1619.     fi
  1620.      else
  1621.     $echo "No ndir library found and no readdir() found--using ./ndir.c."
  1622.     usendir=define
  1623.     ndirc='ndir.c'
  1624.     ndiro='ndir.o'
  1625.     fi
  1626. fi
  1627.  
  1628. : locate spool directory and check if rrn
  1629. case "$isrrn" in
  1630. define)
  1631.     dflt="y";;
  1632. *)
  1633.     dflt="n";;
  1634. esac
  1635. isrrn=''
  1636. while $test -z "$isrrn" ; do
  1637.     $echo " "
  1638.     $echo $n "Do you want this built as remote rn (rrn)? [$dflt] $c"
  1639.     . myread
  1640.     case "$ans" in
  1641.     '') ans="$dflt";;
  1642.     esac
  1643.     case "$ans" in
  1644.     n*)
  1645.     isrrn=undef;;
  1646.     y*)
  1647.     isrrn=define
  1648.     spool=/tmp
  1649.     $echo "net.foobar 00001 00001 y" > .falseactive
  1650.  
  1651.     case "$serverfile" in
  1652.     '')  dflt="no default" ;;
  1653.     *)   dflt="$serverfile";;
  1654.     esac
  1655.  
  1656.     $cat <<'EOM'
  1657.  
  1658. rrn determines the machine to use as a news server by two means:
  1659.  
  1660.     1. It examines the environment variable NNTPSERVER for
  1661.        a machine name; this allows users to use server machines
  1662.        other than the default.
  1663.  
  1664.     2. It looks in a file which contains the name of a server
  1665.        machine.
  1666.  
  1667. You must create the file mentioned in (2), above.  Simply put the name
  1668. of the machine you wish to use as your news server in this file.
  1669. If you really want, you can use # for comments and blank lines in
  1670. this file as well.
  1671.  
  1672. EOM
  1673.  
  1674.     ans='blurfl/dyick'
  1675.     while $test ! -r "$ans" ; do
  1676.     $echo $n "Enter the name of the news server file: [$dflt] $c"
  1677.     . myread
  1678.         case "$ans" in
  1679.         '') ans="$dflt";;
  1680.         esac
  1681.         ans=`filexp "$ans"`
  1682.         if $test ! -r $ans ; then
  1683.         $echo "Can't find $ans"
  1684.         ans='blurfl/dyick'
  1685.         fi
  1686.     done
  1687.     serverfile="$ans"
  1688.  
  1689.     case "$NNTPSRC" in
  1690.     '') dflt="no default";;
  1691.     *)  dflt="$NNTPSRC";;
  1692.     esac
  1693.  
  1694.     ans='blurfl/dyick'
  1695.     while $test ! -d "$ans"; do
  1696.         $echo $n "Enter the pathname of the NNTP source directory: [$dflt] $c"
  1697.         . myread
  1698.         case "$ans" in
  1699.         '') ans="$dflt";;
  1700.         esac
  1701.         ans=`filexp "$ans"`
  1702.         if $test ! -r $ans/common/nntp.h ; then
  1703.         $echo "Can't find $ans/common/nntp.h!"
  1704.         ans='blurfl/dyick'
  1705.         fi
  1706.     done
  1707.     NNTPSRC="$ans"
  1708. cat > server.h <<EOF_SERVE
  1709. #ifdef SERVER
  1710.  
  1711. EXT    char    *getserverbyfile();
  1712. EXT    int    server_init();
  1713. EXT    void    put_server();
  1714. EXT    int    get_server();
  1715. EXT    void    close_server();
  1716.  
  1717. #include "$NNTPSRC/common/nntp.h"
  1718. #endif
  1719. EOF_SERVE
  1720.  
  1721.     esac
  1722.  
  1723. done
  1724. : hack for Unisys NET-5000
  1725. case "$isrrn" in
  1726. define) 
  1727.     if $test -d /usr/include/NET-5000 ; then
  1728.     $echo "I sense you are on a Unisys 5000 computer...poor soul."
  1729.     rrninclude="-I/usr/include/NET-5000 -DEXCELAN -DUSG"
  1730.     socketlib=-lsocket
  1731.     fi
  1732.     ;;
  1733. *) ;;
  1734. esac
  1735.  
  1736.  
  1737. case "$spool" in
  1738. '')
  1739.     dflt=/usr/spool/news
  1740.     ;;
  1741. *)  dflt="$spool";;
  1742. esac
  1743. case "$isrrn" in
  1744. define)  ans=/tmp;;
  1745. *) ans='blurfl/dyick';;
  1746. esac
  1747. while $test ! -d $ans; do
  1748.     $echo " "
  1749.     case "$ans" in
  1750.     blurfl*);;
  1751.     *) $echo "Directory $ans not found.";;
  1752.     esac
  1753.     $echo $n "Where is news spooled (~name ok)? [$dflt] $c"
  1754.     . myread
  1755.     case "$ans" in
  1756.     '') ans="$dflt";;
  1757.     esac
  1758.     spool="$ans"
  1759.     case $spool in
  1760.     ~*)
  1761.     ans=`filexp $spool`
  1762.     $echo "(That is $ans on this particular system.)"
  1763.     case $portable in
  1764.       undef) spool=$ans ;;
  1765.     esac
  1766.     ;;
  1767.     *)
  1768.     ans=$spool
  1769.     ;;
  1770.     esac
  1771. done
  1772.  
  1773. : locate active file
  1774. case "$active" in
  1775. '')
  1776.     dflt=$lib/active
  1777.     ;;
  1778. *)  dflt="$active";;
  1779. esac
  1780. case "$isrrn" in
  1781. define) myactive=.falseactive;;
  1782. *) myactive='blurfl/dyick'
  1783. esac
  1784. while $test ! -f "$myactive"; do
  1785.     $echo " "
  1786.     case "$myactive" in
  1787.     blurfl*);;
  1788.     *) "File $myactive not found.";;
  1789.     esac
  1790.     $echo $n "Where is the active file (~name ok)? [$dflt] $c"
  1791.     . myread
  1792.     case "$ans" in
  1793.     '') ans="$dflt";;
  1794.     esac
  1795.     active="$ans"
  1796.     case $active in
  1797.     ~*)
  1798.     myactive=`filexp $active`
  1799.     $echo "(That is $myactive on this particular system.)"
  1800.     case $portable in
  1801.       undef) active=$myactive ;;
  1802.     esac
  1803.     ;;
  1804.     *)
  1805.     myactive=$active
  1806.     ;;
  1807.     esac
  1808.     if $test -d $myactive ; then
  1809.     myactive=$myactive/active
  1810.     active=$active/active
  1811.     fi
  1812. done
  1813.  
  1814. : check for 2.10.2 and above
  1815. $echo " "
  1816. if $contains ' [0-9][0-9]* [0-9]' "$myactive" >/dev/null 2>&1; then
  1817.     case "$norelay" in
  1818.     undef) dflt="y";;
  1819.     *)     dflt="n";;
  1820.     esac
  1821.     case "$isrrn" in
  1822.     define) 
  1823.        $echo "Is your NNTP server running an old version of news software," ;;
  1824.     *) $echo "Is your system running an old version of news software," ;;
  1825.     esac
  1826.     $echo $n "predating B News 2.10.3? [${dflt}] $c" 
  1827.     . myread
  1828.     case "$ans" in
  1829.     '') ans=$dflt;;
  1830.     esac
  1831.     case "$ans" in
  1832.     y*)
  1833.       norelay='undef'
  1834.     $echo "Looks like you are running at least 2.10.2 news."
  1835.       ;;
  1836.     *)  norelay='define' ;;
  1837.     esac
  1838.     mininact=define
  1839. else
  1840.     $echo "It doesn't look like you are running 2.10.2 news yet.  Are you planning"
  1841.     $echo $n "to install it in the near future? [y] $c"
  1842.     . myread
  1843.     case $ans in
  1844.     n*) mininact=undef ;;
  1845.     *)  mininact=define ;;
  1846.     esac
  1847.     norelay='undef'
  1848. fi
  1849.  
  1850.  
  1851. : check for void type
  1852. $echo " "
  1853. $echo "Checking to see if your C compiler groks the void type..."
  1854. $cat >try.c <<'EOCP'
  1855. void main();
  1856. EOCP
  1857. if cc -c try.c >/dev/null 2>&1 ; then
  1858.     novoid='undef'
  1859.     $echo "Yup, it does."
  1860. else
  1861.     novoid='define'
  1862.     $echo "Nope, it doesn't (boo hiss).  I will substitute int."
  1863. fi
  1864. $rm try.*
  1865.  
  1866. : find out which shell people like to use most
  1867. ans='blurfl/dyick'
  1868. while $test ! -f "$ans" ; do
  1869.     case $ans in
  1870.       blurfl*) ;;
  1871.       *) $echo "$ans does not appear to exist." ;;
  1872.     esac
  1873.     case "$pref" in
  1874.     '')
  1875.     if $test -f /bin/ksh; then
  1876.         dflt='/bin/ksh'
  1877.     else
  1878.         if $test -f /bin/csh; then
  1879.         dflt='/bin/csh'
  1880.         else
  1881.         dflt='/bin/sh'
  1882.         fi
  1883.     fi
  1884.     ;;
  1885.     *)  dflt="$pref";;
  1886.     esac
  1887.     $echo " "
  1888.     $echo "Give the full path name of the shell most people like to use on your"
  1889.     $echo $n "system: [$dflt] $c"
  1890.     . myread
  1891.     case $ans in
  1892.       '') ans=$dflt ;;
  1893.     esac
  1894. done
  1895. pref=$ans
  1896.  
  1897. : locate the preferred pager for this system
  1898. case "$pager" in
  1899. '')
  1900.     case $pg in
  1901.     /*) dflt=$pg
  1902.     ;;
  1903.     esac
  1904.     case $more in
  1905.     /*) dflt=$more
  1906.     ;;
  1907.     esac
  1908.     case $dflt in
  1909.     '') dflt=/usr/ucb/more
  1910.     ;;
  1911.     esac
  1912.     ;;
  1913. *)  dflt="$pager";;
  1914. esac
  1915. pager='blurfl/dyick'
  1916. while $test ! -f "$pager" ; do
  1917.     case $pager in
  1918.       blurfl*)
  1919.     $echo " "
  1920.     $echo "(If your kernel does terminal paging then you may answer this with '/bin/cat'.)"
  1921.     ;;
  1922.       /*) $echo "$pager does not appear to exist."
  1923.     $echo " "
  1924.         ;;
  1925.       *) $echo "Please give the full path name."
  1926.     $echo " "
  1927.         ;;
  1928.     esac
  1929.     $echo $n "What pager is used on your system? [$dflt] $c"
  1930.     . myread
  1931.     pager="$ans"
  1932.     case $pager in
  1933.       '') pager="$dflt" ;;
  1934.     esac
  1935. done
  1936.  
  1937. : determine default editor
  1938. case "$defeditor" in
  1939. '')
  1940.     dflt=/usr/ucb/vi
  1941.     ;;
  1942. *)  dflt="$defeditor"
  1943.     ;;
  1944. esac
  1945. defeditor='blurfl/dyick'
  1946. while $test ! -f "$defeditor" ; do
  1947.     case $defeditor in
  1948.       blurfl*) ;;
  1949.       *) $echo "$defeditor does not appear to exist." ;;
  1950.     esac
  1951.     $echo " "
  1952.     $echo $n "What is the default editor on your system? [$dflt] $c"
  1953.     . myread
  1954.     defeditor="$ans"
  1955.     case $defeditor in
  1956.       '') defeditor=$dflt ;;
  1957.     esac
  1958. done
  1959.  
  1960. : determine mailer for Rnmail to use
  1961. $echo " "
  1962. if $test -f /usr/lib/sendmail; then
  1963.     mailer=/usr/lib/sendmail
  1964. else
  1965.     if usg && $test -f $libexp/recmail; then
  1966.     mailer=$libexp/recmail
  1967.     else
  1968.     mailer=/bin/mail
  1969.     fi
  1970. fi
  1971. $echo "Mail sender is $mailer"
  1972.  
  1973. : check for internet mailer
  1974. case "$internet" in
  1975. define) dflt=y;;
  1976. undef)    dflt=n;;
  1977. *)
  1978.     case "$isrrn" in
  1979.     define) dflt=y ;;
  1980.     *) dflt=n ;;
  1981.     esac
  1982.     ;;
  1983. esac
  1984. cat <<EOM
  1985.  
  1986. Some newer mailers can deliver mail to addresses of the INTERNET persuasion,
  1987. such as user@host.UUCP.  Other older mailers require the complete path to
  1988. the destination to be specified in the address.  Does your mailer understand
  1989. EOM
  1990. $echo $n "INTERNET addresses? [$dflt] $c"
  1991. . myread
  1992. case "$ans" in
  1993. '') ans=$dflt;;
  1994. esac
  1995. case "$ans" in
  1996. y*) internet=define;;
  1997. *)  internet=undef;;
  1998. esac
  1999.  
  2000. : determine where public executables go
  2001. case "$rnbin" in
  2002. '')
  2003.     dflt=`loc . /bin /usr/local/bin /usr/lbin /usr/local /usr/bin`
  2004.     ;;
  2005. *)  dflt="$rnbin"
  2006.     ;;
  2007. esac
  2008. rnbin='blurfl/dyick'
  2009. while $test ! -d "$rnbin" ; do
  2010.     case $rnbin in
  2011.       blurfl*) ;;
  2012.       *) $echo "$rnbin does not appear to exist." ;;
  2013.     esac
  2014.     $echo " "
  2015.     $echo $n "Where do you want to put the public executables? [$dflt] $c"
  2016.     . myread
  2017.     rnbin="$ans"
  2018.     rnbin=`filexp $rnbin`
  2019.     case $rnbin in
  2020.       '') rnbin=$dflt ;;
  2021.     esac
  2022. done
  2023.  
  2024. : determine where private executables go
  2025. case "$rnlib" in
  2026. '')
  2027.     case "$isrrn" in
  2028.     define) dflt=/usr/local/lib/rn ;;
  2029.     *) dflt=$lib/rn ;;
  2030.     esac
  2031.     ;;
  2032. *)  dflt="$rnlib"
  2033.     ;;
  2034. esac
  2035. $echo " "
  2036. $echo "Rn has a number of auxiliary programs that need not be visible to the"
  2037. $echo "whole world.  Where do you want to put these private executables?"
  2038. $echo $n "[$dflt] (~name ok) $c"
  2039. . myread
  2040. rnlib="$ans"
  2041. case $rnlib in
  2042.   '') rnlib=$dflt ;;
  2043. esac
  2044. case $portable in
  2045. undef)
  2046.     rnlib=`filexp $rnlib`
  2047.     ;;
  2048. esac
  2049. : must not allow self reference
  2050. case $rnlib in
  2051.   /*)
  2052.     filexp=$rnlib/filexp
  2053.     ;;
  2054.   *)
  2055.     filexp=`pwd`/filexp
  2056.     ;;
  2057. esac
  2058.  
  2059. : get the local distribution prefixes
  2060. if $test -f $libexp/sys ; then
  2061.     $sed <$libexp/sys -n -e "s/^$sitename://p" | \
  2062.     $sed -e "s/:.*//" -e "s/,/ /g" | tr ' ' '\012' | \
  2063.     $sed -e "/^to./d" -e "/^net$/d" -e "/^fa$/d" -e "/^mod$/d" > .distlist
  2064. fi
  2065.  
  2066. $cat <<'EOH'
  2067.  
  2068. Distribution groups are the things you use on the Distribution line to limit
  2069. where an article will go to.  You are likely to be a member of several
  2070. distribution groups, such as organization, city, state, province, country,
  2071. continent, etc.  For example, Los Angeles has the distribution prefix "la",
  2072. New Jersey has the prefix "nj", and Europe has the prefix "eunet".
  2073.  
  2074. The categories you will be asked are: 
  2075.  
  2076. local organization    (Could be just one machine or a cluster or an office)
  2077. organization        att, dec, kgb, ...
  2078. city            la, ny, mosc, ...
  2079. state/province        ca, nj, bc, ...
  2080. country            usa, can, rok, whatever
  2081. continent        na (North America, not "Not Applicable"), asia, etc.
  2082.  
  2083. (If you don't have a distribution prefix in any of these categories then
  2084. just hit return.)
  2085.  
  2086. EOH
  2087. if $test -f .distlist; then
  2088.     distlist=`tr '\012' ' ' <.distlist`
  2089.     if $test "$distlist" ; then
  2090.     $echo "(These are the distributions in your sys file: $distlist)"
  2091.     $echo " "
  2092.     fi
  2093. fi
  2094. case "$locpref" in
  2095. '') dflt="";;
  2096. *)  dflt="[$locpref] ";;
  2097. esac
  2098. $echo $n "What is the distribution prefix for your local organization? $dflt$c"
  2099. . myread
  2100. case "$ans" in
  2101. '') ;;
  2102. *)  locpref="$ans";;
  2103. esac
  2104. case $locpref in
  2105.   '') locpref=none ;;
  2106. esac
  2107. case "$orgpref" in
  2108. '') dflt="";;
  2109. *)  dflt="[$orgpref] ";;
  2110. esac
  2111. $echo $n "What is the distribution prefix for your organization? $dflt$c"
  2112. . myread
  2113. case "$ans" in
  2114. '') ;;
  2115. *)  orgpref="$ans";;
  2116. esac
  2117. case $orgpref in
  2118.   '') orgpref=none ;;
  2119. esac
  2120. case "$citypref" in
  2121. '') dflt="";;
  2122. *)  dflt="[$citypref] ";;
  2123. esac
  2124. $echo $n "What is the distribution prefix for your city? $dflt$c"
  2125. . myread
  2126. case "$ans" in
  2127. '') ;;
  2128. *)  citypref="$ans";;
  2129. esac
  2130. case $citypref in
  2131.   '') citypref=none ;;
  2132. esac
  2133. case "$statepref" in
  2134. '') dflt="";;
  2135. *)  dflt="[$statepref] ";;
  2136. esac
  2137. $echo $n "What is the distribution prefix for your state/province? $dflt$c"
  2138. . myread
  2139. case "$ans" in
  2140. '') ;;
  2141. *)  statepref="$ans";;
  2142. esac
  2143. case $statepref in
  2144.   '') statepref=none ;;
  2145. esac
  2146. case "$cntrypref" in
  2147. '') dflt="";;
  2148. *)  dflt="[$cntrypref] ";;
  2149. esac
  2150. $echo $n "What is the distribution prefix for your country? $dflt$c"
  2151. . myread
  2152. case "$ans" in
  2153. '') ;;
  2154. *)  cntrypref="$ans";;
  2155. esac
  2156. case $cntrypref in
  2157.   '') cntrypref=none ;;
  2158. esac
  2159. case "$contpref" in
  2160. '') dflt="";;
  2161. *)  dflt="[$contpref] ";;
  2162. esac
  2163. $echo $n "What is the distribution prefix for your continent? $dflt$c"
  2164. . myread
  2165. case "$ans" in
  2166. '') ;;
  2167. *)  contpref="$ans";;
  2168. esac
  2169. case $contpref in
  2170.   '') contpref=none ;;
  2171. esac
  2172.  
  2173. $echo " "
  2174. $echo "If you have any other distribution groups you will need to edit Pnews"
  2175. $echo "and newsetup to add them."
  2176. $echo " "
  2177.  
  2178. : determine root id
  2179. rootid=`$sed </etc/passwd -e "/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*"'$'"/\1/" -e "q" -e "}" -e "d"`
  2180. case $rootid in
  2181.   '') rootid=0 ;;
  2182.   *)  $echo "Root uid = $rootid" ;;
  2183. esac
  2184.  
  2185. : weed out incompatibilities
  2186. case $douname in
  2187.   define) whoami=undef ;;
  2188. esac
  2189.  
  2190. : preserve RCS keywords in files with variable substitution, grrr
  2191. Log='$Log'
  2192. Header='$Header'
  2193.  
  2194. : Warnings
  2195. if v7; then
  2196.     cat <<'EOM'
  2197.  
  2198. NOTE: the V7 compiler may ignore some #undefs that rn uses.  If so, you will
  2199. get messages about redefining EXT.  Some V7 compilers also have difficulties
  2200. with #defines near buffer boundaries, so beware.  You may have to play with
  2201. the spacing in common.h.
  2202. EOM
  2203. fi
  2204.  
  2205. if pdp11; then
  2206.     cat <<'EOM'
  2207.  
  2208. NOTE: the PDP-11 does not have enough data space to do subject caching
  2209. reliably.  That feature will be disabled automatically.  Subject searching
  2210. will tend to be slow.
  2211. EOM
  2212. fi
  2213. case "$isrrn" in
  2214.     define) ;;
  2215.     *) socketlib=""
  2216.        rrninclude=""
  2217.      ;;
  2218. esac
  2219.  
  2220. $echo " "
  2221. $echo "End of configuration questions."
  2222. $echo " "
  2223.  
  2224. : create config.sh file
  2225. $echo " "
  2226. $echo "Creating config.sh..."
  2227. $spitshell <<EOT >config.sh
  2228. $startsh
  2229. # config.sh
  2230. # This file was produced by running the Configure script.
  2231.  
  2232. n='$n'
  2233. c='$c'
  2234. libc='$libc'
  2235. eunicefix='$eunicefix'
  2236. eunice='$eunice'
  2237. cpp='$cpp'
  2238. shsharp='$shsharp'
  2239. startsh='$startsh'
  2240. spitshell='$spitshell'
  2241. test='$test'
  2242. expr='$expr'
  2243. sed='$sed'
  2244. echo='$echo'
  2245. cat='$cat'
  2246. rm='$rm'
  2247. mv='$mv'
  2248. cp='$cp'
  2249. tail='$tail'
  2250. tr='$tr'
  2251. mkdir='$mkdir'
  2252. sort='$sort'
  2253. uniq='$uniq'
  2254. inews='$inews'
  2255. grep='$grep'
  2256. egrep='$egrep'
  2257. ypmatch='$ypmatch'
  2258. contains='$contains'
  2259. lib='$lib'
  2260. libexp='$libexp'
  2261. nametype='$nametype'
  2262. cc='$cc'
  2263. iandd='$iandd'
  2264. include='$include'
  2265. rrninclude='$rrninclude'
  2266. termlib='$termlib'
  2267. jobslib='$jobslib'
  2268. socketlib='$socketlib'
  2269. getcwd='$getcwd'
  2270. dirtype='$dirtype'
  2271. ndirlib='$ndirlib'
  2272. libndir='$libndir'
  2273. usendir='$usendir'
  2274. ndirc='$ndirc'
  2275. ndiro='$ndiro'
  2276. pager='$pager'
  2277. mailer='$mailer'
  2278. internet='$internet'
  2279. rnbin='$rnbin'
  2280. filexp='$filexp'
  2281. distlist='$distlist'
  2282. Log='$Log'
  2283. Header='$Header'
  2284. sitename='$sitename'
  2285. domain='$domain'
  2286. orgname='$orgname'
  2287. isadmin='$isadmin'
  2288. newsadmin='$newsadmin'
  2289. rnlib='$rnlib'
  2290. mansrc='$mansrc'
  2291. manext='$manext'
  2292. maildir='$maildir'
  2293. spool='$spool'
  2294. active='$active'
  2295. myactive='$myactive'
  2296. mininact='$mininact'
  2297. pref='$pref'
  2298. defeditor='$defeditor'
  2299. rootid='$rootid'
  2300. mboxchar='$mboxchar'
  2301. locpref='$locpref'
  2302. orgpref='$orgpref'
  2303. citypref='$citypref'
  2304. statepref='$statepref'
  2305. cntrypref='$cntrypref'
  2306. contpref='$contpref'
  2307. strchr='$strchr'
  2308. novoid='$novoid'
  2309. novfork='$novfork'
  2310. portable='$portable'
  2311. passnam='$passnam'
  2312. berknam='$berknam'
  2313. usgnam='$usgnam'
  2314. whoami='$whoami'
  2315. termio='$termio'
  2316. fcntl='$fcntl'
  2317. ioctl='$ioctl'
  2318. normsig='$normsig'
  2319. sigblock='$sigblock'
  2320. sigret='$sigret'
  2321. getuidgid='$getuidgid'
  2322. havetlib='$havetlib'
  2323. getpwent='$getpwent'
  2324. gethostname='$gethostname'
  2325. douname='$douname'
  2326. phostname='$phostname'
  2327. hostcmd='$hostcmd'
  2328. norelay='$norelay'
  2329. rdchk='$rdchk'
  2330. isrrn='$isrrn'
  2331. serverfile='$serverfile'
  2332. NNTPSRC='$NNTPSRC'
  2333. CONFIG=true
  2334. EOT
  2335.  
  2336. : create config.h file
  2337. $echo " "
  2338. $echo "Creating config.h..."
  2339. $cat <<EOT >config.h
  2340. /* config.h
  2341.  * This file was produced by running the Configure script.
  2342.  * Feel free to modify any of this as the need arises.
  2343.  */
  2344.  
  2345. /* name of the site.  May be overridden by gethostname, uname, etc. */
  2346. #define SITENAME "$sitename"
  2347.  
  2348. /* name of the organization, may be a file name */
  2349. #define ORGNAME "$orgname"
  2350.  
  2351. /* login name of news administrator, if any. */
  2352. #$isadmin NEWSADMIN "$newsadmin"
  2353.  
  2354. /* news library, may use only ~ and %l expansion */
  2355. #define LIB "$lib"
  2356.  
  2357. /* rn private library, may use ~ expansion, %x and %l */
  2358. #define RNLIB "$rnlib"
  2359.  
  2360. /* location of the news spool directory, may use ~ expansion, %x and %l */
  2361. #define SPOOL "$spool"
  2362.  
  2363. /* location of the active file, may use ~ expansion, %x and %l */
  2364. #define ACTIVE "$active"
  2365.  
  2366. /* location of spooled mail */
  2367. #define MAILFILE "$maildir/%L"
  2368.  
  2369. /* default shell--ok to be a slow shell like csh */
  2370. #define PREFSHELL "$pref"
  2371.  
  2372. /* default editor */
  2373. #define DEFEDITOR "$defeditor"
  2374.  
  2375. /* root uid */
  2376. #define ROOTID $rootid
  2377.  
  2378. /* what is the first character of a mailbox? */
  2379. #define MBOXCHAR '$mboxchar'
  2380.  
  2381. /* how to cancel an article */
  2382. #define CANCEL "$inews -h <%h"
  2383.  
  2384. /* distribution groups */
  2385. #define LOCDIST "$locpref"
  2386. #define ORGDIST "$orgpref"
  2387. #define CITYDIST "$citypref"
  2388. #define STATEDIST "$statepref"
  2389. #define CNTRYDIST "$cntrypref"
  2390. #define CONTDIST "$contpref"
  2391.  
  2392. #$strchr    index strchr    /* cultural */
  2393. #$strchr    rindex strrchr    /*  differences? */
  2394. #$novoid    void int    /* is void to be avoided? */
  2395. #$novfork    vfork fork    /* is vfork too virtual? */
  2396. #$eunice    EUNICE        /* no linking? */
  2397. #$eunice    VMS        /* not currently used, here just in case */
  2398. #$getcwd    GETCWD        /* do we have getcwd()? */
  2399. #$usendir    USENDIR        /* include ndir.c? */
  2400. #$libndir    LIBNDIR        /* include /usr/include/ndir.h? */
  2401. #define        DIRTYPE   $dirtype
  2402. #ifndef USENDIR
  2403. #define        DIRINC      $dirinc
  2404. #endif
  2405. #$mininact    MININACT    /* include 2.10.2 optimization? */
  2406. #$portable    PORTABLE    /* do we do extra lookups to start up? */
  2407. #$passnam    PASSNAMES    /* do names come from the passwd file? */
  2408.                 /*  (undef to take name from ~/.fullname) */
  2409. #$berknam    BERKNAMES    /* if so, are they Berkeley format? */
  2410.                 /* (that is, ":name,stuff:") */
  2411. #$usgnam    USGNAMES    /* or are they USG format? */
  2412.                 /* (that is, ":stuff-name(stuff):") */
  2413. #$whoami    WHOAMI        /* should we include whoami.h? */
  2414. #$rdchk        RDCHK        /* do we have rdchk()? */
  2415. #$termio    TERMIO        /* is this a termio system? */
  2416. #$fcntl        FCNTL        /* should we include fcntl.h? */
  2417. #$ioctl        IOCTL        /* are ioctl args all defined in one place? */
  2418. #$normsig    NORMSIG        /* use signal rather than sigset? */
  2419. #$sigblock    SIGBLOCK    /* use sigblock and sigsetmask */
  2420. #define            SIGRET    $sigret    /* what does signal() return? */
  2421. #$havetlib    HAVETERMLIB    /* do we have termlib-style routines? */
  2422. #$getuidgid    GETUIDGID    /* allow setuid (if possible) */
  2423. #$getpwent    GETPWENT    /* should we include getpwent? */
  2424. #$internet    INTERNET    /* does our mailer do INTERNET addressing? */
  2425. #$gethostname    GETHOSTNAME    /* do we have a gethostname function? */
  2426. #$douname    DOUNAME        /* do we have a uname function? */
  2427. #$phostname    PHOSTNAME "$hostcmd"    /* how to get host name with popen */
  2428. #$norelay     NORELAY         /* 2.10.3 doesn't have Relay-Version line */
  2429. #$isrrn         SERVER          /* rrn server code */
  2430. #$isrrn SERVER_FILE    "$serverfile"
  2431. EOT
  2432.  
  2433. CONFIG=true
  2434.  
  2435. $rm -f libc.list .distlist kit*isdone 
  2436.  
  2437. $echo " "
  2438. $echo "Doing variable substitutions on various files..."
  2439. $echo " "
  2440. set `$grep <MANIFEST '\.SH' | awk '{print $1}'`
  2441. for file in $*; do
  2442.     . $file
  2443. done
  2444.  
  2445. $echo " "
  2446. $echo 'Now you need to generate make dependencies by running "makedepend".'
  2447. $echo 'You might prefer to run it in background: "makedepend > makedepend.out &"'
  2448. $echo $n "Would you like me to run it for you (it takes quite a while)? [n] $c" 
  2449. . myread
  2450. case "$ans" in
  2451. y*) makedepend;;
  2452. esac
  2453. $rm -f myread
  2454. : end of Configure
  2455. !STUFFY!FUNK!
  2456. echo Extracting ngstuff.c
  2457. cat >ngstuff.c <<'!STUFFY!FUNK!'
  2458. /* $Header: ngstuff.c,v 4.3.2.2 90/04/14 19:40:02 sob Exp $
  2459.  *
  2460.  * $Log:    ngstuff.c,v $
  2461.  * Revision 4.3.2.2  90/04/14  19:40:02  sob
  2462.  * Fixed small syntax problem that generates errors with particular C
  2463.  * preprocessors.
  2464.  *
  2465.  * Revision 4.3.1.2  85/05/10  14:31:52  lwall
  2466.  * Prevented "Junked" or "Marked unread" when no state change.
  2467.  * 
  2468.  * Revision 4.3.1.1  85/05/10  11:36:45  lwall
  2469.  * Branch for patches.
  2470.  * 
  2471.  * Revision 4.3  85/05/01  11:45:03  lwall
  2472.  * Baseline for release with 4.3bsd.
  2473.  * 
  2474.  */
  2475.  
  2476. #include "EXTERN.h"
  2477. #include "common.h"
  2478. #include "term.h"
  2479. #include "util.h"
  2480. #include "ng.h"
  2481. #include "bits.h"
  2482. #include "intrp.h"
  2483. #include "cheat.h"
  2484. #include "head.h"
  2485. #include "final.h"
  2486. #include "sw.h"
  2487. #include "INTERN.h"
  2488. #include "ngstuff.h"
  2489.  
  2490. void
  2491. ngstuff_init()
  2492. {
  2493.     ;
  2494. }
  2495.  
  2496. /* do a shell escape */
  2497.  
  2498. int
  2499. escapade()
  2500. {
  2501.     register char *s;
  2502.     bool interactive = (buf[1] == FINISHCMD);
  2503.     bool docd;
  2504.     char whereiam[256];
  2505.  
  2506.     if (!finish_command(interactive))    /* get remainder of command */
  2507.     return -1;
  2508.     s = buf+1;
  2509.     docd = *s != '!';
  2510.     if (!docd) {
  2511.     s++;
  2512.     }
  2513.     else {
  2514.     getwd(whereiam);
  2515.     if (chdir(cwd)) {
  2516.         printf(nocd,cwd) FLUSH;
  2517.         sig_catcher(0);
  2518.     }
  2519.     }
  2520.     while (*s == ' ') s++;
  2521.                     /* skip leading spaces */
  2522.     interp(cmd_buf, (sizeof cmd_buf), s);/* interpret any % escapes */
  2523.     resetty();                /* make sure tty is friendly */
  2524.     doshell(Nullch,cmd_buf);    /* invoke the shell */
  2525.     noecho();                /* and make terminal */
  2526.     crmode();                /*   unfriendly again */
  2527.     if (docd) {
  2528.     if (chdir(whereiam)) {
  2529.         printf(nocd,whereiam) FLUSH;
  2530.         sig_catcher(0);
  2531.     }
  2532.     }
  2533. #ifdef MAILCALL
  2534.     mailcount = 0;            /* force recheck */
  2535. #endif
  2536.     return 0;
  2537. }
  2538.  
  2539. /* process & command */
  2540.  
  2541. int
  2542. switcheroo()
  2543. {
  2544.     if (!finish_command(TRUE)) /* get rest of command */
  2545.     return -1;    /* if rubbed out, try something else */
  2546.     if (!buf[1])
  2547.     pr_switches();
  2548. #ifdef PUSHBACK
  2549.     else if (buf[1] == '&') {
  2550.     if (!buf[2]) {
  2551.         page_init();
  2552.         show_macros();
  2553.     }
  2554.     else {
  2555.         char tmpbuf[LBUFLEN];
  2556.         register char *s;
  2557.  
  2558.         for (s=buf+2; isspace(*s); s++);
  2559.         mac_line(s,tmpbuf,(sizeof tmpbuf));
  2560.     }
  2561.     }
  2562. #endif
  2563.     else {
  2564.     bool docd = (instr(buf,"-d") != Nullch);
  2565.      char whereami[256];
  2566.  
  2567.     if (docd)
  2568.         getwd(whereami);
  2569.     sw_list(buf+1);
  2570.     if (docd) {
  2571.         cwd_check();
  2572.         if (chdir(whereami)) {        /* -d does chdirs */
  2573.         printf(nocd,whereami) FLUSH;
  2574.         sig_catcher(0);
  2575.         }
  2576.     }
  2577.     }
  2578.     return 0;
  2579. }
  2580.  
  2581. /* process range commands */
  2582.  
  2583. int
  2584. numnum()
  2585. {
  2586.     ART_NUM min, max;
  2587.     char *cmdlst = Nullch;
  2588.     register char *s, *c;
  2589.     ART_NUM oldart = art;
  2590.     char tmpbuf[LBUFLEN];
  2591.     bool justone = TRUE;        /* assume only one article */
  2592.  
  2593.     if (!finish_command(TRUE))    /* get rest of command */
  2594.     return NN_INP;
  2595.     if (lastart < 1) {
  2596.         fputs("\nNo articles\n",stdout) FLUSH;
  2597.         return NN_ASK;
  2598.     }
  2599. #ifdef ARTSRCH
  2600.     if (srchahead)
  2601.     srchahead = -1;
  2602. #endif
  2603.     for (s=buf; *s && (isdigit(*s) || index(" ,-.$",*s)); s++)
  2604.     if (!isdigit(*s))
  2605.         justone = FALSE;
  2606.     if (*s) {
  2607.     cmdlst = savestr(s);
  2608.     justone = FALSE;
  2609.     }
  2610.     else if (!justone)
  2611.     cmdlst = savestr("m");
  2612.     *s++ = ',';
  2613.     *s = '\0';
  2614.     safecpy(tmpbuf,buf,LBUFLEN);
  2615.     for (s = tmpbuf; c = index(s,','); s = ++c) {
  2616.     *c = '\0';
  2617.     if (*s == '.')
  2618.         min = oldart;
  2619.     else
  2620.         min = atol(s);
  2621.     if (min<absfirst) {        /* make sure it is reasonable */
  2622.         min = absfirst;
  2623.         printf("(First article is %ld)\n",(long)absfirst) FLUSH;
  2624.         pad(just_a_sec/3);
  2625.     }
  2626.     if ((s=index(s,'-')) != Nullch) {
  2627.         s++;
  2628.         if (*s == '$')
  2629.         max = lastart;
  2630.         else if (*s == '.')
  2631.         max = oldart;
  2632.         else
  2633.         max = atol(s);
  2634.     }
  2635.     else
  2636.         max = min;
  2637.     if (max>lastart) {
  2638.         max = lastart;
  2639.         if (min > max)
  2640.         min = max;
  2641.         printf("(Last article is %ld)\n",(long)lastart) FLUSH;
  2642.         pad(just_a_sec/3);
  2643.     }
  2644.     if (max < min) {
  2645.         fputs("\nBad range\n",stdout) FLUSH;
  2646.         if (cmdlst)
  2647.         free(cmdlst);
  2648.         return NN_ASK;
  2649.     }
  2650.     if (justone) {
  2651.         art = min;
  2652.         return NN_REREAD;
  2653.     }
  2654.     check_first(min);
  2655.     for (art=min; art<=max; art++) {
  2656.         if (perform(cmdlst,TRUE)) {
  2657. #ifdef VERBOSE
  2658.         IF(verbose)
  2659.             printf("\n(Interrupted at article %ld)\n",(long)art)
  2660.               FLUSH;
  2661.         ELSE
  2662. #endif
  2663. #ifdef TERSE
  2664.             printf("\n(Intr at %ld)\n",(long)art) FLUSH;
  2665. #endif
  2666.         if (cmdlst)
  2667.             free(cmdlst);
  2668.         return NN_ASK;
  2669.         }
  2670.     }
  2671.     }
  2672.     art = oldart;
  2673.     if (cmdlst)
  2674.     free(cmdlst);
  2675.     return NN_NORM;
  2676. }
  2677.  
  2678. int
  2679. perform(cmdlst,toplevel)
  2680. register char *cmdlst;
  2681. int toplevel;
  2682. {
  2683.     register int ch;
  2684.     
  2685.     if (toplevel) {
  2686.     printf("%-6ld",art);
  2687.     fflush(stdout);
  2688.     }
  2689.     for (; ch = *cmdlst; cmdlst++) {
  2690.     if (isspace(ch) || ch == ':')
  2691.         continue;
  2692.     if (ch == 'j') {
  2693.         if (!was_read(art)) {
  2694.         mark_as_read(art);
  2695. #ifdef VERBOSE
  2696.         IF(verbose)
  2697.             fputs("\tJunked",stdout);
  2698. #endif
  2699.         }
  2700.     }
  2701.     else if (ch == 'm') {
  2702.         if (was_read(art)) {
  2703.         unmark_as_read(art);
  2704. #ifdef VERBOSE
  2705.         IF(verbose)
  2706.             fputs("\tMarked unread",stdout);
  2707. #endif
  2708.         }
  2709.     }
  2710.     else if (ch == 'M') {
  2711. #ifdef DELAYMARK
  2712.         delay_unmark(art);
  2713. #ifdef VERBOSE
  2714.         IF(verbose)
  2715.             fputs("\tWill return",stdout);
  2716. #endif
  2717. #else
  2718.         notincl("M");
  2719.         return -1;
  2720. #endif
  2721.     }
  2722.     else if (ch == '=') {
  2723.         printf("\t%s",fetchsubj(art,FALSE,FALSE));
  2724. #ifdef VERBOSE
  2725.         IF(verbose)
  2726.         ;
  2727.         ELSE
  2728. #endif
  2729.         putchar('\n') FLUSH;        /* ghad! */
  2730.     }
  2731.     else if (ch == 'C') {
  2732. #ifdef ASYNC_PARSE
  2733.         printf("\t%sancelled",(cancel_article() ? "Not c" : "C"));
  2734. #else
  2735.         notincl("C");
  2736.         return -1;
  2737. #endif
  2738.     }
  2739.     else if (ch == '%') {
  2740. #ifdef ASYNC_PARSE
  2741.         char tmpbuf[512];
  2742.  
  2743.         cmdlst = dointerp(tmpbuf, (sizeof tmpbuf), cmdlst,":");
  2744.         if (*cmdlst != ':')
  2745.         --cmdlst;
  2746.         if (perform(tmpbuf,FALSE))
  2747.         return -1;
  2748. #else
  2749.         notincl("%");
  2750.         return -1;
  2751. #endif
  2752.     }
  2753.     else if (index("!&sSwW|",ch)) {
  2754.         cmdlst = cpytill(buf,cmdlst,':') - 1;
  2755.         /* we now have the command in buf */
  2756.         if (ch == '!') {
  2757.         escapade();
  2758. #ifdef VERBOSE
  2759.         IF(verbose)
  2760.             fputs("\tShell escaped",stdout);
  2761. #endif
  2762.         }
  2763.         else if (ch == '&') {
  2764.         switcheroo();
  2765. #ifdef VERBOSE
  2766.         IF(verbose)
  2767.             fputs("\tSwitched",stdout);
  2768. #endif
  2769.         }
  2770.         else {
  2771.         putchar('\t');
  2772.         save_article();
  2773.         }
  2774.     }
  2775.     else {
  2776.         printf("\t???%s\n",cmdlst);
  2777.         return -1;
  2778.     }
  2779. #ifdef VERBOSE
  2780.     fflush(stdout);
  2781. #endif
  2782.     }
  2783.     if (toplevel) {
  2784. #ifdef VERBOSE
  2785.     IF(verbose)
  2786.         putchar('\n') FLUSH;
  2787.     ELSE
  2788. #endif
  2789. #ifdef TERSE
  2790.         putchar(' ');
  2791. #endif
  2792.     }
  2793.     return 0;
  2794. }
  2795.  
  2796. !STUFFY!FUNK!
  2797. echo Extracting kitleader
  2798. cat >kitleader <<'!STUFFY!FUNK!'
  2799. #! /bin/sh
  2800. # $Header: kitleader,v 4.3 85/05/01 11:42:03 lwall Exp $
  2801. #
  2802. # $Log:    kitleader,v $
  2803. # Revision 4.3  85/05/01  11:42:03  lwall
  2804. # Baseline for release with 4.3bsd.
  2805.  
  2806. cat >$1 <<EOT
  2807. #! /bin/sh
  2808.  
  2809. # Make a new directory for the rn sources, cd to it, and run kits 1 thru $3 
  2810. # through sh.  When all $3 kits have been run, read README.
  2811.  
  2812. echo "This is rn kit $2 (of $3).  If kit $2 is complete, the line"
  2813. echo '"'"End of kit $2 (of $3)"'" will echo at the end.'
  2814. echo ""
  2815. export PATH || (echo "You didn't use sh, you clunch." ; kill \$\$)
  2816. EOT
  2817. !STUFFY!FUNK!
  2818. echo Extracting patchlevel
  2819. cat >patchlevel <<'!STUFFY!FUNK!'
  2820. Patch #: 47
  2821.  
  2822. !STUFFY!FUNK!
  2823. echo ""
  2824. echo "End of kit 2 (of 9)"
  2825. cat /dev/null >kit2isdone
  2826. config=true
  2827. for iskit in 1 2 3 4 5 6 7 8 9 ; do
  2828.     if test -f kit${iskit}isdone; then
  2829.     echo "You have run kit ${iskit}."
  2830.     else
  2831.     echo "You still need to run kit ${iskit}."
  2832.     config=false
  2833.     fi
  2834. done
  2835. case $config in
  2836.     true)
  2837.     echo "You have run all your kits.  Please read README and then type Configure."
  2838.     chmod 755 Configure
  2839.     ;;
  2840. esac
  2841. : I do not append .signature, but someone might mail this.
  2842. exit
  2843.