home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume31 / bsnews / part01 < prev    next >
Encoding:
Text File  |  1992-08-13  |  49.1 KB  |  1,815 lines

  1. Newsgroups: comp.sources.misc
  2. From: ron@mlfarm.com (Ronald Florence)
  3. Subject:  v31i069:  bsnews - Bootstrap News v2.2, Part01/01
  4. Message-ID: <1992Aug2.021730.7438@sparky.imd.sterling.com>
  5. X-Md4-Signature: 5ac5ac35b9f96d6730c2647302267394
  6. Date: Sun, 2 Aug 1992 02:17:30 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: ron@mlfarm.com (Ronald Florence)
  10. Posting-number: Volume 31, Issue 69
  11. Archive-name: bsnews/part01
  12. Environment: Unix, Xenix; partial on ms-dos, Amiga, Atari, Coherent
  13. Supersedes: bsnews: Volume 22, Issue 106
  14.  
  15. Bootstrap News is a collection of programs which enable a leaf node to
  16. take a limited news feed and post articles to Usenet.  News articles
  17. are spooled in Unix-mail-format files, where they can be read,
  18. printed, forwarded, replied-to, or saved.  The distribution provides a
  19. news-reader, news-poster, checknews, uudecode for binary and graphics
  20. files, and daemons to unpack and expire news received via uux or mail.
  21. Version 2.2 provides bug fixes for weird date commands, maverick compilers, 
  22. and error messages.
  23.  
  24. ------
  25. #! /bin/sh
  26. # This is a shell archive.  Remove anything before this line, then feed it
  27. # into a shell via "sh file" or similar.  To overwrite existing files,
  28. # type "sh file -c".
  29. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  30. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  31. # Contents:  Makefile Problems Readme bsnews.h.S bsnews.man.S
  32. #   checknews.c config expire.S init.c mail.ed makefile.pc myname.c
  33. #   pn.S readnews.S rnews.c uudecode.c uurec.S whatami.sh
  34. # Wrapped by kent@sparky on Sat Aug  1 21:06:12 1992
  35. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  36. echo If this archive is complete, you will see the following message:
  37. echo '          "shar: End of archive 1 (of 1)."'
  38. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  39.   echo shar: Will not clobber existing file \"'Makefile'\"
  40. else
  41.   echo shar: Extracting \"'Makefile'\" \(3182 characters\)
  42.   sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  43. X# Makefile for bsnews
  44. X# copyright 1991 Ronald Florence  
  45. X# @(#) version 2.2 (ron@mlfarm.com, 23 Jul 1992)
  46. X
  47. X# ----- For Unix systems, edit the following defines, as needed. -----
  48. X
  49. X# Mail reader, with the option used to name the spool file.
  50. XREADER = elm -f
  51. X
  52. X# The uucp nodename of your news feed.
  53. XFEED = BigNode
  54. X
  55. X# User to notify, via mail, for news problems.
  56. XNOTIFY = postmaster
  57. X
  58. X# Where is compress on your system?
  59. XCOMPDIR = /usr/bin
  60. X
  61. X# The directory and suffix for unformatted man pages.
  62. XMANDIR = /usr/man/manl
  63. XMANEXT = l
  64. X
  65. X# The first line of a Bourne Shell script. 
  66. X# The contortions in the first definition are to get a #! /bin/sh.
  67. X# Use the second definition for Xenix.
  68. XSTARTSCRIPT = `echo 'X!' | tr X '\043'`
  69. X# STARTSCRIPT = :
  70. X
  71. X# Add -DNICE=4 (+/-) to run rnews at a lower priority
  72. X# Add -DVERBOSE for reports of articles spooled
  73. X# Add -DUNAME for System V with uname()
  74. X# Add -DGETHOSTNAME for BSD with gethostname()
  75. X# Add -DIAM=\"yournodename\" to hardcode your node name
  76. X# Add -DBSD for index() instead of strchr()
  77. XOPTIONS =
  78. X
  79. X# ----- You may want to change these. -----
  80. X
  81. X# NEWSDIR - directory for news spools.
  82. X# NEWSLIB - directory for news configuration files.
  83. X# BIN - the owner of news programs.
  84. X# BINDIR - directory for news binaries.
  85. X# JUNK - the default news spool.
  86. X
  87. XCC = gcc
  88. XNEWSDIR = /usr/spool/news
  89. XNEWSLIB = /usr/lib/news
  90. XBIN = bin
  91. XBINDIR = /usr/bin
  92. XJUNK = bsnews
  93. X
  94. X# ----- You shouldn't need to make changes below here. -----
  95. X
  96. XCFLAGS = -O $(OPTIONS) -DCompdir=\"$(COMPDIR)\" -DNotify=\"$(NOTIFY)\"
  97. XPGMS = rnews uurec pn checknews readnews expire uudecode
  98. XFILES = newsdir config bsnews.man
  99. X
  100. XSRCS = Readme Makefile makefile.pc bsnews.h.S bsnews.man.S checknews.c\
  101. X       config expire.S init.c mail.ed myname.c readnews.S rnews.c pn.S\
  102. X       uudecode.c uurec.S whatami.sh Problems
  103. XSHELL = /bin/sh
  104. X
  105. Xbsnews:    install 
  106. X
  107. Xmail-bsnews: fix-pn install
  108. X
  109. Xinstall: $(PGMS) $(FILES)
  110. X    chgrp $(BIN) $(PGMS) 
  111. X    chown $(BIN) $(PGMS) 
  112. X    chmod 544 expire
  113. X    chmod 555 readnews pn checknews
  114. X    chmod 6555 rnews uurec
  115. X    cp config $(NEWSLIB)/config
  116. X    mv $(PGMS) $(BINDIR)
  117. X    mv bsnews.man $(MANDIR)/bsnews.$(MANEXT)
  118. X    [ -x $(BINDIR)/uudecode ] || mv uudecode $(BINDIR)
  119. X
  120. Xfix-pn: pn
  121. X    ed - pn < mail.ed
  122. X
  123. Xwhatami: 
  124. X    @sh whatami.sh
  125. X
  126. Xbsnews.h bsnews.man expire readnews pn uurec: Makefile
  127. X    rm -f $@
  128. X    sed -e 's|%NEWSLIB%|$(NEWSLIB)|g' \
  129. X        -e 's/%STARTSCRIPT%/'"$(STARTSCRIPT)"'/' \
  130. X        -e 's|BigNode|$(FEED)|' \
  131. X        -e 's|%NEWSDIR%|$(NEWSDIR)|g' \
  132. X        -e 's|%READER%|$(READER)|g'   \
  133. X        -e 's|%JUNK%|$(JUNK)|g' $@.S > $@
  134. X    chmod 444 $@   
  135. X
  136. Xnewsdir: 
  137. X    [ -d $(NEWSDIR) ] || mkdir $(NEWSDIR)
  138. X    chown $(BIN) $(NEWSDIR)
  139. X    chgrp $(BIN) $(NEWSDIR)
  140. X
  141. Xchecknews.o init.o rnews.o:    bsnews.h
  142. X
  143. Xcheckname: myname.c Makefile bsnews.h
  144. X    $(CC) $(CFLAGS) -DCHECKNAME myname.c -o checkname
  145. X    @rm -f myname.o
  146. X    @./checkname
  147. X
  148. Xchecknews: checknews.o init.o 
  149. X    $(CC) -o checknews checknews.o init.o
  150. X
  151. Xrnews:  checkname rnews.o myname.o init.o
  152. X    $(CC) -o rnews rnews.o myname.o init.o
  153. X
  154. Xman:    bsnews.man
  155. X#    gtroff -man bsnews.man | grops | pageview - &
  156. X    nroff -man bsnews.man | more
  157. X
  158. Xdos amiga:
  159. X    make -f makefile.pc $@
  160. X
  161. Xshar bsnews.shar: $(SRCS)
  162. X    shar -a $(SRCS) > bsnews.shar
  163. X
  164. Xclean:
  165. X    rm -f $(PGMS) *.o bsnews.man checkname bsnews.h
  166. X
  167. END_OF_FILE
  168.   if test 3182 -ne `wc -c <'Makefile'`; then
  169.     echo shar: \"'Makefile'\" unpacked with wrong size!
  170.   fi
  171.   # end of 'Makefile'
  172. fi
  173. if test -f 'Problems' -a "${1}" != "-c" ; then 
  174.   echo shar: Will not clobber existing file \"'Problems'\"
  175. else
  176.   echo shar: Extracting \"'Problems'\" \(8392 characters\)
  177.   sed "s/^X//" >'Problems' <<'END_OF_FILE'
  178. X
  179. X            PROBLEMS AND SOLUTIONS
  180. X              Bsnews 2.2 (Bootstrap News)
  181. X            copyright 1991 Ronald Florence
  182. X
  183. X
  184. X1.  I'm on a multi-user system.  How do I keep other users from
  185. X    deleting news articles with the `d' command in their mail readers?
  186. X
  187. XA.  The owner of news is defined in the Makefile as `bin', although it
  188. X    could be a pseudo-user like `news'.  The news programs and spools
  189. X    are owned by this user.  Unless you have an unusual umask set for
  190. X    the owner of news, the spools will be created and written with 644
  191. X    permissions.  Anyone can read news; only the owner of the spools
  192. X    can delete or write them.
  193. X
  194. X
  195. X2.  I'm on a single-user system.  I'd like to be able to delete the
  196. X    news articles as I read them instead of using expire.
  197. X
  198. XA.  Become the owner of news:
  199. X    % chown your-id rnews uurec /usr/spool/news
  200. X    % cd /usr/spool/news
  201. X    % chown your-id *
  202. X
  203. X
  204. X3.  The expire command doesn't work.
  205. X
  206. XA.  Expire may need to be run setuid to the owner of news.  Try:
  207. X    % chown owner-of-news expire
  208. X    % chmod 6555 expire 
  209. X    On systems like Xenix which do not support setuid for shell
  210. X    scripts, run expire from the owner-of-news crontab (if your system
  211. X    has crontabs), or use a cron entry like:
  212. X    30 2 * * *    su -c owner-of-news expire 5
  213. X
  214. X
  215. X4.  We're changing our news subscriptions to add/subtract newsgroups.
  216. X    Do I have to rebuild bsnews?
  217. X
  218. XA.  No.  Just edit config to include the new newsgroups and add any
  219. X    local spools you want.
  220. X
  221. X
  222. X5.  I'm running bsnews under ms-dos.  The command `rnews *.nws'
  223. X    doesn't work to unpack the news.
  224. X
  225. XA.  The newest version of rnews reads stdin only.  Use `rnews < batch'
  226. X    for each news batch.
  227. X
  228. X
  229. X6.  My config file includes:
  230. X    comp.unix        unix
  231. X    comp.unix.questions    questions
  232. X    alt.flame        flame
  233. X    The comp.unix.questions articles end up in the `unix' spool
  234. X    instead of the `questions' spool.
  235. X
  236. XA.  List comp.unix.questions before comp.unix in your config file.
  237. X    The newsgroup parsing engine looks for the first match.
  238. X
  239. X
  240. X7.  Sometimes rnews bails out before it finishes unpacking the news.
  241. X
  242. XA.  Get version 2.2 from a comp.sources.misc archive.
  243. X
  244. X
  245. X8.  When I try to build bsnews, the Make breaks on [whatami, expire,
  246. X    pn] because my fgrep lacks the -s option.
  247. X
  248. XA.  Get version 2.2 from a comp.sources.misc archive.
  249. X
  250. X
  251. X9.  Rnews sometimes truncates articles, pn gets the date and message
  252. X    ID wrong, expire doesn't work, and uurec gets the dates wrong.
  253. X
  254. X    Running AIX?  Get version 2.2 of bsnews from a
  255. X    comp.sources.misc.archive.
  256. X
  257. X
  258. X10. After expire runs, the checknews command in my .login reports
  259. X    new news when there is no new news.
  260. X
  261. XA.  BSD versions of the touch command cannot set an arbitrary time.
  262. X    Expire will use /usr/5bin/touch on a BSD system to get around
  263. X    this.  If you have a version of touch that will reset the time,
  264. X    change expire to find it.  
  265. X
  266. X
  267. X11. I don't want my news in separate spools.  I'd rather have all of
  268. X    the news in one big spool.
  269. X
  270. XA.  Use a blank config file, or no config file.
  271. X
  272. X
  273. X12. I want articles from oddball newsgroups to be spooled in
  274. X    /usr/spool/news/other instead of /usr/spool/news/bsnews.
  275. X
  276. XA.  Add lines to your config file for the oddball newsgroups:
  277. X    oddball.group        other
  278. X    another.odd.group    other
  279. X    Or rebuild bsnews with JUNK in the Makefile (or in bsnews.h on an
  280. X    ms-dos system) set to the name you want for the default spool.
  281. X
  282. X
  283. X13. How does bsnews work?  
  284. X
  285. XA.  Full-scale news systems like B-News and C-News unpack news into
  286. X    individual articles, one per file, in a hierarchical file system
  287. X    that corresponds to the newsgroup name structure.  For simplicity,
  288. X    and to enable the use of a mail reader for news, bsnews stores
  289. X    articles in user-configured Unix-mail-format (each article begins
  290. X    with the line `From user@site date') spools.
  291. X
  292. X    The rnews program unpacks news batches that arrive via a uux
  293. X    command from an upstream host, creating the required initial
  294. X    header with the date of arrival at your site.  On Unix systems
  295. X    rnews is executed automatically by uuxqt.
  296. X
  297. X    Uurec parses articles that arrive from an upstream host via mail,
  298. X    adding the required initial header.  Uurec is run automatically if
  299. X    you have sendmail or execmail, or it can be run periodically by
  300. X    cron with /usr/spool/mail/rnews as input.
  301. X
  302. X    Checknews compares the latest modification (write) time on the
  303. X    news spools to the time on a sentinel file ($HOME/.lastnews) to
  304. X    determine whether news has arrived since you last read the spools.
  305. X    Each user on a multi-user system has a separate .lastnews file.
  306. X    Checknews is normally used in the .profile or .login file to
  307. X    inform the user of new news at login time.
  308. X
  309. X    Expire parses the initial headers of news articles in the spools
  310. X    and deletes those older than the expiration interval.  It is
  311. X    normally run nightly by cron.
  312. X
  313. X    Pn is a simple news poster that sends an article to your newsfeed
  314. X    via uux or mail.
  315. X
  316. X    Readnews is a shell wrapper for the mail reader, which allows you
  317. X    to read news groups by their local or Usenet name, or to read all
  318. X    newsgroups with news.  Readnews also sets the sentinel to record
  319. X    which news you have read.
  320. X
  321. X
  322. X14. Articles I post with pn don't show up in news here.
  323. X
  324. XA.  Make this change to pn:
  325. X    *** 57,62 ****
  326. X    --- 57,63 ----
  327. X      while read yn
  328. X        do case $yn in
  329. X          y*|Y*) uux - -r $Hostname!rnews < $Tmpart
  330. X    +        rnews < $Tmpart
  331. X           echo "Posted!"
  332. X           break ;;
  333. X          n*|N*) echo "Article cancelled!"
  334. X
  335. X
  336. X15. Pn isn't much of a news poster.  I want to be able to post
  337. X    follow-up articles, with attributions and quoted material and
  338. X    those fancy headers.
  339. X
  340. XA.  Get post.icn from a comp.sources.misc archive.  Post.icn has all
  341. X    the features you want, and is compatible with bsnews (as well as
  342. X    B-News or C-News).  Post.icn is written in Icon.  If you don't
  343. X    have Icon for your system, you can get it from the University of
  344. X    Arizona. 
  345. X
  346. X
  347. X16. How do I feed the news we get to another site?
  348. X
  349. XA.  Junk bsnews and get B-News or C-News.
  350. X
  351. X
  352. X17. I'd like to know how many articles were unpacked to each spool.
  353. X
  354. XA.  Set the -DVERBOSE flag in the OPTIONS in your Makefile.  
  355. X
  356. X
  357. X18. When we get a huge batch of news, the system slows down too much
  358. X    while it is unpacking news.
  359. X
  360. XA.  Set -DNICE=some-number in the OPTIONS in your Makefile.    
  361. X
  362. X
  363. X19. What is a good mail reader to use in readnews?
  364. X
  365. XA.  Users tell me that elm works well with bsnews.  Other mail
  366. X    readers, like BSD Mail, work fine too.
  367. X
  368. X
  369. X20. How do I [reply-to, forward, print, save] a news article?
  370. X
  371. XA.  The same way you reply-to, forward, print, or save an email
  372. X    message.  Bsnews is as versatile, or as crippled, as your mail
  373. X    reader.
  374. X
  375. X
  376. X21. I'm running bsnews on a non-Unix system.  How do I use the
  377. X    [expire, uurec, readnews, pn, checknews] program?  How do I get my
  378. X    news to unpack automatically?
  379. X
  380. XA.  The first four programs are Unix shell scripts.  If you have awk
  381. X    or gawk for your system, you can probably adapt the expire and
  382. X    uurec programs.  The post.icn newsposter (see question 14) will
  383. X    work on ms-dos and probably on an Atari, Amiga or other systems
  384. X    with Icon, and is more versatile than pn.  Checknews could be
  385. X    adapted for other systems by making appropriate changes to the
  386. X    stats structure.
  387. X
  388. X    Unpacking news depends on your uucp workalike (uupc): some can
  389. X    execute uux commands like rnews.  If your uucp workalike can only
  390. X    do mail, you will have to unpack news manually.
  391. X
  392. X
  393. X22. I don't have gawk or nawk.  Where can I get the version of expire
  394. X    that uses old awk?
  395. X
  396. XA.  You have an old version of bsnews.  The shell scripts in the
  397. X    newest version (2.2) run with old awk.
  398. X
  399. X
  400. X23. The shell scripts execute under the wrong shell on my system!
  401. X
  402. XA.  The shell scripts are written for the Bourne shell.  If you are
  403. X    running on a Xenix system, comment out the first definition of
  404. X    STARTSCRIPT in the Makefile and uncomment STARTSCRIPT = :.
  405. X
  406. X
  407. X24. Are any updates or improvements planned for bsnews?  I'd like to
  408. X    be on the mailing list.
  409. X
  410. XA.  Future improvements and updates are up to the users.  I wrote the
  411. X    programs for friends who get newsfeeds from us.  I've never used
  412. X    bsnews myself and don't plan to do any more work on it.
  413. X
  414. X
  415. X25. Thanks for bsnews.  It's a great news system for a small site
  416. X    like mine.
  417. X
  418. XA.  You're welcome.
  419. X
  420. X
  421. X
  422. X
  423. X@(#) version 2.2 (ron@mlfarm.com, 23 July 1992)
  424. END_OF_FILE
  425.   if test 8392 -ne `wc -c <'Problems'`; then
  426.     echo shar: \"'Problems'\" unpacked with wrong size!
  427.   fi
  428.   # end of 'Problems'
  429. fi
  430. if test -f 'Readme' -a "${1}" != "-c" ; then 
  431.   echo shar: Will not clobber existing file \"'Readme'\"
  432. else
  433.   echo shar: Extracting \"'Readme'\" \(5394 characters\)
  434.   sed "s/^X//" >'Readme' <<'END_OF_FILE'
  435. Xbsnews - Bootstrap News
  436. Xcopyright 1991 Ronald Florence
  437. X@(#) version 2.2 (ron@mlfarm.com, 22 Jul 1992)
  438. X
  439. XBootstrap News is a collection of programs which enable a leaf node to
  440. Xtake a limited news feed and post articles to Usenet.  News articles
  441. Xare spooled in Unix-mail-format files, where they can be read,
  442. Xprinted, forwarded, replied-to, or saved.  The distribution provides a
  443. Xnews-reader, news-poster, checknews, uudecode for binary and graphics
  444. Xfiles, and daemons to unpack and expire news received via uux or mail.
  445. XBsnews after version 2.0 includes multiple, user-configurable news
  446. Xspools, and simplified configuration with a `make whatami' script.
  447. XVersion 2.2 provides bug fixes for weird date commands, maverick
  448. Xcompilers, and error messages.
  449. X
  450. XBsnews has been tested on BSD and SystemV Unix, including Xenix.
  451. XPortions can be built on ms-dos, Amiga, Atari, and Coherent systems
  452. Xrunning uucp workalikes.  Bsnews is not a substitute for B-News or
  453. XC-News.  if your news needs include feeding articles to downstream
  454. Xnodes, or if your news subscription is more than a few dozen news
  455. Xgroups, you should probably install a full news package.
  456. X
  457. XConfiguration:
  458. X
  459. X   Edit the file `config' to provide local spool names for the
  460. X   newsgroups you will be receiving.  You can assign several
  461. X   newsgroups to the same spool.  If there are no entries in config,
  462. X   or if you receive an article from a newsgroup which is not listed
  463. X   in the config file, the article will be spooled in a default spool
  464. X   (see JUNK in the Makefile).  If your news subscriptions change, you
  465. X   can edit config without recompiling the bsnews programs.
  466. X
  467. XTo install bsnews on a Unix system:
  468. X
  469. X1. Do `make whatami', then edit the Makefile defines for READER, FEED,
  470. X   NOTIFY, COMPDIR, MANDIR, MANEXT, STARTSCRIPT, and OPTIONS to suit
  471. X   your system.  You may want to change NEWSLIB, NEWSDIR, CC, BIN, or
  472. X   JUNK.  On most systems you will need to be a privileged user to
  473. X   install bsnews.
  474. X
  475. X2. If your news feed sends you news via uux (rnews), do `make'.  Check
  476. X   to see that rnews is in the uucp permissions file in /usr/lib/uucp,
  477. X   and tell your news feed to send you a compressed, batched feed.
  478. X   Rnews will also unpack uncompressed batches or single articles.
  479. X
  480. X   If your news feed uses sendnews to send you news articles via mail,
  481. X   do `make mail-bsnews'.  Create a sendmail or execmail alias for
  482. X   rnews (rnews: |/usr/bin/uurec), or use cron to run uurec with
  483. X   /usr/spool/mail/rnews as input.
  484. X
  485. X3. Create a daily cron entry for `expire n', where n is the expiration
  486. X   period for news.  
  487. X
  488. X    30 2 * * *    /usr/bin/expire 5
  489. X
  490. X   News spools can grow quickly; expiration after 3-7 days is typical.
  491. X   Single-user sites can ignore this step and use the delete command
  492. X   in the news-reader to expire news.
  493. X
  494. XUsing bsnews on Unix systems:
  495. X
  496. X   Use readnews to read your news.  With no arguments readnews will
  497. X   read all spools with news; you can specify newsgroups to read by
  498. X   their local or Usenet names.  Pipe articles containing uuencoded
  499. X   material (`begin filemode filename') through uudecode.
  500. X
  501. X   Add checknews to your .profile or .login for notification of new
  502. X   news when you log in.  If the touch command on your system cannot
  503. X   set an arbitrary time, checknews may incorrectly report new news
  504. X   after expire runs.
  505. X
  506. X   Before you post to Usenet, you should test the pn news poster on a
  507. X   newsgroup with limited distribution, and read the file "Standard
  508. X   for Interchange of USENET Messages," available in newsgroup
  509. X   news.announce.newusers or from your news feed.  For a more
  510. X   versatile newsposter, see `post' in the comp.sources.misc archives.
  511. X
  512. XTo install bsnews on a non-Unix system:
  513. X
  514. X1. Change CC and CFLAGS in makefile.pc to suit your C compiler.  Copy
  515. X   bsnews.h.S to bsnews.h, and edit the NOTUNIX defines for Configdir,
  516. X   Newsdir, Junk, and IAM in bsnews.h.  Do `make dos' or `make amiga',
  517. X   and install config in the directory specified in bsnews.h.
  518. X
  519. X2. If your uucp workalike cannot execute rnews with the incoming news
  520. X   batches as input, have your news feed install a batch command file
  521. X   for your system:
  522. X
  523. X       :
  524. X       #! /bin/sh
  525. X       # yoursys.cmd
  526. X       News=/tmp/`date '+%d%H%M%S'`.nws
  527. X       cat > $News
  528. X       uucp -rC $News yoursys!~/
  529. X       rm $News
  530. X
  531. X   After each poll of your host, run rnews with the *.nws files in
  532. X   your public directory as input.  You will need 16-bit compress for
  533. X   compressed news batches.
  534. X
  535. XUsing bsnews on non-Unix systems: 
  536. X
  537. X   Read your news by doing the equivalent of `mail -f spoolname' for
  538. X   the news spools.  Use `uudecode < article' or `uudecode article'
  539. X   for articles containing encoded material.  The pn newsposter,
  540. X   readnews, and the expire, uurec, and checknews daemons do not run
  541. X   on non-Unix systems.
  542. X
  543. XI'd like to thank Joel Tenenbaum (joel@purvid.purchase.edu) for
  544. Xbuilding beta-versions of bsnews on Xenix, SGI Unix, Amiga, AIX, and
  545. Xms-dos systems; Brice Weisman (72067.122@compuserve.com) for the idea
  546. Xof multiple news spools and for testing the ms-dos delivery scheme;
  547. Xand the many users who have found bugs or made suggestions.
  548. X
  549. XPermission is hereby granted for unlimited non-commercial use of these
  550. Xprograms, on condition that the copyright notices are left intact and
  551. Xany modifications to the source code are noted as such.  No warranty
  552. Xof any kind is implied or granted for this material.
  553. X
  554. XRonald Florence            
  555. Xron@mlfarm.com
  556. X
  557. END_OF_FILE
  558.   if test 5394 -ne `wc -c <'Readme'`; then
  559.     echo shar: \"'Readme'\" unpacked with wrong size!
  560.   fi
  561.   # end of 'Readme'
  562. fi
  563. if test -f 'bsnews.h.S' -a "${1}" != "-c" ; then 
  564.   echo shar: Will not clobber existing file \"'bsnews.h.S'\"
  565. else
  566.   echo shar: Extracting \"'bsnews.h.S'\" \(853 characters\)
  567.   sed "s/^X//" >'bsnews.h.S' <<'END_OF_FILE'
  568. X/*
  569. X * bsnews.h
  570. X * copyright 1991 Ronald Florence
  571. X * @(#) version 2.1 (ron@mlfarm.com, 15 Sep 1991)
  572. X */
  573. X
  574. X#define Maxgroup    50
  575. X
  576. X#ifdef NOTUNIX
  577. X
  578. X    /* For non-Unix systems, please define the full path of your */
  579. X    /* config file, the directory for news spools including the */
  580. X    /* final path separator, the name of the default news spool, */
  581. X    /* and the uucp name of your node. */
  582. X
  583. X#define Configfile    "\\uupc\\bin\\config"
  584. X#define Newsdir        "\\uupc\\news\\"
  585. X#define Junk        "bsnews"
  586. X#define IAM        "nowhere"
  587. X#else
  588. X
  589. X    /* For Unix this information is configured by the Makefile. */
  590. X
  591. X#define Configfile    "%NEWSLIB%/config"
  592. X#define Newsdir        "%NEWSDIR%/"
  593. X#define Junk        "%JUNK%"
  594. X#endif
  595. X
  596. X#include <stdio.h>
  597. X
  598. X#ifdef BSD
  599. X#define strchr        index
  600. X#endif
  601. X
  602. Xtypedef struct {
  603. X  char *usenet, *local;
  604. X  int  len, found;
  605. X} Group;
  606. X
  607. X#ifndef INIT
  608. Xextern
  609. X#endif
  610. XGroup *newsgroup[Maxgroup];
  611. END_OF_FILE
  612.   if test 853 -ne `wc -c <'bsnews.h.S'`; then
  613.     echo shar: \"'bsnews.h.S'\" unpacked with wrong size!
  614.   fi
  615.   # end of 'bsnews.h.S'
  616. fi
  617. if test -f 'bsnews.man.S' -a "${1}" != "-c" ; then 
  618.   echo shar: Will not clobber existing file \"'bsnews.man.S'\"
  619. else
  620.   echo shar: Extracting \"'bsnews.man.S'\" \(2947 characters\)
  621.   sed "s/^X//" >'bsnews.man.S' <<'END_OF_FILE'
  622. X.\" man page for bsnews (Bootstrap News)
  623. X.\" Copyright 1991 Ronald Florence
  624. X.\" @(#) version 2.2 (ron@mlfarm.com, 23 Jul 1992)
  625. X.\"
  626. X.TH BSNEWS LOCAL "23 Jul 1992"
  627. X.SH NAME
  628. Xrnews \- processes news articles received via uux
  629. X
  630. Xuurec \- processes news articles received via mail
  631. X
  632. Xchecknews \- a daemon to monitor the arrival of new news
  633. X
  634. Xexpire \- expires articles from the news spool
  635. X
  636. Xpn \- a simple news poster
  637. X
  638. Xreadnews \- a news reader
  639. X
  640. Xuudecode
  641. X.SH SYNOPSIS
  642. X.B rnews 
  643. X< 
  644. X.I news-batch 
  645. X.br
  646. X.B uurec 
  647. X< 
  648. X.I article
  649. X.br
  650. X.B checknews
  651. X.br
  652. X.B expire 
  653. X.I n
  654. X.br
  655. X.B pn
  656. X.br
  657. X.B readnews
  658. X[
  659. X.IR spool(s) " | " newsgroup(s)
  660. X]
  661. X.br
  662. X.B uudecode 
  663. X< 
  664. X.I encoded-article
  665. X.br
  666. X.B uudecode 
  667. X.I encoded-article
  668. X.SH DESCRIPTION
  669. X.PP
  670. X.I Bsnews 
  671. X(Bootstrap News) is a collection of programs which enable a leaf node
  672. Xto take a limited news feed and post articles to Usenet, without
  673. Xinstalling a full news package.
  674. X.PP
  675. X.I Rnews 
  676. Xprocesses individual news articles, batched, or batched and compressed
  677. Xnews sent from a remote system via uux.  The articles are spooled in
  678. XUnix-mail-format news spools, with RFC 822 compliant headers.  An
  679. Xinitial
  680. X.I From
  681. Xheader is supplied with the email address of the poster and the date
  682. Xof arrival at the system.  A compile-time option enables verbose
  683. Xreports of the number of articles spooled in each news group as the
  684. Xnews is unpacked.
  685. X.PP
  686. X.I Uurec
  687. Xspools news articles received in sendnews format (each line prefixed
  688. Xwith an
  689. X.IR N )
  690. Xfrom a remote system.
  691. X.PP
  692. X.IR Checknews ,
  693. Xin the
  694. X.I .login
  695. Xor 
  696. X.I .profile
  697. Xfile, notifies the user at login time of new news on the spools.
  698. X.PP
  699. X.I Expire
  700. Xis run by cron to expire news from the news spools after
  701. X.I n
  702. Xdays.  
  703. X.PP
  704. X.I Pn 
  705. Xis a simple news poster, configured by the bsnews Makefile to post
  706. Xarticles via uux or mail.  
  707. X.I Pn 
  708. Xqueries interactively for the newsgroup(s) and subject, puts the user
  709. Xin an editor (default
  710. X.IR vi ),
  711. Xto compose the article, and a pager (default
  712. X.IR more )
  713. Xto proof the article before posting.  The
  714. X.SM EDITOR
  715. Xand
  716. X.SM PAGER 
  717. Xenvironmental variables can be used to change the defaults.
  718. X.PP
  719. X.I Readnews 
  720. Xadapts a Unix mail reader
  721. X.RI ( elm , 
  722. X.IR Mail ,
  723. Xetc.) for reading news.  If no newsgroups or local spools are named on
  724. Xthe command line, 
  725. X.I readnews
  726. Xwill read all spools with news.  News articles can be read, printed,
  727. Xforwarded, saved, replied-to, and (on a single-user system) deleted,
  728. Xusing mailer commands.
  729. X.PP
  730. X.I Uudecode
  731. Xis a simple decoder for the protocol used to post binary or graphics
  732. Xfiles.  Uuencoded material can be recognized from the ``begin
  733. X.I filemode
  734. Xfilename'' initial line.
  735. X.SH FILES
  736. X.if t .ta 2.5i
  737. X.if n .ta 3.5i
  738. X%NEWSDIR%/*    news spools
  739. X.br
  740. X%NEWSDIR%/%JUNK%    default news spool
  741. X.br
  742. X%NEWSLIB%/config    configuration file
  743. X.br
  744. X$HOME/.lastnews    sentinel file for checknews
  745. X.SH BUGS
  746. XOn 
  747. X.SM BSD
  748. Xsystems without /usr/5bin/touch, 
  749. X.I checknews
  750. Xmay incorrectly report new news after
  751. X.I expire 
  752. Xhas run.
  753. X.SH AUTHOR
  754. XRonald Florence (ron\s-2@\s0mlfarm.com).
  755. X
  756. END_OF_FILE
  757.   if test 2947 -ne `wc -c <'bsnews.man.S'`; then
  758.     echo shar: \"'bsnews.man.S'\" unpacked with wrong size!
  759.   fi
  760.   # end of 'bsnews.man.S'
  761. fi
  762. if test -f 'checknews.c' -a "${1}" != "-c" ; then 
  763.   echo shar: Will not clobber existing file \"'checknews.c'\"
  764. else
  765.   echo shar: Extracting \"'checknews.c'\" \(926 characters\)
  766.   sed "s/^X//" >'checknews.c' <<'END_OF_FILE'
  767. X/*
  768. X * checknews.c - checks for bootstrap news
  769. X * copyright 1991 Ronald Florence 
  770. X * @(#) version 2.1 (ron@mlfarm.com, 23 Aug 1991)
  771. X */
  772. X
  773. X#include <sys/types.h>
  774. X#include <sys/stat.h>
  775. X#include "bsnews.h"
  776. X
  777. X#define bye(s)       puts(s), exit(1)
  778. X
  779. Xmain()
  780. X{
  781. X  struct stat nt, lt;
  782. X  char newsmarker[80], *getenv(), *malloc();
  783. X  int ngroups, got = 0, i;
  784. X
  785. X  ngroups = init();
  786. X  if (!strcpy(newsmarker, getenv("HOME")))
  787. X    bye("checknews: cannot find $HOME.");
  788. X  strcat(newsmarker, "/.lastnews");
  789. X  if (stat(newsmarker, <) == -1)
  790. X    lt.st_mtime = 0;
  791. X  for (i = 0; i <= ngroups; i++)
  792. X    if (stat(newsgroup[i]->local, &nt) == 0 && nt.st_mtime > lt.st_mtime)
  793. X      {
  794. X    if (!got)
  795. X      {
  796. X        printf("%-25s%s\n", "New news", "Local spool");
  797. X        printf("%-25s%s\n", "--------", "-----------");
  798. X      }
  799. X    printf("%-25s%s\n", newsgroup[i]->usenet, newsgroup[i]->local);
  800. X    got++;
  801. X      }
  802. X  if (!got)
  803. X    printf("No news is good news.\n");
  804. X  exit(0);
  805. X}
  806. END_OF_FILE
  807.   if test 926 -ne `wc -c <'checknews.c'`; then
  808.     echo shar: \"'checknews.c'\" unpacked with wrong size!
  809.   fi
  810.   # end of 'checknews.c'
  811. fi
  812. if test -f 'config' -a "${1}" != "-c" ; then 
  813.   echo shar: Will not clobber existing file \"'config'\"
  814. else
  815.   echo shar: Extracting \"'config'\" \(439 characters\)
  816.   sed "s/^X//" >'config' <<'END_OF_FILE'
  817. X# config - configuration file for bsnews
  818. X#
  819. X# Lines beginning with `#' are comments.
  820. X# More than one newsgroup can be assigned to a spool.
  821. X#
  822. X# newsgroup        local-spool-name
  823. X
  824. Xalt.flame        flamethrowers
  825. Xcomp.emacs        emacs
  826. Xcomp.lang.icon        icon
  827. Xcomp.sources.unix    unix.src
  828. Xcomp.sys.sgi        sgi
  829. Xcomp.unix.cray        cray
  830. Xcomp.unix.xenix.sco    xenix
  831. Xrec.music.classical    classical.music
  832. Xrec.sport.football.pro    proball
  833. Xsci.astro        astro
  834. Xtalk.origins        flamethrowers
  835. END_OF_FILE
  836.   if test 439 -ne `wc -c <'config'`; then
  837.     echo shar: \"'config'\" unpacked with wrong size!
  838.   fi
  839.   # end of 'config'
  840. fi
  841. if test -f 'expire.S' -a "${1}" != "-c" ; then 
  842.   echo shar: Will not clobber existing file \"'expire.S'\"
  843. else
  844.   echo shar: Extracting \"'expire.S'\" \(2286 characters\)
  845.   sed "s/^X//" >'expire.S' <<'END_OF_FILE'
  846. X%STARTSCRIPT% /bin/sh
  847. X# expire - expires bsnews spool
  848. X# copyright 1991 Ronald Florence 
  849. X# @(#) version 2.2 (ron@mlfarm.com, 21 Jul 1992)
  850. X#
  851. X# A version for gawk or nawk would be cleaner; this is portable.
  852. X
  853. XNewsdir=%NEWSDIR%/
  854. XConfig=%NEWSLIB%/config
  855. XJunk=%JUNK%
  856. X
  857. X# Test the touch command.  Only SysV touch will reset the date.
  858. X
  859. XTouch=touch
  860. X[ -x /usr/5bin/touch ] && Touch=/usr/5bin/touch
  861. Xif $Touch 2>&1 | fgrep '[-amc]' > /dev/null; then
  862. X  :
  863. Xelse 
  864. X  Touch=true
  865. Xfi
  866. X
  867. Xwhile [ $# -gt 0 ]
  868. X  do
  869. X    case $1 in
  870. X      -e|-E) shift;;
  871. X          *) exp=`expr $1 : "-*[eE]*\([0-9]*\)"`; break;;
  872. X    esac
  873. X  done
  874. X[ -z "$exp" ] && { echo "usage: $0 days"; exit; }
  875. X
  876. X# Get the local spool names from config (if it exists) and add Junk.
  877. X
  878. Xif [ -r $Config ]; then
  879. X  spool=`sed -n "s/^[^#][^    ]*[     ]*\(.*\)[     ]*.*/\1/p" $Config`
  880. Xelse
  881. X  spool=''
  882. Xfi
  883. Xspool="$spool $Junk"
  884. X
  885. X# Now expire the spools, one at at time, resetting
  886. X# the timestamp if the  touch command works.
  887. X
  888. Xfor i in $spool
  889. X  do
  890. X    [ -w $Newsdir$i ] || continue
  891. X    Tmp=/tmp/expire.$$
  892. X    Time=/tmp/time.$$
  893. X    trap 'rm -f $Tmp $Time' 1 2 3 15
  894. X
  895. X    awk '
  896. X      BEGIN {
  897. X    month["Jan"] = 1
  898. X    month["Feb"] = 2
  899. X    month["Mar"] = 3
  900. X    month["Apr"] = 4
  901. X    month["May"] = 5
  902. X    month["Jun"] = 6
  903. X    month["Jul"] = 7
  904. X    month["Aug"] = 8
  905. X    month["Sep"] = 9
  906. X    month["Oct"] = 10
  907. X    month["Nov"] = 11
  908. X    month["Dec"] = 12
  909. X    expired = 0
  910. X    df = split ("'"`date`"'", now)
  911. X    split("31 28 31 30 31 30 31 31 30 31 30 31", days)
  912. X    n = (now[df] - 1901) * 365 + int((now[df] - 1901) / 4)
  913. X    if (now[df] % 4 == 0)
  914. X      days[2]++
  915. X    for (i = 1; i < month[now[2]]; i++)
  916. X      n += days[i]
  917. X    zap = n + now[3]
  918. X      }  
  919. X
  920. X      /^From / && expired == 0 { 
  921. X    n = ($7 - 1901) * 365 + int(($7 - 1901) / 4)
  922. X    for (i = 1; i < month[$4]; i++)
  923. X      n += days[i]
  924. X    if (n + $5 > zap - expd)
  925. X      expired = 1
  926. X      }
  927. X      expired == 1 { print $0 > Tmp }
  928. X
  929. X      END { 
  930. X    n=split(ls_l, ls)
  931. X    split(ls[n-1], time, ":")
  932. X    printf "%02d%02d%02d%02d\n", month[ls[n-3]], ls[n-2], time[1], time[2]
  933. X      }
  934. X      ' expd="$exp" ls_l="`ls -l $Newsdir$i`" Tmp="$Tmp" $Newsdir$i > $Time
  935. X
  936. X# Move the spool first, then touch, in case tmp is
  937. X# on a different file system from the news spools.
  938. X    if [ -s $Tmp ]; then
  939. X      mv $Tmp $Newsdir$i
  940. X      $Touch `cat $Time` $Newsdir$i
  941. X    else
  942. X      rm $Newsdir$i $Tmp
  943. X    fi
  944. X    rm -f $Time
  945. Xdone
  946. Xexit 0
  947. X
  948. END_OF_FILE
  949.   if test 2286 -ne `wc -c <'expire.S'`; then
  950.     echo shar: \"'expire.S'\" unpacked with wrong size!
  951.   fi
  952.   # end of 'expire.S'
  953. fi
  954. if test -f 'init.c' -a "${1}" != "-c" ; then 
  955.   echo shar: Will not clobber existing file \"'init.c'\"
  956. else
  957.   echo shar: Extracting \"'init.c'\" \(1022 characters\)
  958.   sed "s/^X//" >'init.c' <<'END_OF_FILE'
  959. X/*
  960. X * init.c
  961. X * copyright 1991 Ronald Florence 
  962. X * @(#) version 2.1 (ron@mlfarm.com, 23 Aug 1991)
  963. X */
  964. X
  965. X#define INIT
  966. X#include "bsnews.h"
  967. X
  968. Xchar  *malloc();
  969. X
  970. Xinit()
  971. X{
  972. X  FILE *cf;
  973. X  char buffer[256], nbuf[80], lbuf[80];
  974. X  int i = 0;
  975. X
  976. X  if (cf = fopen(Configfile, "r"))
  977. X    while (fgets(buffer, sizeof(buffer), cf) != NULL)
  978. X      {
  979. X    if (i > Maxgroup - 2)
  980. X      {
  981. X        fputs("Too many newsgroups.\n", stderr);
  982. X        exit(1);
  983. X      }
  984. X    if (*buffer != '#' && sscanf(buffer, "%s %s", nbuf, lbuf) >= 2)
  985. X      (void) fill_struct(i++, nbuf, lbuf);
  986. X      }
  987. X  (void) fill_struct(i, "various newsgroups", Junk);
  988. X  return i;
  989. X}
  990. X
  991. X
  992. Xfill_struct(n, nbuf, lbuf)
  993. X     int  n;
  994. X     char *nbuf, *lbuf;
  995. X{
  996. X  newsgroup[n] = (Group *)malloc(sizeof(Group));
  997. X  newsgroup[n]->len = strlen(nbuf);
  998. X  newsgroup[n]->usenet = malloc(newsgroup[n]->len + 1);
  999. X  newsgroup[n]->local = malloc(sizeof(Newsdir) + strlen(lbuf) + 1);
  1000. X  strcpy(newsgroup[n]->usenet, nbuf);
  1001. X  strcpy(newsgroup[n]->local, Newsdir);
  1002. X  strcat(newsgroup[n]->local, lbuf);
  1003. X  newsgroup[n]->found = 0;
  1004. X}
  1005. X
  1006. END_OF_FILE
  1007.   if test 1022 -ne `wc -c <'init.c'`; then
  1008.     echo shar: \"'init.c'\" unpacked with wrong size!
  1009.   fi
  1010.   # end of 'init.c'
  1011. fi
  1012. if test -f 'mail.ed' -a "${1}" != "-c" ; then 
  1013.   echo shar: Will not clobber existing file \"'mail.ed'\"
  1014. else
  1015.   echo shar: Extracting \"'mail.ed'\" \(74 characters\)
  1016.   sed "s/^X//" >'mail.ed' <<'END_OF_FILE'
  1017. X/uux/s/uux - -r \($H.*ws\) \(< $T.*t\)/sed 's\/\^\/N\/' \2 | mail \1/
  1018. Xw
  1019. Xq
  1020. END_OF_FILE
  1021.   if test 74 -ne `wc -c <'mail.ed'`; then
  1022.     echo shar: \"'mail.ed'\" unpacked with wrong size!
  1023.   fi
  1024.   # end of 'mail.ed'
  1025. fi
  1026. if test -f 'makefile.pc' -a "${1}" != "-c" ; then 
  1027.   echo shar: Will not clobber existing file \"'makefile.pc'\"
  1028. else
  1029.   echo shar: Extracting \"'makefile.pc'\" \(519 characters\)
  1030.   sed "s/^X//" >'makefile.pc' <<'END_OF_FILE'
  1031. X# makefile.pc
  1032. X# Auxiliary makefile for non-Unix systems.
  1033. X# Copyright 1991 Ronald Florence
  1034. X# @(#) version 2.11 (ron@mlfarm.com, 4 Oct 1991)
  1035. X
  1036. X# Your C compiler.
  1037. XCC = cc
  1038. X
  1039. X# Add -DVERBOSE for reports of articles spooled,
  1040. X# Change the flag for defines from -D  to -d  for Amiga/Lattice
  1041. XCFLAGS = -O -DNOTUNIX -DVERBOSE
  1042. X
  1043. XSRCS = rnews.c myname.c init.c
  1044. X
  1045. Xdos:    $(SRCS) bsnews.h 
  1046. X    $(CC) -DMSDOS $(CFLAGS) $(SRCS)
  1047. X    $(CC) -DMSDOS $(CFLAGS) uudecode.c
  1048. X
  1049. Xamiga:    $(SRCS) bsnews.h 
  1050. X    $(CC) $(CFLAGS) $(SRCS)
  1051. X    $(CC) $(CFLAGS) uudecode.c
  1052. X
  1053. X
  1054. END_OF_FILE
  1055.   if test 519 -ne `wc -c <'makefile.pc'`; then
  1056.     echo shar: \"'makefile.pc'\" unpacked with wrong size!
  1057.   fi
  1058.   # end of 'makefile.pc'
  1059. fi
  1060. if test -f 'myname.c' -a "${1}" != "-c" ; then 
  1061.   echo shar: Will not clobber existing file \"'myname.c'\"
  1062. else
  1063.   echo shar: Extracting \"'myname.c'\" \(1589 characters\)
  1064.   sed "s/^X//" >'myname.c' <<'END_OF_FILE'
  1065. X/*
  1066. X * myname.c
  1067. X * copyright 1991 Ronald Florence 
  1068. X * @(#) version 2.1 (ron@mlfarm.com, 30 Aug 1991)
  1069. X */
  1070. X
  1071. X#include "bsnews.h"
  1072. X
  1073. X#ifdef CHECKNAME
  1074. Xmain()
  1075. X{
  1076. X  char *myname();
  1077. X
  1078. X  fprintf(stderr, "\nIf your node name is not `%s' ", myname());
  1079. X  fprintf(stderr, "check the OPTIONS in your Makefile.\n\n");
  1080. X  exit(0);
  1081. X}
  1082. X#endif
  1083. X
  1084. X
  1085. Xchar *myname()
  1086. X{
  1087. X#ifdef IAM
  1088. X  return (IAM);
  1089. X}
  1090. X#else
  1091. X#ifdef UNAME
  1092. X#include <sys/utsname.h>
  1093. X
  1094. X  static struct utsname utn;
  1095. X
  1096. X  (void) uname(&utn);
  1097. X  return(utn.nodename);
  1098. X}
  1099. X#else  /* not UNAME */
  1100. X  static char nodename[64];
  1101. X
  1102. X#ifdef GETHOSTNAME
  1103. X  extern int gethostname();
  1104. X
  1105. X  (void) gethostname(nodename, (int) sizeof(nodename));
  1106. X  nodename[sizeof(nodename)] = 0;
  1107. X  return(nodename);
  1108. X}
  1109. X#else   /* not GETHOSTNAME */
  1110. X
  1111. X  FILE *whoami;
  1112. X
  1113. X  char *cp, *strchr(), *strpbrk();
  1114. X
  1115. X  if ((whoami = fopen("/etc/whoami", "r")) || 
  1116. X      (whoami = fopen("/etc/systemid", "r"))) 
  1117. X    {
  1118. X      fgets(nodename, sizeof(nodename), whoami);
  1119. X      fclose(whoami);
  1120. X      if (cp = strchr(nodename, '\n'))
  1121. X    *cp = '\0';
  1122. X      return(nodename);
  1123. X    }
  1124. X  if ((whoami = fopen("/usr/include/whoami.h", "r")) != 0) 
  1125. X    {
  1126. X      while (!feof(whoami)) 
  1127. X    {
  1128. X      char    buf[100];
  1129. X      
  1130. X      if (fgets(buf, 100, whoami) == 0)
  1131. X        break;
  1132. X      if (sscanf(buf, "#define sysname \"%[^\"]\"", nodename))
  1133. X        break;
  1134. X    }
  1135. X      fclose(whoami);
  1136. X      return (nodename);
  1137. X    }
  1138. X  if ((whoami = popen("uuname -l", "r")) != 0) 
  1139. X    {
  1140. X      fgets(nodename, sizeof(nodename), whoami);
  1141. X      pclose(whoami);
  1142. X      if (cp = strpbrk(nodename, " \n"))
  1143. X    *cp = '\0';
  1144. X      return (nodename);
  1145. X    }
  1146. X  return("unknown");
  1147. X}
  1148. X#endif
  1149. X#endif
  1150. X#endif
  1151. END_OF_FILE
  1152.   if test 1589 -ne `wc -c <'myname.c'`; then
  1153.     echo shar: \"'myname.c'\" unpacked with wrong size!
  1154.   fi
  1155.   # end of 'myname.c'
  1156. fi
  1157. if test -f 'pn.S' -a "${1}" != "-c" ; then 
  1158.   echo shar: Will not clobber existing file \"'pn.S'\"
  1159. else
  1160.   echo shar: Extracting \"'pn.S'\" \(1411 characters\)
  1161.   sed "s/^X//" >'pn.S' <<'END_OF_FILE'
  1162. X%STARTSCRIPT% /bin/sh
  1163. X# pn - news poster for bootstrap news 
  1164. X# Copyright 1989, 1991 Ronald Florence 
  1165. X# @(#) version 2.2 (ron@mlfarm.com, 21 Jul 1992)
  1166. X
  1167. XHostname=BigNode
  1168. Xeditor=${EDITOR:-vi}
  1169. Xpager=${PAGER:-more}
  1170. XDate="`set \`TZ=GMT0 date\`
  1171. X  case $5 in
  1172. X    19*) date -u '+%a %h %d %T %Z %Y' ;;
  1173. X    GMT) echo $* ;;
  1174. X      *) date -u ;;
  1175. X  esac`"
  1176. Xset $Date
  1177. XDatestr="$3 $2 `expr $6 % 100` $4 $5"
  1178. XID=`echo "$6$2$3.$4" | tr -d "\072"`
  1179. XSys=`uuname -l | tr -d "\012\040"`
  1180. XDomain=''
  1181. X[ -x /usr/bin/domainname ] && Domain=`domainname`
  1182. X[ -z "$Domain" ] && Domain=UUCP
  1183. XUser=`logname`
  1184. XName=`sed -n "s/^$User:.*:.*:.*:\(.*\):.*:.*$/\1/p" /etc/passwd`
  1185. XSig=$HOME/.signature
  1186. X
  1187. Xif echo "zip\c" | fgrep "c" > /dev/null; then
  1188. X  c=''
  1189. X  n='-n'
  1190. Xelse
  1191. X  c='\c'
  1192. X  n=''
  1193. Xfi
  1194. Xecho $n "Newsgroups: $c"
  1195. Xread Groups
  1196. Xecho $n "Subject: $c"
  1197. Xread Subject
  1198. X
  1199. XTmpart=/tmp/newsart.$$
  1200. Xtrap 'rm -f $Tmpart' 1 2 3 15
  1201. X
  1202. Xcat > $Tmpart <<EOH
  1203. XPath: $Sys!$User
  1204. XFrom: $User@$Sys.$Domain ($Name)
  1205. XNewsgroups: $Groups
  1206. XSubject: $Subject
  1207. XMessage-ID: <$ID@$Sys.$Domain>
  1208. XDate: $Datestr
  1209. X
  1210. X
  1211. XEOH
  1212. X
  1213. X$editor +8 $Tmpart
  1214. Xclear
  1215. X[ -r $Sig ] && (echo ""; echo "--" ; cat $Sig) >> $Tmpart
  1216. X$pager $Tmpart
  1217. Xecho ""
  1218. Xecho $n "Post this article to all of usenet? $c"
  1219. Xwhile read yn
  1220. X  do case $yn in
  1221. X    y*|Y*) uux - -r $Hostname!rnews < $Tmpart
  1222. X       echo "Posted!"
  1223. X       break ;;
  1224. X    n*|N*) echo "Article cancelled!"
  1225. X       break ;;
  1226. X        *) echo $n "Yes or no? $c" ;;
  1227. X    esac
  1228. X  done
  1229. Xrm -f $Tmpart
  1230. END_OF_FILE
  1231.   if test 1411 -ne `wc -c <'pn.S'`; then
  1232.     echo shar: \"'pn.S'\" unpacked with wrong size!
  1233.   fi
  1234.   # end of 'pn.S'
  1235. fi
  1236. if test -f 'readnews.S' -a "${1}" != "-c" ; then 
  1237.   echo shar: Will not clobber existing file \"'readnews.S'\"
  1238. else
  1239.   echo shar: Extracting \"'readnews.S'\" \(753 characters\)
  1240.   sed "s/^X//" >'readnews.S' <<'END_OF_FILE'
  1241. X%STARTSCRIPT% /bin/sh
  1242. X# readnews - news reader for bootstrap news
  1243. X# copyright 1991 Ronald Florence 
  1244. X# @(#) version 2.2 (ron@mlfarm.com, 23 Jul 1992)
  1245. X
  1246. XNewsdir=%NEWSDIR%/
  1247. XReader="%READER%"
  1248. XConfig=%NEWSLIB%/config
  1249. X
  1250. Xtrap '(echo ""; echo "$0: $HOME/.lastnews has not been updated."; exit)' 1 2 3 
  1251. X
  1252. Xif [ $# -eq 0 ] 
  1253. X  then for i in `ls $Newsdir`
  1254. X    do
  1255. X      [ -r $Newsdir$i ] && $Reader $Newsdir$i
  1256. X    done
  1257. Xelse for spool in $*
  1258. X  do
  1259. X    if [ -r $Newsdir$spool ]
  1260. X      then $Reader $Newsdir$spool
  1261. X    elif [ -r $Config ]
  1262. X      then 
  1263. X        local=`sed -n "s/^$spool[     ]*\(.*\)[     ]*.*/\1/p" $Config`
  1264. X        [ -r "$Newsdir$local" ] && $Reader "$Newsdir$local"
  1265. X    else 
  1266. X      echo "$0: cannot find $Config"
  1267. X      exit 1
  1268. X    fi
  1269. X  done
  1270. Xfi
  1271. X
  1272. Xtouch $HOME/.lastnews
  1273. END_OF_FILE
  1274.   if test 753 -ne `wc -c <'readnews.S'`; then
  1275.     echo shar: \"'readnews.S'\" unpacked with wrong size!
  1276.   fi
  1277.   # end of 'readnews.S'
  1278. fi
  1279. if test -f 'rnews.c' -a "${1}" != "-c" ; then 
  1280.   echo shar: Will not clobber existing file \"'rnews.c'\"
  1281. else
  1282.   echo shar: Extracting \"'rnews.c'\" \(5507 characters\)
  1283.   sed "s/^X//" >'rnews.c' <<'END_OF_FILE'
  1284. X/*
  1285. X * rnews.c 
  1286. X * copyright 1991 Ronald Florence
  1287. X * @(#) version 2.2 (ron@mlfarm.com, 23 Jul 1992)
  1288. X */
  1289. X
  1290. X#include <time.h>
  1291. X#include "bsnews.h"
  1292. X
  1293. X#ifdef MSDOS
  1294. X#include <fcntl.h>
  1295. Xchar *dosgets();
  1296. X#define fgets        dosgets
  1297. X#define Readmode    "rb"
  1298. X#define Writemode    "wb"
  1299. X#else
  1300. X#define Readmode    "r"
  1301. X#define Writemode    "w"
  1302. X#endif
  1303. X
  1304. X#define bye(s)        perror(s), exit(1)
  1305. X
  1306. X#ifndef Compdir
  1307. X#define Compdir        "/usr/bin"
  1308. X#endif
  1309. X
  1310. X
  1311. Xchar  *iam, notify[80], dcomp[80], tmpnews[20], *mktemp(), *strcat();
  1312. Xlong  time();
  1313. XFILE  *cf, *nf;
  1314. Xint   ngroups;
  1315. X
  1316. Xmain()
  1317. X{
  1318. X  extern char   *myname();
  1319. X  int i;
  1320. X  register  c;
  1321. X  int    new = 0, n;
  1322. X  char  buf[BUFSIZ];
  1323. X
  1324. X#ifdef NOTUNIX
  1325. X#ifdef MSDOS
  1326. X  setmode(fileno(stdin), O_BINARY);
  1327. X#endif
  1328. X#define pclose        fclose
  1329. X  sprintf(tmpnews, "%08.8lX.Z", time((long *) 0));
  1330. X  sprintf(dcomp, "compress -d %s", tmpnews);
  1331. X#else
  1332. X  sprintf(notify, "mail %s", Notify);
  1333. X  strcpy(tmpnews, "/tmp/news.XXXXXX");
  1334. X  mktemp(tmpnews);
  1335. X  sprintf(dcomp, "%s/compress -dc > %s", Compdir, tmpnews);
  1336. X#ifdef NICE
  1337. X  if ((i = nice(0)) < NICE)
  1338. X    (void) nice(NICE - i);
  1339. X#endif 
  1340. X#endif
  1341. X
  1342. X  iam = myname();
  1343. X  ngroups = init();
  1344. X  while (fgets(buf, BUFSIZ, stdin) != NULL)
  1345. X    {
  1346. X      if (!strncmp(buf, "#! ", 3))
  1347. X    {
  1348. X      if (!strncmp(buf+3, "cunbatch", 8))
  1349. X                /* A compressed batch: for Unix pipe to */
  1350. X                /* uncompress;  for others, we'll open */
  1351. X                /* a temp file (BINARY mode for ms-dos). */
  1352. X        {
  1353. X#ifdef NOTUNIX
  1354. X          if (!(cf = fopen(tmpnews, Writemode)))
  1355. X        bye(tmpnews);
  1356. X#else
  1357. X          if (!(cf = popen(dcomp, "w")))
  1358. X        bye(dcomp);
  1359. X#endif
  1360. X          while ((c = getchar()) != EOF)
  1361. X        putc(c, cf);
  1362. X          pclose(cf);
  1363. X#ifdef NOTUNIX
  1364. X          tmpnews[8] = '\0';
  1365. X          if (system(dcomp))
  1366. X        bye(dcomp);
  1367. X#endif
  1368. X                /* Reopen the uncompressed batch as */
  1369. X                /* stdin, using BINARY mode for ms-dos */
  1370. X          if ((cf = freopen(tmpnews, Readmode, stdin)) == NULL)
  1371. X        bye(tmpnews);
  1372. X          continue;
  1373. X        }
  1374. X      else if (sscanf(buf+3, "rnews %d", &n) == 1)
  1375. X                /* The byte count for each article in */
  1376. X                /* a batch includes the \n, but not */
  1377. X                /* the ms-dos \r that might be there. */
  1378. X        {
  1379. X          for (c = 0, new = 0; c < n; new++)
  1380. X        {
  1381. X          if (fgets(buf, BUFSIZ, stdin) == NULL)
  1382. X            break;
  1383. X          c += strlen(buf);
  1384. X          (void) parse_line(buf, new);
  1385. X        }
  1386. X          continue;
  1387. X        }
  1388. X    }
  1389. X      else            /* unbatched news */
  1390. X    (void) parse_line(buf, new++);
  1391. X    }
  1392. X  unlink(tmpnews);
  1393. X
  1394. X#ifdef VERBOSE
  1395. X  for (i = 0; i <= ngroups; i++)
  1396. X    if (newsgroup[i]->found)
  1397. X      printf("%4d  %-25s%s\n", newsgroup[i]->found,
  1398. X         newsgroup[i]->usenet, newsgroup[i]->local);
  1399. X#endif
  1400. X  exit(0);
  1401. X}
  1402. X
  1403. X
  1404. Xparse_line(buf, cont)
  1405. X     char *buf;
  1406. X     int  cont;
  1407. X{
  1408. X  static int h, eoh = 0, pipe = 0;
  1409. X  int    i, got;
  1410. X  static char *hold[20], from[256];
  1411. X  char   *sp, *ep, *ctime(), *malloc(), *strchr(), *strtok();
  1412. X  long   clock;
  1413. X
  1414. X  if (!cont) 
  1415. X    h = 0;
  1416. X  if (h >= 0)
  1417. X                /* Allocate a pointer to hold each */
  1418. X                /* header, until we have the From */
  1419. X                /* address and the newsgroup. */
  1420. X    {
  1421. X      hold[h] = malloc(strlen(buf) + 1);
  1422. X      strcpy(hold[h++], buf);
  1423. X      if (!strncmp(buf, "From: ", 6))
  1424. X                /* Parse the email address in either */
  1425. X                /* format: Joe Blow <jb@blowhard.edu> */
  1426. X                /* or jb@blowhard.edu (Joe Blow) */
  1427. X    {
  1428. X      if (sp = strchr(buf, '<'))
  1429. X        {
  1430. X          sp++;
  1431. X          ep = strchr(buf, '>');
  1432. X        }
  1433. X      else
  1434. X        {
  1435. X          sp = &buf[6];
  1436. X          ep = strchr(buf, '(');
  1437. X        }
  1438. X      if (ep == NULL)
  1439. X        ep = strchr(buf, '\n');
  1440. X      *ep = '\0';
  1441. X      strcpy(from, sp);
  1442. X      eoh++;
  1443. X    }
  1444. X      if (!strncmp(buf, "Newsgroups: ", 12))
  1445. X                /* If none of the newsgroups in the */
  1446. X                /* config file is named, write the */
  1447. X                /* article to the default spool. */
  1448. X    {
  1449. X      got = 0;
  1450. X      if (nf)
  1451. X        {
  1452. X          if (pipe)
  1453. X        {
  1454. X          pclose(nf);
  1455. X          pipe = 0;
  1456. X        }
  1457. X          else
  1458. X        fclose(nf);
  1459. X        }
  1460. X      sp = strtok(buf, " ");
  1461. X      while (!got && (sp = strtok(0, ", ")))
  1462. X        {
  1463. X          for (i = 0; i < ngroups; i++)
  1464. X        if (!strncmp(newsgroup[i]->usenet, sp, newsgroup[i]->len))
  1465. X          {
  1466. X            got++;
  1467. X            break;
  1468. X          }
  1469. X        }
  1470. X      if (!(nf = fopen(newsgroup[i]->local, "a")))
  1471. X        {
  1472. X#ifndef NOTUNIX
  1473. X          if ((nf = popen(notify, "w")))
  1474. X        {
  1475. X          pipe = 1;
  1476. X          fprintf(nf, "Subject: rnews: problem opening %s\n", 
  1477. X              newsgroup[i]->local);
  1478. X        }
  1479. X          else
  1480. X#endif
  1481. X        bye(newsgroup[i]->local);
  1482. X        }
  1483. X      newsgroup[i]->found++;
  1484. X      eoh++;
  1485. X    }
  1486. X      if (eoh == 2 || *buf == '\n')
  1487. X    {
  1488. X                /* A bogus article w/o a newsgroup? */
  1489. X      if (eoh < 2) 
  1490. X        {
  1491. X#ifndef NOTUNIX
  1492. X          if ((nf = popen(notify, "w")))
  1493. X        {
  1494. X          pipe = 1;
  1495. X          fprintf(nf, "Subject: rnews: bogus news article?\n");
  1496. X        }
  1497. X          else
  1498. X        {
  1499. X#endif
  1500. X          nf = stderr;
  1501. X          fprintf(nf, "\n* BOGUS NEWS ARTICLE *");
  1502. X        }
  1503. X#ifndef NOTUNIX
  1504. X        }
  1505. X#endif
  1506. X                /* Build the initial mail-file header. */
  1507. X      time(&clock);
  1508. X      fprintf(nf, "\n\nFrom %s %s", from, ctime(&clock));
  1509. X      for (i = 0; i < h; i++)
  1510. X        {
  1511. X                /* Add the local name to the path */
  1512. X          if (!strncmp(hold[i], "Path: ", 6))
  1513. X        fprintf(nf, "Path: %s!%s", iam, &hold[i][6]);
  1514. X          else
  1515. X        fputs(hold[i], nf);
  1516. X          free(hold[i]);
  1517. X        }
  1518. X      h = -1;
  1519. X      eoh = 0;
  1520. X    }
  1521. X    }
  1522. X  else
  1523. X    {
  1524. X      if (!strncmp(buf, "From ", 5))
  1525. X    putc('>', nf);
  1526. X      fputs(buf, nf);
  1527. X    }
  1528. X}
  1529. X
  1530. X
  1531. X                /* An fgets that filters out the \r in */
  1532. X                /* an ms-dos line-ending -- yucch! */
  1533. X#ifdef MSDOS
  1534. Xchar *dosgets(s, n, iop)
  1535. X     char  *s;
  1536. X     int   n;
  1537. X     register  FILE  *iop;
  1538. X{
  1539. X  register  c;
  1540. X  register  char  *p;
  1541. X    
  1542. X  p = s;
  1543. X  while (--n > 0 && (c = getc(iop)) != EOF)  
  1544. X    {
  1545. X      if (c != '\r')
  1546. X        *p++ = c;
  1547. X      if (c == '\n')
  1548. X    break;
  1549. X    }
  1550. X  if (c == EOF && p == s)
  1551. X    return NULL;
  1552. X  *p = '\0';  
  1553. X  return s;
  1554. X}
  1555. X#endif
  1556. END_OF_FILE
  1557.   if test 5507 -ne `wc -c <'rnews.c'`; then
  1558.     echo shar: \"'rnews.c'\" unpacked with wrong size!
  1559.   fi
  1560.   # end of 'rnews.c'
  1561. fi
  1562. if test -f 'uudecode.c' -a "${1}" != "-c" ; then 
  1563.   echo shar: Will not clobber existing file \"'uudecode.c'\"
  1564. else
  1565.   echo shar: Extracting \"'uudecode.c'\" \(1013 characters\)
  1566.   sed "s/^X//" >'uudecode.c' <<'END_OF_FILE'
  1567. X/*
  1568. X * uudecode.c
  1569. X * copyright 1991 Ronald Florence
  1570. X * @(#) version 2.1 (ron@mlfarm.com, 6 Sep 1991)
  1571. X */
  1572. X
  1573. X#include <stdio.h>
  1574. X
  1575. X#define DEC(c)    (((c) - ' ') & 077)
  1576. X#define Err(s)    perror(s), exit(1)
  1577. X
  1578. X#ifdef MSDOS
  1579. X#define Writemode    "wb"
  1580. X#else
  1581. X#define Writemode    "w"
  1582. X#endif
  1583. X
  1584. Xmain(argc, argv)
  1585. X     int argc;
  1586. X     char **argv;
  1587. X{
  1588. X  int n, i;
  1589. X  char dest[128], buf[128], inb[4];
  1590. X
  1591. X  if (argc > 1 && !freopen(*++argv, "r", stdin))
  1592. X    Err(*argv);
  1593. X
  1594. X  while (fgets(buf, sizeof(buf), stdin) != NULL)
  1595. X    if (sscanf(buf, "begin %o %s\n", &n, dest) == 2)
  1596. X      break;
  1597. X  if (!freopen(dest, Writemode, stdout))
  1598. X    Err(dest);
  1599. X
  1600. X#ifndef NOTUNIX
  1601. X  chmod(dest, n);
  1602. X#endif
  1603. X
  1604. X  while ((n = getchar()) != EOF && (n = DEC(n)))  
  1605. X    {
  1606. X      while (n > 0) 
  1607. X    {
  1608. X      for (i = 0; i <= 3; i++)
  1609. X        inb[i] = DEC(getchar());
  1610. X      if (n-- > 0) 
  1611. X        putchar(inb[0] << 2 | inb[1] >> 4);
  1612. X      if (n-- > 0) 
  1613. X        putchar(inb[1] << 4 | inb[2] >> 2);
  1614. X      if (n-- > 0) 
  1615. X        putchar(inb[2] << 6 | inb[3]);
  1616. X    }
  1617. X      while (getchar() != '\n')
  1618. X    ;
  1619. X    }
  1620. X  exit(0);
  1621. X}
  1622. END_OF_FILE
  1623.   if test 1013 -ne `wc -c <'uudecode.c'`; then
  1624.     echo shar: \"'uudecode.c'\" unpacked with wrong size!
  1625.   fi
  1626.   # end of 'uudecode.c'
  1627. fi
  1628. if test -f 'uurec.S' -a "${1}" != "-c" ; then 
  1629.   echo shar: Will not clobber existing file \"'uurec.S'\"
  1630. else
  1631.   echo shar: Extracting \"'uurec.S'\" \(1324 characters\)
  1632.   sed "s/^X//" >'uurec.S' <<'END_OF_FILE'
  1633. X%STARTSCRIPT% /bin/sh
  1634. X# uurec - bootstrap news by mail 
  1635. X# copyright 1991 Ronald Florence  
  1636. X# @(#) version 2.2 (ron@mlfarm.com, 21 Jul 1992)
  1637. X#
  1638. X# A version for gawk or nawk would be cleaner; this is portable.
  1639. X
  1640. XNewsdir=%NEWSDIR%/
  1641. XConfig=%NEWSLIB%/config
  1642. XJunk=%JUNK%
  1643. X
  1644. Xawk '
  1645. X  BEGIN { 
  1646. X      df = split ("'"`date`"'", now)
  1647. X      date = now[1] " " now[2] " " now[3] " " now[4] " " now[df]
  1648. X      header = -1
  1649. X        }
  1650. X  FILENAME ~ /config$/ {
  1651. X                 if ( $0 !~ /^#/ && NF == 2 )
  1652. X                   spool[$1] = $2
  1653. X                   next 
  1654. X                   }
  1655. X  $0 !~ /^N/  { next }
  1656. X  header == -1 && $0 ~ /^N/  { header = 1 }
  1657. X  header == 0   { 
  1658. X          if ( $0 ~ /^NFrom / )
  1659. X             printf ">" >> out
  1660. X          print substr($0, 2) >> out
  1661. X          next 
  1662. X                }
  1663. X  $1 ~ /^NPath:/ { hold[header++] = "Path: " node "!" $2; next }
  1664. X         { hold[header++] = substr($0, 2) }
  1665. X  $1 ~ /^NFrom:/ { from = $2 }
  1666. X  $1 ~ /^NNewsgroups:/  { 
  1667. X              n = split($2, ng, ",")
  1668. X              for (group in spool)
  1669. X                for (i = 1; i <= n; i++)
  1670. X                      if (ng[i] == group)
  1671. X                    { out = newsdir spool[group]; break }
  1672. X            }
  1673. X  $1 !~ /^N.*:/ { 
  1674. X          print "\nFrom " from " " date >> out
  1675. X          for (i = 1; i < header - 1; i++) 
  1676. X            print hold[i] >> out
  1677. X          print substr($0, 2) >> out
  1678. X          header = 0  
  1679. X             } 
  1680. X  ' newsdir="$Newsdir" node="`uuname -l`" out="$Newsdir$Junk" $Config -
  1681. X
  1682. END_OF_FILE
  1683.   if test 1324 -ne `wc -c <'uurec.S'`; then
  1684.     echo shar: \"'uurec.S'\" unpacked with wrong size!
  1685.   fi
  1686.   # end of 'uurec.S'
  1687. fi
  1688. if test -f 'whatami.sh' -a "${1}" != "-c" ; then 
  1689.   echo shar: Will not clobber existing file \"'whatami.sh'\"
  1690. else
  1691.   echo shar: Extracting \"'whatami.sh'\" \(2517 characters\)
  1692.   sed "s/^X//" >'whatami.sh' <<'END_OF_FILE'
  1693. X:
  1694. X#! /bin/sh
  1695. X# whatami.sh
  1696. X# copyright 1991 Ronald Florence
  1697. X# @(#) version 2.2 (ron@mlfarm.com, 23 Jul 1992)
  1698. X
  1699. Xsys="looks unusual."
  1700. Xeflag=
  1701. Xlib=*libc.a
  1702. Xlibdir=bogus
  1703. Xcompdir=missing
  1704. Xmandir=?
  1705. Xmanext=?
  1706. XTouch=touch
  1707. XStartscript=
  1708. X
  1709. Xecho ""
  1710. Xecho "This may take a minute..."
  1711. X
  1712. Xfor i in /usr/lib/386 /lib/386 /usr/lib /lib /usr/local/lib
  1713. Xdo
  1714. X  [ -f $i/$lib ] && { libdir=$i; break; }
  1715. Xdone
  1716. X
  1717. Xfor i in /u/bin /usr/lbin /usr/local/bin /usr/ucb /usr/bin /bin
  1718. Xdo
  1719. X  [ -x $i/compress ] && compdir=$i
  1720. Xdone
  1721. X
  1722. Xfor i in manl mann local/man1 local man.LOCAL man1
  1723. Xdo
  1724. X  [ -d /usr/man/$i ] && { mandir=/usr/man/$i; break; }
  1725. Xdone
  1726. X
  1727. Xcase $mandir in
  1728. X  *manl) manext=l ;;
  1729. X  *mann) manext=n ;;
  1730. X  *local|*LOCAL) manext=LOCAL ;;
  1731. X  *1) manext=1 ;;
  1732. Xesac
  1733. X
  1734. Xif [ -f /etc/systemid ]; then
  1735. X  sys="looks like Xenix."
  1736. X  site=`sed 1q /etc/systemid`
  1737. X  Startscript=":"
  1738. Xelif [ -f /etc/whoami ]; then
  1739. X  sys="has /etc/whoami."
  1740. X  site=`sed 1q /etc/whoami`
  1741. Xelif [ -f /usr/include/whoami.h ]; then
  1742. X  sys="has /usr/include/whoami.h."
  1743. X  site=`sed -n "s/.*sysname[     ]*\([^     ]*\).*/\1/p" /usr/include/whoami.h`
  1744. Xelif [ -f /usr/include/sys/utsname.h ]; then
  1745. X  sys="has uname."
  1746. X  site=`uname -n`
  1747. X  eflag="-DUNAME"
  1748. Xelif [ "$libdir" != "bogus" ]; then
  1749. X  nm $libdir/$lib | fgrep gethostname > /dev/null && {
  1750. X    sys="has gethostname()."
  1751. X    site=`hostname`
  1752. X    eflag=-DGETHOSTNAME
  1753. X  }
  1754. Xelse
  1755. X  site=`uuname -l | tr -d "\012\040"`
  1756. X  [ -z "$site" ] || sys="has a working uuname."
  1757. Xfi
  1758. X
  1759. X[ $libdir != "bogus" ] && nm $libdir/$lib | fgrep strchr > /dev/null ||
  1760. X    eflag="$eflag -DBSD"
  1761. X
  1762. Xecho ""
  1763. Xecho "Your system $sys"
  1764. X[ "$compdir" = "missing" ] && 
  1765. X  echo "You need compress for a compressed news feed."
  1766. X[ "$mandir" = "?" ] && 
  1767. X  echo "Not sure where to install the man page on your system."
  1768. X[ -x /usr/5bin/touch ] && Touch=/usr/5bin/touch
  1769. Xif $Touch 2>&1 | fgrep '[-amc]' > /dev/null; then
  1770. X  :
  1771. Xelse
  1772. X  echo "The $Touch command on your system cannot set an arbitrary time; the"
  1773. X  echo "checknews command may incorrectly report new news after expire runs."
  1774. Xfi
  1775. Xif [ -z "$site" ]; then 
  1776. X  echo "I can't find your nodename.  Try"
  1777. X  eflag="$eflag -DIAM=\\\"yournodename\\\""
  1778. Xelse
  1779. X  echo "If your nodename is \`$site', try"
  1780. Xfi
  1781. Xecho "the following changes in the Makefile:"
  1782. Xecho ""
  1783. Xecho "OPTIONS = $eflag"
  1784. Xecho "COMPDIR = $compdir"
  1785. Xecho "MANDIR = $mandir"
  1786. Xecho "MANEXT = $manext"
  1787. X[ -n "$Startscript" ] && echo "STARTSCRIPT = $Startscript"
  1788. Xecho ""
  1789. Xecho "You may want to change these recommendations or add to the OPTIONS."
  1790. Xecho "Please remember to edit READER, FEED, and NOTIFY in the Makefile."
  1791. Xexit 0
  1792. END_OF_FILE
  1793.   if test 2517 -ne `wc -c <'whatami.sh'`; then
  1794.     echo shar: \"'whatami.sh'\" unpacked with wrong size!
  1795.   fi
  1796.   # end of 'whatami.sh'
  1797. fi
  1798. echo shar: End of archive 1 \(of 1\).
  1799. cp /dev/null ark1isdone
  1800. MISSING=""
  1801. for I in 1 ; do
  1802.     if test ! -f ark${I}isdone ; then
  1803.     MISSING="${MISSING} ${I}"
  1804.     fi
  1805. done
  1806. if test "${MISSING}" = "" ; then
  1807.     echo You have the archive.
  1808.     rm -f ark[1-9]isdone
  1809. else
  1810.     echo You still must unpack the following archives:
  1811.     echo "        " ${MISSING}
  1812. fi
  1813. exit 0
  1814. exit 0 # Just in case...
  1815.