home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume19 / rkive / patch01a next >
Encoding:
Internet Message Format  |  1991-05-09  |  55.8 KB

  1. From: kent@sparky.imd.sterling.com (Kent Landfield)
  2. Newsgroups: comp.sources.misc
  3. Subject: v19i019:  rkive - Usenet sources archiver, Patch01a/3
  4. Message-ID: <1991May9.175613.19441@sparky.IMD.Sterling.COM>
  5. Date: 9 May 91 17:56:13 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7.  
  8. Submitted-by: Kent Landfield <kent@sparky.imd.sterling.com>
  9. Posting-number: Volume 19, Issue 19
  10. Archive-name: rkive/patch01a
  11. Patch-To: rkive: Volume 17, Issue 17-22
  12.  
  13. The following three parts make up the first patch to rkive and article
  14. release 2.  The highlights of this patch are:
  15.  
  16.     Local configuration is like its done in B News with a localize.sh.
  17.  
  18.     An INSTALL file has been added describing how to make localize.sh scripts
  19.     and discusses just what some of the configuration parameters are/mean.
  20.  
  21.     Supports the new X-Md4-Signature: header in use in comp.sources.misc.
  22.  
  23.     rkive can now accept articles on standard input... Yes, this time it
  24.     is real... :-)  A sys.cf configuration file is supplied as a sample 
  25.     configuration file for sys file usage.
  26.  
  27.     article now allows the user to specify articles without a compression
  28.     suffix and it will determine if it deals with the article transparently.
  29.  
  30.     Fixed some NNTP usage bugs with external archiving.
  31.     Fixed some Global External-Archiving usage bugs.
  32.  
  33.     Added support for a relative path filename from where the BASEDIR to the
  34.     actual storage location. This is done with a %Z format character.
  35.  
  36.     Added the ability for external command archiving to use the NNTP temporary
  37.     transfer file if they need to. Added the $F specification character to 
  38.     support this.
  39.     
  40.     Updated update_netdocs with some new FAQs. Also shut off "set -x" as the 
  41.     default. That was left over from debugging... :-)
  42.  
  43. I would like to thank the following people for pointing me in the right
  44. direction and helping out with fixes and ideas! 
  45.  
  46.     John Beaudin <uunet!utai!mnetor!tmsoft!beaudin!john>
  47.     Chip Rosenthal <uunet!cs.utexas.edu!chinacat!chip> 
  48.     Chet Wood <uunet!apple.com!arc!chet> 
  49.     Dean Brooks <uunet!coplex!dean>
  50.  
  51. Patch Installation Instructions:
  52.  
  53.     - copy the three parts to the rkive sources directory, 
  54.     - cd to the rkive sources directory,
  55.     - unshar the three parts to this patch, and
  56.     - patch the sources by executing "patch < patch2.1".
  57.  
  58. Please read the INSTALL file that describes how to create a localize.sh
  59. script for making local configuration changes to rkive sources.
  60.  
  61. -----------
  62. For those who do not know what rkive is ...
  63. -----------
  64. rkive - archive USENET source groups
  65.  
  66. rkive is used to archive USENET sources groups, as well as general newsgroups, 
  67. to an alternate location as specified in an rkive configuration file. Archives 
  68. can be maintained in different ways:
  69.  
  70.      Archive-Name, Volume-Issue, Comp-Archives, Chronological,
  71.      Article-Number, Only-Archive-Name, and External-Command.
  72.  
  73. Archive-Name and Volume-Issue methods are for use in archiving the moderated 
  74. sources groups specificially.  Comp-Archives is used to archive the newsgroup 
  75. comp.archives. Chronological and Article-Number can be used for general 
  76. newsgroups. The Only-Archive-Name: method of archiving works well for groups
  77. such as alt.sources. It only archives files that have Archive-name: lines.
  78. The External-Command allows rkive to use a script/program specified by the
  79. archive administrator to do the actual storage of the packages (unshar in a
  80. script, script to maintain periodic postings) while rkive writes the log and 
  81. index file entries, etc.  There is an example of an External-Command script 
  82. included. update_netdocs maintains a set of periodic postings in a common area 
  83. for all to access. This is an example of a good usage of external command 
  84. archiving but it is only an example. If someone wants to do and contribute
  85. a real implementation in perl I'll gladly include it in future releases.
  86.  
  87. By means of a configuration file, the archive administrator is able to control 
  88. how archiving is performed. The administrator can specify on a per newsgroup 
  89. basis:
  90.  
  91.    o The type of the archiving, such as Volume-Issue
  92.      Archive-Name, Article Number archiving, etc,
  93.    o Where the newsgroup archive is to be stored on disk,
  94.    o The location of log file for the newsgroup,
  95.    o The format of the logfile records,
  96.    o The location of index file for the newsgroup,
  97.    o The format of the index file records, 
  98.    o A list of users to be sent mail when an article is archived,
  99.    o The owner/group and modes of each archived member,
  100.    o Only archive articles whose header lines match a pattern,
  101.    o The method for archiving patches, whether with the package or inline,
  102.    o An external program to deal with the located articles,
  103.    o Whether the article is to be verified by some checksum mechanism,
  104.    o Whether the archived members should be compressed or not and
  105.    o Whether the news spool directory is local or accessed via NNTP
  106.  
  107. article - print formatted news article header information
  108.  
  109. article allows the user to display information contained in news 
  110. article headers. This information includes the auxiliary headers 
  111. added by the moderators of the source newsgroups.  article takes 
  112. the names of article files from standard input or as specified on 
  113. the command line. The user can select almost any information contained 
  114. within a news article header and can then specify the way in which 
  115. the information should be displayed. The format that the user specifies 
  116. is much like that of a C printf statement.  article selects, formats, 
  117. and prints its output under control of the format. The format is a 
  118. character string that contains two types of objects: plain characters, 
  119. which are copied directly to the output stream, and selection specifications.
  120. Specifying a selection results in fetching the selected items from 
  121. the news article.  This tool is extremely useful when dealing with
  122. the news system in general as well as dealing with archives.  article
  123. knows about compression facilities and can deal directly with a compressed
  124. set of archive files instead of having to "zcat filename | article".
  125.  
  126. Please see the README in the rkive version 2 release posted to the
  127. newsgroup comp.sources.misc for more information on rkive and article's
  128. capabilities.
  129.  
  130. -Kent+
  131. ----
  132. #!/bin/sh
  133. # This is a shell archive (produced by shar 3.49)
  134. # To extract the files from this archive, save it to a file, remove
  135. # everything above the "!/bin/sh" line above, and type "sh file_name".
  136. #
  137. # made 05/09/1991 15:44 UTC by kent@sparky.IMD.Sterling.COM
  138. # Source directory /s/zoro/home/kent/projects/archive/patch
  139. #
  140. # existing files will NOT be overwritten unless -c is specified
  141. #
  142. # This is part 1 of a multipart archive                                    
  143. # do not concatenate these parts, unpack them in order with /bin/sh        
  144. #
  145. # This shar contains:
  146. # length  mode       name
  147. # ------ ---------- ------------------------------------------
  148. #  11561 -rw-rw-r-- INSTALL
  149. #   7882 -rw-rw-r-- Makefile.dst
  150. #   2596 -rw-r--r-- localize.smpl
  151. #    991 -r--r--r-- sys.cf
  152. #  10930 -r--r--r-- rkive.h.dst
  153. #  91391 -rw-rw-r-- patch2.1
  154. #
  155. if test -r _shar_seq_.tmp; then
  156.     echo 'Must unpack archives in sequence!'
  157.     echo Please unpack part `cat _shar_seq_.tmp` next
  158.     exit 1
  159. fi
  160. # ============= INSTALL ==============
  161. if test -f 'INSTALL' -a X"$1" != X"-c"; then
  162.     echo 'x - skipping INSTALL (File already exists)'
  163.     rm -f _shar_wnt_.tmp
  164. else
  165. > _shar_wnt_.tmp
  166. echo 'x - extracting INSTALL (Text)'
  167. sed 's/^X//' << 'SHAR_EOF' > 'INSTALL' &&
  168. @(#)INSTALL    1.1 5/9/91 
  169. The first step to installing rkive is to customize the configuration to
  170. suit your local needs. In the past, you had to take a fresh distribution 
  171. and edit the rkive.h file and Makefile to suit local preferences. If you
  172. had many local changes, or didn't record the local changes, upgrading
  173. could be a pain...
  174. X
  175. Nearly every site will need to make changes to the rkive configuration
  176. as distributed.  Local configuration of the rkive software requires you 
  177. to edit a couple files. The rkive.h and Makefile files must be created 
  178. from their templates rkive.h.dst and Makefile.dst.  You should create a 
  179. shell script called localize.sh which copies the files and makes local 
  180. changes to the copies.  A sample localize shell script can be found in 
  181. localize.smpl.  
  182. X
  183. The localize.sh shell script you create should copy rkive.h.dst to rkive.h, 
  184. and copy Makefile.dst to Makefile.  It should chmod the files so that your
  185. script can make changes and write the changes out.  It should then invoke 
  186. ed(1) on the files, making any necessary local changes.  Use localize.smpl
  187. as a reference if you need to.  The easiest thing to do is just copy the
  188. localize.smpl to localize.sh and make your local changes to that. It contains
  189. just about every configurable parameter specified in rkive.h and the Makefile.
  190. Just delete the entries that you don't want to change and modify the ones
  191. you do...
  192. X
  193. Once you're finished editing localize.sh, create a rkive.h and Makefile 
  194. tailored for your site with the command
  195. X
  196. X    sh ./localize.sh
  197. X
  198. Inspect rkive.h and Makefile to ensure that all your local customizations
  199. got into your final versions. If you saw a "?" when you ran localize.sh, 
  200. one or both of the files is certainly wrong. It's a good idea to anchor 
  201. the patterns in localize.sh's ed(1) scripts. For instance, use /^BINDIR/
  202. instead of /BINDIR/.
  203. X
  204. Now that you know how to do it, just what things do you need to consider 
  205. when customizing rkive ?
  206. X
  207. RKIVE.H:
  208. X
  209. Ownership: (OWNER, GROUP)
  210. X    Who will the default owner of the archives be ? You might want to
  211. X    consider setting up a user and group just to support the archives for
  212. X    a little added security... Values specified in rkive.h are overridden
  213. X    by values specified in the rkive.cf configuration file.
  214. X
  215. X
  216. File Modes: (MODES, DIR_MODE)
  217. X    What will the default modes of the files be when created. What will
  218. X    the default directory modes be on creation ?  I personally like to keep
  219. X    the archives as just that. Let the others copy the files to another location
  220. X    to unpack. For that reason, I keep file creation as readable by all, 
  221. X    writable by none...  Values specified in rkive.h are overridden by
  222. X    values specified in the rkive.cf configuration file.
  223. X
  224. X
  225. Mailer: (SUBJECT_LINE, MAIL)
  226. X    If you have a smart mailer that supports a "-s subject" command
  227. X    and you wish to have the subject line added when archived mail
  228. X    is sent, define SUBJECT_LINE.  Specify which mail program to use
  229. X    to send the mail by setting MAIL.
  230. X
  231. X
  232. Problem Article Storage: (PROBLEMS_DIR)
  233. X    The PROBLEMS_DIR is the default directory to use in the event 
  234. X    problems are encountered such as duplicate article names and the 
  235. X    execution flags do not specify overwriting. The new, inbound article 
  236. X    is stored in the PROBLEMS_DIR in problems_dir/newsgroup/volume/filename 
  237. X    so that the administrator can review and fix the problem whenever time 
  238. X    becomes available...  The PROBLEMS_DIR define is used only if the 
  239. X    administrator has not specified the PROBLEMS path variable inside of 
  240. X    the LOCATION (rkive.cf config) file.
  241. X
  242. X
  243. News Spool Directory: (SPOOLDIR)
  244. X    I am sure you can figure this one out...
  245. X
  246. X
  247. Location of the Rkive Configuration file: (LOCATION)
  248. X    This specifies the location of the default rkive configuration 
  249. X    file, rkive.cf.
  250. X
  251. X
  252. Dealing With Repostings: (ADD_REPOST_SUFFIX,  REPOST_SUFFIX,  MV_ORIGINAL)
  253. X    If ADD_REPOST_SUFFIX is defined, all reposts will have the 
  254. X    string specified in REPOST_SUFFIX appended to the archive
  255. X    filename so that a repost of elm/part07 would appear in
  256. X    the archive as elm/part07-repost prior to any compression.
  257. X                        *** CAUTION ***
  258. X          This should *not* be used on a filesystem with 14 
  259. X          character file name limits. If you are going to be 
  260. X          making your archive available to the general community 
  261. X          do *not* use this. The portability of filenames is 
  262. X          greatly reduced. This has been added with much hesitation. 
  263. X          The rational was that there was no reason to punish/limit 
  264. X          the functionality just because of limitations of a specific 
  265. X          "brand" of unix and since that "brand" was correcting its 
  266. X          "error" in the future, why not put it in now ? This is *NOT*
  267. X          a configuration item on a per newsgroup basis. It might be 
  268. X          useful for Historical archiving using only Volume/Issue 
  269. X          archiving with no COMPRESSION.
  270. X  
  271. X    If MV_ORIGINAL is defined, the original article is placed into an
  272. X    "original" directory within the problems directory (if duplicated). 
  273. X    The inbound reposted article is placed into the archive in the correct 
  274. X    position.
  275. X
  276. X    If No Reposting Defines are specified, the inbound article is placed 
  277. X    into the archive in the correct position only if the initial article 
  278. X    is not in the archive.  Otherwise the reposted article is placed in 
  279. X    the problems directory as a normal duplicate article is now.
  280. X
  281. X
  282. Volume Directory Basename: (VOLUME)
  283. X    If you wish your volume directories to be Volume, VOL, vOLuMe
  284. X    or any other such nonsense, change the VOLUME define.
  285. X
  286. X
  287. Zero Pad Volume Directory Names: (ZEROFILL)
  288. X    A very small change to construct change the volume directory names 
  289. X    from "volume1" to "volume01". In this manner all of the archive
  290. X    volume directories appear in lexical order instead of jumbled 
  291. X    together in directory listings. 
  292. X
  293. X
  294. Removing Unnecessary Article Headers: (REDUCE_HEADERS)
  295. X    If you wish to have the headers "trimmed" when the file is archived,
  296. X    assure that REDUCE_HEADERS is defined. Currently all header lines that
  297. X    are not either;
  298. X        From:, Newsgroups:, Subject:, Message-ID: Approved:, and Date:
  299. X    will be removed. See news_arc.c if you wish to add or subtract header
  300. X    lines to keep. This can produce a savings of between 200 to 500 bytes
  301. X    per archived article.
  302. X
  303. X
  304. Default Record Formats: (DEFAULT_INDEX_FORMAT, DEFAULT_LOG_FORMAT)
  305. X    These two defines specify a default format for generating either
  306. X    index or log file records in the event that there is no index or 
  307. X    log file format specified for either the newsgroup or for the global 
  308. X    default.  See article.1 for a discussion of the different types of 
  309. X    selection characters available for use in the format specifications.
  310. X
  311. X
  312. How Many Newsgroups Are To Be Archived?: (NUM_NEWSGROUPS)
  313. X    The size of the group array. If you are archiving the world
  314. X    you might need to bump this up...
  315. X
  316. X
  317. Chronological Archiving Storage: (NO_MONTH_DIR)
  318. X    The ifdef NO_MONTH_DIR is used to decide which way Chronological 
  319. X    archives are to be stored. By default for format is something like
  320. X
  321. X          /usenet/alt/sources/volume89/Jun/890629.01
  322. X   
  323. X    If you wish not to have the month directory, define NO_MONTH_DIR
  324. X    and the archives will be stored as
  325. X
  326. X         /usenet/alt/sources/volume89/890629.01
  327. X
  328. X
  329. Which mkdir function do you want to use ?: (MKDIR, USE_SYSMKDIR)
  330. X    Define MKDIR if there is a mkdir() function in your 
  331. X    system library (AT&T 5.2 or earlier systems are probably
  332. X    out of luck..)
  333. X    Define USE_SYSMKDIR if you wish to system off /bin/mkdir.
  334. X    If you do not define either, the function makedir will
  335. X    create the directory itself. PLEASE ASSURE THAT IT WILL
  336. X    WORK FOR YOUR SYSTEM PRIOR TO USING IT... (Should work on
  337. X    System 5.3 and prior SYSV systems.)
  338. X
  339. X
  340. MAKEFILE:
  341. X
  342. Do you wish to have this built with NNTP capabilities ?
  343. X    This requires that you have networking libraries and the
  344. X    NNTP source code available to you during compilation.
  345. X    You will need to specify the base directory location of 
  346. X    the nntp sources using NNTPSRCDIR. If you wish debugging
  347. X    turned on in NNTP, specify that using NNTPDEBUG. You should
  348. X    not have to touch the NNTPFLAGS, NNTPSRCS and NNTPOBJS.
  349. X    If you need EXCELAN networking support defined for nntp,
  350. X    uncomment EXOSFLAGS and EXOSLIBS.
  351. X
  352. X
  353. Are you on a Sequent ?
  354. X    If so, uncomment SFLAGS and since there is not getopt() function
  355. X    available, uncomment GETOPTO and GETOPTC.
  356. X
  357. X
  358. X
  359. Is your system missing the getopt() function ?
  360. X    Uncomment GETOPTO and GETOPTC.
  361. X
  362. X
  363. Which Compiler to use ? 
  364. X    Define your favorite C compiler using CC. 
  365. X
  366. X
  367. Special Compilation Flags needed ?
  368. X    Use FLAGS to set special flags like -g or -O or -Wall...
  369. X    The list goes on...
  370. X
  371. X
  372. YACC Compilation support:
  373. X    Set yacc flags using YFLAGS. Specify which yacc to use with YACC.
  374. X
  375. X
  376. Directory Access Routines Location:
  377. X    rkive needs to have POSIX Compatible directory access routines.
  378. X    If you do not have it builtin to your system libraries then specify
  379. X    the -l option. If you use Doug Gwyn's routines, (or other compatible
  380. X    routines) define the library in which they appear such as -lndir or
  381. X    -lposix. 
  382. X    NOTE THE FOLLOWING PLEASE ...
  383. X       I really need to make it clear that I do not want to cobble up 
  384. X       the sources with directory access methods for every different 
  385. X       flavor of unix.  I did that with lc and it is truly ugly... :-(  
  386. X       If you don't believe me, look for yourself. I have adopted a policy 
  387. X       of using only the dirent directory access routines. Most vendors 
  388. X       are moving towards the POSIX directory access library compatibility 
  389. X       so it seemed like a good idea then and now. For the systems that do 
  390. X       not have that capability, I use Doug Gwyn's POSIX compatible directory 
  391. X       access library that was posted to c.s.unix.  Its well worth installing 
  392. X       and its availability can help you out in more than just rkive.
  393. X       I encourage you to send me patches for all you enhancements and fixes
  394. X       but do not send me patches to add support for your directory routines.
  395. X
  396. X
  397. Additional Libraries:
  398. X    If your system requires additional libraries or if you wish to
  399. X    use shared libraries, add the -l declarations to LIBS below such
  400. X    as -lc_s
  401. X
  402. X
  403. General Items:
  404. X    LP, PR, and NROFF let you configure those items as local taste
  405. X    suits you.
  406. X
  407. X
  408. Where To Put Rkive Executables:
  409. X    Specify where you want to install the rkive executables by setting
  410. X    BINDIR.
  411. X
  412. X
  413. Where To Put Rkive Support Files:
  414. X    Rkive has a couple of support files such as the rkive.cf and
  415. X    update_netdocs. You may want to put other rkive local external 
  416. X    commands somewhere are well. Use RKIVEDIR to specify where they
  417. X    should go.
  418. X
  419. X
  420. **** NOTE ****
  421. X
  422. rkive can be called from the command line using the default rkive.cf or
  423. you can specify a different one to use. If you rkive both from the sys
  424. file and from cron or a command line you will most assuredly need more
  425. than one .cf file. You can use different configuration files to logically
  426. group operations by the time you want it run. An example might be that
  427. you want to use the update_netdocs script (or some other external command)
  428. to archive the monthly postings so that they are not checked each night.
  429. The point here is that you have a lot of flexibility here and it is worth
  430. you while to spend a little time deciding how you want to use rkive to
  431. best suit your individual site needs.
  432. X
  433. SHAR_EOF
  434. chmod 0664 INSTALL ||
  435. echo 'restore of INSTALL failed'
  436. Wc_c="`wc -c < 'INSTALL'`"
  437. test 11561 -eq "$Wc_c" ||
  438.     echo 'INSTALL: original size 11561, current size' "$Wc_c"
  439. rm -f _shar_wnt_.tmp
  440. fi
  441. # ============= Makefile.dst ==============
  442. if test -f 'Makefile.dst' -a X"$1" != X"-c"; then
  443.     echo 'x - skipping Makefile.dst (File already exists)'
  444.     rm -f _shar_wnt_.tmp
  445. else
  446. > _shar_wnt_.tmp
  447. echo 'x - extracting Makefile.dst (Text)'
  448. sed 's/^X//' << 'SHAR_EOF' > 'Makefile.dst' &&
  449. ##########################################################
  450. #
  451. #    @(#)Makefile.dst    2.3 5/9/91 - USENET Source Archiver
  452. #
  453. # This software is Copyright (c) 1989, 1990, 1991 by Kent Landfield.
  454. #
  455. # Permission is hereby granted to copy, distribute or otherwise 
  456. # use any part of this package as long as you do not try to make 
  457. # money from it or pretend that you wrote it.  This copyright 
  458. # notice must be maintained in any copy made.
  459. #
  460. # Use of this software constitutes acceptance for use in an AS IS 
  461. # condition. There are NO warranties with regard to this software.  
  462. # In no event shall the author be liable for any damages whatsoever 
  463. # arising out of or in connection with the use or performance of this 
  464. # software.  Any use of this software is at the user's own risk.
  465. #
  466. #  If you make modifications to this software that you feel 
  467. #  increases it usefulness for the rest of the community, please 
  468. #  email the changes, enhancements, bug fixes as well as any and 
  469. #  all ideas to me. This software is going to be maintained and 
  470. #  enhanced as deemed necessary by the community.
  471. #        
  472. #        Kent Landfield
  473. #        uunet!sparky!kent
  474. #        kent@sparky.imd.sterling.com
  475. #
  476. ##########################################################
  477. X
  478. #
  479. # Do you wish to have this built with NNTP capabilities ?
  480. # This requires that you have networking libraries and the
  481. # NNTP source code available to you during compilation.
  482. #
  483. # Excelan support needed for nntp 
  484. #     Uncomment if needed...
  485. #
  486. #EXOSFLAGS= -I/usr/include/EXOS -DUSG -DEXCELAN
  487. #EXOSLIBS= -lsocket
  488. #
  489. # Specify the base directory location of the nntp sources
  490. # if you wish to give rkive the ability to use nntp to archive.
  491. #
  492. #NNTPSRCDIR=/usr/src/local/cmd/nntp
  493. #NNTPDEBUG=-DDEBUG
  494. #NNTPFLAGS=$(EXOSFLAGS) -I$(NNTPSRCDIR)/common -DNNTP $(NNTPDEBUG)
  495. #NNTPSRCS= $(NNTPSRCDIR)/common/clientlib.c nntpart.c
  496. #NNTPOBJS= clientlib.o nntpart.o
  497. X
  498. #
  499. # Sequent's Compilation flags..
  500. #
  501. #SFLAGS=-Iport
  502. #
  503. # If your system does not have getopt,
  504. # uncomment the next two lines.
  505. #
  506. #GETOPTO=getopt.o
  507. #GETOPTC=./port/getopt.c
  508. X
  509. #
  510. # Define your favorite C compiler here...
  511. #
  512. CC=cc
  513. X
  514. #
  515. # Compilation flags..
  516. #
  517. FLAGS=-g 
  518. CFLAGS=$(SFLAGS) $(FLAGS) $(NNTPFLAGS) 
  519. X
  520. #
  521. # Yacc flags for compilation of match.y
  522. #
  523. YFLAGS=
  524. YACC=yacc
  525. X
  526. #
  527. # Define flags to be passed to lint.
  528. #
  529. LINTFLAGS=$(NNTPFLAGS) 
  530. X
  531. # rkive needs to have POSIX Compatible directory access routines.
  532. # If you do not have it builtin to your system libraries then specify
  533. # the -l option. If you use Doug Gwyn's routines, (or other compatible
  534. # routines) define the library in which they appear such as -lndir or
  535. # -lposix.
  536. #
  537. ACCESSLIB=
  538. X
  539. LDFLAGS=$(EXOSLIBS) $(ACCESSLIB)
  540. X
  541. #
  542. # If your system requires additional libraries or if you wish to
  543. # use shared libraries, add the -l declarations to LIBS below such
  544. # as -lc_s
  545. #
  546. LIBS=
  547. X
  548. I = /usr/include
  549. LP=lpr
  550. PR=nl -n
  551. NROFF=nroff
  552. BINDIR=/usr/local/bin
  553. RKIVEDIR=/usr/local/lib/rkive
  554. MAN1=/usr/man/man1
  555. MAN5=/usr/man/man5
  556. X
  557. MANS=    $(MAN1)/article.1 \
  558. X    $(MAN1)/rkive.1 \
  559. X    $(MAN1)/ckconfig.1 \
  560. X    $(MAN5)/rkive.5
  561. X
  562. CONFIG=    $(RKIVEDIR)/rkive.cf 
  563. X
  564. SCRIPTS= $(RKIVEDIR)/update_netdocs
  565. X
  566. SUPPORT = Makefile README IDEAS MANIFEST
  567. INCLUDES = rkive.h article.h cfg.h patchlevel.h suffix.h
  568. X
  569. ARTICLE_SRCS =  article.c format.c header.c str.c version.c zfopen.c $(GETOPTC)
  570. ARTICLE_OBJS =  article.o afmt.o header.o str.o version.o zfopen.o $(GETOPTO)
  571. X
  572. CKCONFIG_SRCS= ckconfig.c disp_grp.c efopen.c setup.c str.c version.c $(GETOPTC)
  573. CKCONFIG_OBJS= ckconfig.o disp_grp.o efopen.o setup.o str.o version.o $(GETOPTO)
  574. X
  575. ARCHIVE_SRCS =  ck_name.c disp_grp.c efopen.c format.c header.c \
  576. X    makedir.c news_arc.c $(NNTPSRCS) record_arc.c retrieve.c \
  577. X    rkive.c setup.c str.c suffix.c version.c  $(GETOPTC)
  578. ARCHIVE_OBJS =  ck_name.o disp_grp.o efopen.o rfmt.o header.o \
  579. X    makedir.o news_arc.o $(NNTPOBJS) record_arc.o retrieve.o \
  580. X    match.o rkive.o setup.o str.o suffix.o version.o  $(GETOPTO)
  581. X
  582. SRCS = article.c ckconfig.c ck_name.c disp_grp.c efopen.c format.c \
  583. X    header.c makedir.c news_arc.c nntpart.c retrieve.c rkive.c \
  584. X    match.y record_arc.c setup.c str.c suffix.c version.c zfopen.c \
  585. X    $(GETOPTC)
  586. X
  587. INSTALLED_PROGS=\
  588. X    $(BINDIR)/article \
  589. X    $(BINDIR)/ckconfig \
  590. X    $(BINDIR)/rkive
  591. X
  592. PROGS = article ckconfig rkive
  593. X
  594. #all: $(PROGS) $(MANS) $(SCRIPTS)
  595. all: $(PROGS) 
  596. X
  597. $(MANS):
  598. X    cp `basename $@` $@
  599. X    chmod 444 $@
  600. X
  601. install: $(MANS) $(SCRIPTS) $(CONFIG) $(INSTALLED_PROGS)
  602. #install: $(INSTALLED_PROGS)
  603. X
  604. $(INSTALLED_PROGS):
  605. X    @strip $@ > /dev/null 2>&1
  606. X    cp `basename $@` $@
  607. X
  608. $(CONFIG):
  609. X    cp `basename $@` $@
  610. X    chmod 444 $@
  611. X    
  612. $(SCRIPTS):
  613. X    cp `basename $@` $@
  614. X    chmod 755 $@
  615. X
  616. $(RKIVEDIR) $(MAN1) $(MAN5):
  617. X    mkdir $(MKDIRFLAGS) $@
  618. X    chmod 775 $@
  619. X
  620. cf: $(CONFIG)
  621. X
  622. ckconfig: $(CKCONFIG_OBJS) 
  623. X    $(CC) $(CFLAGS) -o ckconfig $(CKCONFIG_OBJS) $(LIBS)
  624. X
  625. article: $(ARTICLE_OBJS) 
  626. X    $(CC) $(CFLAGS) -o article $(ARTICLE_OBJS) $(LIBS)
  627. X
  628. rkive: $(ARCHIVE_OBJS) 
  629. X    $(CC) $(CFLAGS) -o rkive $(ARCHIVE_OBJS) $(LDFLAGS) $(LIBS)
  630. X
  631. $(BINDIR)/article:    article
  632. $(BINDIR)/ckconfig:    ckconfig
  633. $(BINDIR)/rkive:    rkive
  634. X
  635. $(CKCONFIG_OBJS):    $(INCLUDES)
  636. $(ARTICLE_OBJS):    $(INCLUDES)
  637. $(ARCHIVE_OBJS):    $(INCLUDES)
  638. ################################
  639. #           Print
  640. ################################
  641. X
  642. print: print_docs print_support print_include 
  643. X    $(LP) $(SRCS)
  644. X
  645. print_support:
  646. X     $(PR) $(SUPPORT) | $(LP)
  647. X
  648. print_include:
  649. X    $(LP) $(INCLUDES)
  650. X
  651. print_article:
  652. X    $(LP) $(ARTICLE_SRCS)
  653. X
  654. print_ckconfig:
  655. X    $(LP) $(CKCONFIG_SRCS)
  656. X
  657. print_rkive:
  658. X    $(LP) $(ARCHIVE_SRCS)
  659. X
  660. print_docs:
  661. X    $(NROFF) -man $(DOCS) | $(LP)
  662. X
  663. ################################
  664. #           LINT
  665. ################################
  666. X
  667. lint:  
  668. X    @echo "linting Article sources: " > Lint.out
  669. X    lint $(LINTFLAGS) $(ARTICLE_SRCS) | tee -a Lint.out
  670. X    @echo "linting Ckconfig sources: " >> Lint.out
  671. X    lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
  672. X    @echo "linting Archiver sources: " >> Lint.out
  673. X    lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
  674. X
  675. lint_article:
  676. X    @echo "linting Article sources: " > Lint.out
  677. X    lint $(LINTFLAGS) $(ARTICLE_SRCS) 2>&1 | tee -a Lint.out
  678. X
  679. lint_ckconfig:
  680. X    @echo "linting Ckconfig sources: " > Lint.out
  681. X    lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
  682. X
  683. lint_rkive:
  684. X    @echo "linting Archiver sources: " > Lint.out
  685. X    lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
  686. X
  687. ################################
  688. #              General        
  689. ################################
  690. X
  691. clean:
  692. X    rm -f *.o Lint.out *.bak
  693. X
  694. clobber: clean
  695. X    rm -f $(PROGS)
  696. X    rm -f Makefile.old rkive.h.old
  697. X    rm -f y.output y.tab.h y.tab.c 
  698. X
  699. inspection:  
  700. X    -inspect -abv $(ARTICLE_SRCS) 
  701. X    -inspect -abv $(CKCONFIG_SRCS) 
  702. X    -inspect -abv $(ARCHIVE_SRCS) 
  703. X
  704. inspect_rkive:
  705. X    -inspect -abv $(ARCHIVE_SRCS) 
  706. X
  707. saber_article_src:
  708. X    #load $(CFLAGS) $(ARTICLE_SRCS) $(LIBS)
  709. X
  710. saber_article_obj:
  711. X    #load $(ARTICLE_OBJS) $(LIBS)
  712. X
  713. saber_ckconfig_src:
  714. X    #load $(CFLAGS) $(CKCONFIG_SRCS) $(LIBS)
  715. X
  716. saber_ckconfig_obj:
  717. X    #load $(CKCONFIG_OBJS) $(LIBS)
  718. X
  719. saber_rkive_src:
  720. X    #load $(CFLAGS) $(ARCHIVE_SRCS) $(LIBS)
  721. X
  722. saber_rkive_obj:
  723. X    #load $(ARCHIVE_OBJS) $(LIBS)
  724. X
  725. man:
  726. X    $(NROFF) -man $(MANS)
  727. X
  728. depend:
  729. X    makedepend -- $(CFLAGS) -- $(SRCS)
  730. X    
  731. ################################
  732. #        Dependencies
  733. ################################
  734. X
  735. getopt.o: ./port/getopt.c
  736. X    $(CC) $(CFLAGS) $(TARGET_ARCH) -c ./port/getopt.c
  737. X
  738. clientlib.o: $(NNTPSRCDIR)/common/clientlib.c
  739. X    $(CC) $(CFLAGS) $(TARGET_ARCH) -c $(NNTPSRCDIR)/common/clientlib.c
  740. X
  741. match.o: match.y article.h
  742. X
  743. #
  744. # The format junk here could be cleaned up with -o if all
  745. # versions of make had it... I could reorg the code but that's
  746. # work... :-)
  747. #
  748. rfmt.o: format.c
  749. X    $(CC) -DRKIVE $(CFLAGS) $(TARGET_ARCH) -c format.c
  750. X    mv format.o rfmt.o
  751. X
  752. afmt.o: format.c
  753. X    $(CC) $(CFLAGS) $(TARGET_ARCH) -c format.c
  754. X    mv format.o afmt.o
  755. X
  756. $(RKIVEDIR)/rkive.cf:        rkive.cf $(RKIVEDIR)
  757. $(RKIVEDIR)/update_netdocs:    update_netdocs $(RKIVEDIR)
  758. $(MAN1)/article.1:        article.1 $(MAN1)
  759. $(MAN1)/rkive.1:        rkive.1 $(MAN1)
  760. $(MAN1)/ckconfig.1:        ckconfig.1 $(MAN1)
  761. $(MAN5)/rkive.5:        rkive.5  $(MAN5)
  762. X
  763. # DO NOT DELETE THIS LINE -- make depend depends on it.
  764. SHAR_EOF
  765. chmod 0664 Makefile.dst ||
  766. echo 'restore of Makefile.dst failed'
  767. Wc_c="`wc -c < 'Makefile.dst'`"
  768. test 7882 -eq "$Wc_c" ||
  769.     echo 'Makefile.dst: original size 7882, current size' "$Wc_c"
  770. rm -f _shar_wnt_.tmp
  771. fi
  772. # ============= localize.smpl ==============
  773. if test -f 'localize.smpl' -a X"$1" != X"-c"; then
  774.     echo 'x - skipping localize.smpl (File already exists)'
  775.     rm -f _shar_wnt_.tmp
  776. else
  777. > _shar_wnt_.tmp
  778. echo 'x - extracting localize.smpl (Text)'
  779. sed 's/^X//' << 'SHAR_EOF' > 'localize.smpl' &&
  780. #!/bin/sh
  781. #  
  782. #     @(#)localize.smpl    1.1 5/9/91 
  783. #
  784. #        The purpose of this file is to make changes to
  785. #        rkive's Makefile and rkive.h. This allows for
  786. #        local configuration modifications to be isolated
  787. #        to this file.  
  788. #set -x
  789. if [ -f Makefile ]
  790. then
  791. X    mv Makefile Makefile.old
  792. X    echo "Storing original Makefile in Makefile.old"
  793. fi
  794. X
  795. echo "Extracting Makefile"
  796. cp Makefile.dst Makefile
  797. chmod u+w Makefile
  798. echo "Performing substitutions on Makefile"
  799. ed - Makefile  <<'EOF'
  800. /^#EXOSFLAGS/s;^#;;
  801. /^#EXOSLIBS/s;^#;;
  802. /^#NNTPSRCDIR/s;^#;;
  803. /^#NNTPDEBUG/s;^#;;
  804. /^#NNTPFLAGS/s;^#;;
  805. /^#NNTPSRCS/s;^#;;
  806. /^#NNTPOBJS/s;^#;;
  807. /^#SFLAGS/s;^#;;
  808. /^#GETOPTO/s;^#;;
  809. /^#GETOPTC/s;^#;;
  810. /^CC/s;cc;gcc;
  811. /^FLAGS/s;-g;-O;
  812. /^YFLAGS/s;=;=-v;
  813. /^YACC/s;yacc;bison;
  814. /^ACCESSLIB/s;=;=-lndir;
  815. /^LIBS/s;=;=-lc_s;
  816. /^LP/s;lpr;lp;
  817. /^PR/s;nl -n;pr;
  818. /^NROFF/s;nroff;troff;
  819. /^BINDIR/s;/usr/local/bin;/home/kent/bin;
  820. /^RKIVEDIR/s;/usr/local/lib;/home/kent/rkive;
  821. /^MAN1/s;/usr/man/man1;/usr/man/local/man1;
  822. /^MAN5/s;/usr/man/man5;/usr/man/local/man5;
  823. w
  824. q
  825. EOF
  826. X
  827. echo
  828. X
  829. if [ -f rkive.h ]
  830. then
  831. X    mv rkive.h rkive.h.old
  832. X    echo "Storing original rkive.h in rkive.h.old"
  833. fi
  834. X
  835. echo "Extracting rkive.h"
  836. cp rkive.h.dst rkive.h
  837. chmod u+w rkive.h
  838. echo "Performing substitutions on rkive.h"
  839. ed - rkive.h <<'EOF'
  840. /OWNER/s;0;78;
  841. /GROUP/s;3;21;
  842. /MODES/s;0444;0644;
  843. /DIR_MODE/s;0755;0775;
  844. /^#define SUBJECT_LINE/s;define;undef;
  845. /^#define MAIL/s;/usr/ucb/Mail;/usr/local/bin/elm;
  846. /^#define SPOOLDIR/s;/usr/spool/news;/var/spool/news;
  847. /^#define PROBLEMS_DIR/s;/usenet/problems;/home/kent/rkive/problems;
  848. /^#define LOCATION/s;/usr/local/lib/rkive/rkive.cf;/home/kent/rkive/rkive.cf;
  849. /^#undef ADD_REPOST_SUFFIX/s;undef;define;
  850. /^#define MV_ORIGINAL/s;define;undef;
  851. /^#define REPOST_SUFFIX/s;-repost;.rp;
  852. /^#define VOLUME/s;volume;vol;
  853. /^#undef ZEROFILL/s;undef;define;
  854. /^#define REDUCE_HEADERS/s;define;undef;
  855. /^#define NUM_NEWSGROUPS/s;64;128;
  856. /^#undef NO_MONTH_DIR/s;undef;define;
  857. /^#undef USE_SYSMKDIR/s;undef;define;
  858. /^#define MKDIR/s;define;undef;
  859. /^#define DEFAULT_INDEX_FORMAT/s;%B\\t%S;%O\\t%T;
  860. /^#define DEFAULT_LOG_FORMAT/s;%O\\t%T;%B\\t%S;
  861. w
  862. q
  863. EOF
  864. cat << 'EOM'
  865. X
  866. Done. Did you see a '?' appear while running this ? If so you need to
  867. do a little more work to get it working right.  If not...
  868. X
  869. Check over the Makefile and rkive.h to assure that things are the way
  870. that you want them. If they are not, make the appropriate changes to
  871. this script and rerun it.  When things are correct, type
  872. X
  873. $ make 
  874. X
  875. This will build the three executables, article, ckconfig and rkive.
  876. When you feel brave enough, install the software in place by typing
  877. X
  878. $ make install
  879. X
  880. EOM
  881. SHAR_EOF
  882. chmod 0644 localize.smpl ||
  883. echo 'restore of localize.smpl failed'
  884. Wc_c="`wc -c < 'localize.smpl'`"
  885. test 2596 -eq "$Wc_c" ||
  886.     echo 'localize.smpl: original size 2596, current size' "$Wc_c"
  887. rm -f _shar_wnt_.tmp
  888. fi
  889. # ============= sys.cf ==============
  890. if test -f 'sys.cf' -a X"$1" != X"-c"; then
  891.     echo 'x - skipping sys.cf (File already exists)'
  892.     rm -f _shar_wnt_.tmp
  893. else
  894. > _shar_wnt_.tmp
  895. echo 'x - extracting sys.cf (Text)'
  896. sed 's/^X//' << 'SHAR_EOF' > 'sys.cf' &&
  897. #
  898. #        @(#)sys.cf    1.1 5/9/91
  899. #            - Used to contain newsgroup 
  900. #                         archive specifications for
  901. #                         newsgroups processed through
  902. #                         the /usr/lib/news/sys file.
  903. #
  904. # typical line for rkive in the Cnews sys file.
  905. # csd:world,usa,local,comp.sources.d::/usr/local/bin/rkive -A comp.sources.d -f /usr/local/lib/rkive/sys.cf
  906. #                         
  907. ##################### GLOBAL SPECIFICATIONS ##########################
  908. #
  909. SPOOLDIR=/usr/spool/news      
  910. PROBLEMS=/usenet/problems
  911. TYPE=Chronological
  912. #
  913. # If you turn on mail here you will get a mail message for
  914. # each article processed through /usr/lib/news/sys. YOU HAVE
  915. # BEEN WARNED... :-) :-)
  916. #
  917. #MAIL=kent
  918. OWNER=news
  919. GROUP=news
  920. MODE=0444
  921. COMPRESS=/usr/ucb/compress
  922. #
  923. ###################### NEWSGROUP SPECIFICS ###########################
  924. #
  925. $$comp.sources.d        
  926. X    BASEDIR: /usenet/comp.sources.d
  927. X        INDEX: /tmp/usenet/comp.sources.d/index
  928. X        INDEX_FORMAT: "%B %a %T" 
  929. X
  930. SHAR_EOF
  931. chmod 0444 sys.cf ||
  932. echo 'restore of sys.cf failed'
  933. Wc_c="`wc -c < 'sys.cf'`"
  934. test 991 -eq "$Wc_c" ||
  935.     echo 'sys.cf: original size 991, current size' "$Wc_c"
  936. rm -f _shar_wnt_.tmp
  937. fi
  938. # ============= rkive.h.dst ==============
  939. if test -f 'rkive.h.dst' -a X"$1" != X"-c"; then
  940.     echo 'x - skipping rkive.h.dst (File already exists)'
  941.     rm -f _shar_wnt_.tmp
  942. else
  943. > _shar_wnt_.tmp
  944. echo 'x - extracting rkive.h.dst (Text)'
  945. sed 's/^X//' << 'SHAR_EOF' > 'rkive.h.dst' &&
  946. /*
  947. **     @(#)rkive.h.dst    2.3 5/9/91 
  948. **
  949. **    This is the rkive source configuration header file. 
  950. **    Please examine and change to suite your own site's needs..
  951. **
  952. */
  953. X
  954. /*
  955. ** The default owner, group and modes of the archived files
  956. ** need to be stated below. The values are only used if the
  957. ** appropriate values are not in the configuration file.
  958. */ 
  959. X
  960. #define OWNER    0
  961. #define GROUP    3
  962. #define MODES    0444
  963. #define DIR_MODE 0755         /* directory creation modes */
  964. X
  965. /* 
  966. ** If you have a smart mailer that supports a "-s subject" command
  967. ** and you wish to have the subject line added when archived mail
  968. ** is sent, define SUBJECT_LINE. 
  969. */
  970. X
  971. #define SUBJECT_LINE 
  972. X
  973. #ifdef SUBJECT_LINE
  974. #define MAIL        "/usr/ucb/Mail"    /* mail program to use */
  975. # ifdef NOTDEF
  976. #  define MAIL        "/usr/local/bin/elm"
  977. #  define MAIL        "/usr/bin/mailx"      /* mail program to use */
  978. #  define MAIL        "/usr/local/bin/mush"
  979. # endif /*NOTDEF*/
  980. #else
  981. #define MAIL        "/bin/mail"     /* mail program to use */
  982. #endif
  983. X
  984. /*
  985. ** The PROBLEMS_DIR is the default directory to use in the event 
  986. ** problems are encountered such as duplicate article names and 
  987. ** the execution flags do not specify overwriting. 
  988. **
  989. ** The new, inbound article is stored in the PROBLEMS_DIR in the 
  990. ** problems_dir/newsgroup/volume/filename so that the administrator 
  991. ** can review and fix the problem whenever time becomes available...
  992. **
  993. ** The PROBLEMS_DIR define is used only if the administrator has not 
  994. ** specified the PROBLEMS path variable inside of the LOCATION 
  995. ** (config) file.
  996. */
  997. X
  998. #define PROBLEMS_DIR "/usenet/problems"  
  999. X
  1000. /* 
  1001. ** Home directory for news    
  1002. */
  1003. X
  1004. #define SPOOLDIR     "/usr/spool/news"   
  1005. X
  1006. /* 
  1007. ** Location of the default rkive configuration file.
  1008. */
  1009. X
  1010. #define LOCATION     "/usr/local/lib/rkive/rkive.cf"  
  1011. X
  1012. /*
  1013. ** Defines to control the handling of repostings.
  1014. **
  1015. ** ADD_REPOST_SUFFIX && REPOST_SUFFIX
  1016. **
  1017. **     If ADD_REPOST_SUFFIX is defined, all reposts will have the 
  1018. **     string specified in REPOST_SUFFIX appended to the archive
  1019. **     filename so that a repost of elm/part07 would appear in
  1020. **     the archive as elm/part07-repost prior to any compression.
  1021. **
  1022. **     CAUTION: This should *not* be used on a filesystem with
  1023. **        14 character file name limits. If you are going
  1024. **        to be making your archive available to the general
  1025. **        community do *not* use this. The portability of
  1026. **        filenames is greatly reduced. This has been added
  1027. **        with much hesitation. The rational was that there
  1028. **        was no reason to punish/limit the functionality
  1029. **        just because of limitations of a specific "brand"
  1030. **        of unix and since that "brand" was correcting its
  1031. **        "error" in the future, why not put it in now ?
  1032. **        This is not a configuration item on a per newsgroup
  1033. **        basis. It might be useful for Historical archiving
  1034. **        using only Volume/Issue archiving with no COMPRESSION.
  1035. **
  1036. ** MV_ORIGINAL
  1037. **     The original article is placed into a "original" directory in 
  1038. **     the problems directory (if duplicated). The inbound reposted
  1039. **     article is placed into the archive in the correct position.
  1040. **
  1041. ** No Reposting Defines specified:
  1042. **    The inbound article would be placed into the archive in the 
  1043. **    correct position only if the initial article is not in the archive.
  1044. **    Otherwise the reposted article is placed in the problems directory 
  1045. **    as a normal duplicate article is now.
  1046. */
  1047. X
  1048. #undef ADD_REPOST_SUFFIX
  1049. #define MV_ORIGINAL 
  1050. X
  1051. #ifdef ADD_REPOST_SUFFIX 
  1052. #define REPOST_SUFFIX  "-repost" 
  1053. #endif
  1054. X
  1055. /* 
  1056. ** If you wish your volume directories to be Volume, VOL, vOLuMe
  1057. ** or any other such nonsense, change the VOLUME define below.
  1058. */
  1059. X
  1060. #define VOLUME       "volume"
  1061. X
  1062. /*
  1063. ** Very small change to construct change the volume directory names 
  1064. ** from "volume1" to "volume01". In this manner all of the archive
  1065. ** volume directories appear in lexical order instead of jumbled 
  1066. ** together in directory listings. This option was "requested"...
  1067. */
  1068. X
  1069. #undef ZEROFILL
  1070. X
  1071. /* 
  1072. ** If you wish to have the headers "trimmed" when the file is archived,
  1073. ** assure that REDUCE_HEADERS is defined. Currenlty all header lines that
  1074. ** are not either;
  1075. **    From:, Newsgroups:, Subject:, Message-ID: Approved:, and Date:
  1076. ** will be removed. See news_arc.c if you wish to add or subtract header
  1077. ** lines to keep. This can produce a savings of between 200 to 500 bytes
  1078. ** per archived article.
  1079. */
  1080. X
  1081. #define REDUCE_HEADERS 
  1082. X
  1083. /* 
  1084. ** The following define specifies a default format for generating
  1085. ** index file records in the event that there is no index format
  1086. ** specified for either the newsgroup or for the global default.
  1087. ** See article.1 for a discussion of the different types of selection
  1088. ** characters available for use in the format specifications.
  1089. */
  1090. X
  1091. #define DEFAULT_INDEX_FORMAT       "%B\t%S"
  1092. X
  1093. /* 
  1094. ** The following define specifies a default format for generating
  1095. ** log file records in the event that there is no log format
  1096. ** specified for either the newsgroup or for the global default.
  1097. */
  1098. #define DEFAULT_LOG_FORMAT         "%O\t%T"
  1099. X
  1100. /*
  1101. ** The size of the group array. If you are archiving the world
  1102. ** you might need to bump this up...
  1103. */
  1104. X
  1105. #define NUM_NEWSGROUPS  64
  1106. X
  1107. /*
  1108. ** The ifdef NO_MONTH_DIR is used to decide which way Chronological 
  1109. ** archives are to be stored. By default for format is something like
  1110. **
  1111. **    /usenet/alt/sources/volume89/Jun/890629.01
  1112. ** 
  1113. ** If you wish not to have the month directory, define NO_MONTH_DIR
  1114. ** and the archives will be stored as
  1115. **
  1116. ** /usenet/alt/sources/volume89/890629.01
  1117. */
  1118. #undef NO_MONTH_DIR
  1119. X
  1120. /*
  1121. ** Which mkdir function do you want to use ?
  1122. **
  1123. ** Define MKDIR if there is a mkdir() function in your 
  1124. ** system library (AT&T 5.2 or earlier systems are probably
  1125. ** out of luck..)
  1126. **
  1127. ** Define USE_SYSMKDIR if you wish to system off /bin/mkdir.
  1128. **
  1129. ** If you do not define either, the function makedir will
  1130. ** create the directory itself. PLEASE ASSURE THAT IT WILL
  1131. ** WORK FOR YOUR SYSTEM PRIOR TO USING IT... (Should work on
  1132. ** System 5.3 and prior SYSV systems.)
  1133. */
  1134. #undef USE_SYSMKDIR   /**/
  1135. #define MKDIR          /**/
  1136. X
  1137. /**********************************************************************
  1138. *******************  NO CHANGES REQUIRED PAST HERE  *******************
  1139. **********************************************************************/
  1140. X
  1141. /*
  1142. ** check to assure repost defines are in order...
  1143. */
  1144. #if defined(ADD_REPOST_SUFFIX) + defined(MV_ORIGINAL) > 1
  1145. #include "ERROR - Can only specify a maximum of one way to handle reposts!"
  1146. #endif
  1147. X
  1148. /*
  1149. ** check to assure mkdir defines are in order...
  1150. */
  1151. #if defined(MKDIR) + defined(USE_SYSMKDIR) > 1
  1152. #include "ERROR - Can only specify a maximum of one way to make directories!"
  1153. #endif
  1154. X
  1155. #include <dirent.h>
  1156. X
  1157. int fprintf();
  1158. X
  1159. /*
  1160. ** Standard stuff
  1161. */
  1162. X
  1163. #ifndef TRUE
  1164. #define TRUE   1
  1165. #endif
  1166. X
  1167. #ifndef FALSE
  1168. #define FALSE  0
  1169. #endif
  1170. X
  1171. /*
  1172. ** The MAXNAMLEN define is here for systems such as SCO
  1173. ** that have MAXNAMLEN in other then dirent.h
  1174. **         Samuel Lam <uunet!van-bc!skl> 
  1175. */
  1176. #ifndef MAXNAMLEN
  1177. #define MAXNAMLEN  255
  1178. #endif 
  1179. X
  1180. /*
  1181. ** retrieve_article() return values
  1182. */
  1183. #define ERROR_ENCOUNTERED -1
  1184. #define DONE 0
  1185. #define RETRIEVED 1
  1186. X
  1187. /*
  1188. ** retrieve_article() from defines
  1189. */
  1190. #define FROM_DISK       0
  1191. #define FROM_NAME       1
  1192. #define FROM_BATCHFILE  2
  1193. #define FROM_STDIN      3
  1194. #ifdef NNTP
  1195. # define FROM_NNTP      4
  1196. #endif /*NNTP*/
  1197. X
  1198. /*
  1199. ** archive type defines 
  1200. **
  1201. ** These defines are used to determine which type of archiving 
  1202. ** methods the administrator has requested for the newsgroup.
  1203. **
  1204. */
  1205. X
  1206. #define ARCHIVE_NAME     0    /* Archive as "elm/part03"  */
  1207. X                                /* and moderator info also. */
  1208. #define VOLUME_ISSUE     1    /* Archive as "v16i003"     */
  1209. #define ARTICLE_NUMBER   2    /* Archive with same name   */
  1210. X                /* as the file to archive   */
  1211. #define CHRONOLOGICAL    3    /* Archive as "890619002"   */
  1212. X                                /* or YYMMDDIII format      */
  1213. #define COMP_ARCHIVES    4    /* Archive for comp.archives*/
  1214. #define EXTERNAL_COMMAND 5    /* Archive by piping the    */
  1215. X                                /* articles to the external */
  1216. X                                /* command specified int the*/
  1217. X                                /* rkive.cf file.           */
  1218. #define ONLY_ARCHIVE_NAME 6    /* Archive as "elm/part03"  */
  1219. X
  1220. #define MAXMATCHLEN   10000   /* Length for Match-expression. */
  1221. X
  1222. X
  1223. /*
  1224. ** patch handling type defines 
  1225. **
  1226. ** These defines are used to determine which type of 
  1227. ** method the administrator has requested for the the
  1228. ** handling of patches received in the newsgroup.
  1229. **
  1230. */
  1231. X
  1232. #define HISTORICAL   0        /* Archive as normally done.        */
  1233. #define PACKAGE      1        /* Archive patches in the directory */
  1234. X                                /* containing the initial posting.  */
  1235. X
  1236. struct group_archive {
  1237. X    int owner;                  /* owner id of the archive files     */
  1238. X    int group;                  /* group id of the archive files     */
  1239. X    int modes;                  /* modes of the stored archive files */
  1240. X    int type;                   /* Type of archiving to be used.     */
  1241. X                /*        0 = Archive-Name           */
  1242. X                                /*        1 = Volume-Issue           */
  1243. X                                /*        2 = Article-Number         */
  1244. X                                /*        3 = Chronological          */
  1245. X                                /*        4 = Comp-Archives          */
  1246. X                                /*        5 = External-Command       */
  1247. X    int patch_type;             /* Method of handling patches.       */
  1248. X                                /*        0 = Historical             */
  1249. X                                /*        1 = Package                */
  1250. X    char ng_name[MAXNAMLEN];    /* Newsgroup to be archived.         */
  1251. X    char ng_path[MAXNAMLEN];    /* Path to archive's base directory. */
  1252. X    char location[MAXNAMLEN];    /* Path to archive's base directory. */
  1253. X    char arc_done[MAXNAMLEN];    /* Archive's .archived already file  */
  1254. X    char mail_list[BUFSIZ];    /* List of users to mail when new    */
  1255. X                /* members are added to the archive. */
  1256. X    char logfile[MAXNAMLEN];    /* Path to archive specific log file */
  1257. X    char index[MAXNAMLEN];     /* Path to archive specific index.   */
  1258. X    char patchlog[MAXNAMLEN];    /* Path to archive's patches log.    */
  1259. X    char logformat[BUFSIZ];    /* Format of the logfile entry.      */
  1260. X    char indformat[BUFSIZ];    /* Format of the index entry.        */
  1261. X    char compress[MAXNAMLEN];    /* Command line to use to compress   */
  1262. X                /* new archive members, optional.    */
  1263. X    char arch_command[MAXNAMLEN]; /* Command line to use to archive  */
  1264. X                                  /* the articles in the newsgroup.    */
  1265. X    char checkhash[MAXNAMLEN];    /* Command line to use to test       */
  1266. X                /* articles for transit damage.      */
  1267. X    char match[MAXMATCHLEN];    /* Match-expression                  */
  1268. #ifdef NNTP
  1269. X    char nntp[MAXNAMLEN];    /* Name of system with nntp server   */
  1270. #endif /*NNTP*/
  1271. };
  1272. SHAR_EOF
  1273. chmod 0444 rkive.h.dst ||
  1274. echo 'restore of rkive.h.dst failed'
  1275. Wc_c="`wc -c < 'rkive.h.dst'`"
  1276. test 10930 -eq "$Wc_c" ||
  1277.     echo 'rkive.h.dst: original size 10930, current size' "$Wc_c"
  1278. rm -f _shar_wnt_.tmp
  1279. fi
  1280. # ============= patch2.1 ==============
  1281. if test -f 'patch2.1' -a X"$1" != X"-c"; then
  1282.     echo 'x - skipping patch2.1 (File already exists)'
  1283.     rm -f _shar_wnt_.tmp
  1284. else
  1285. > _shar_wnt_.tmp
  1286. echo 'x - extracting patch2.1 (Text)'
  1287. sed 's/^X//' << 'SHAR_EOF' > 'patch2.1' &&
  1288. diff -cr ../usenet/Changes ./Changes
  1289. *** ../usenet/Changes    Wed May  8 21:31:55 1991
  1290. --- ./Changes    Thu May  9 01:14:37 1991
  1291. ***************
  1292. *** 1,101 ****
  1293. ! @(#)Changes    2.1 2/21/91
  1294. ! WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** 
  1295. X  
  1296. ! The .archived files now store the message id of the article instead of the
  1297. ! article number. This is done so that NNTP support could be added. The news
  1298. ! article numbering on one system may not be the same on another system and
  1299. ! worse yet, they might collide resulting in lost articles.  For this reason,
  1300. ! the message-id is stored in the .archived file.  This complicates the maintance
  1301. ! of the .archived files greatly. Currently they are growing without bounds...
  1302. ! Ideas please. A separate process run from cron to trim the files... ?? Help...
  1303. X  
  1304. ! WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** WARNING **** 
  1305. X  
  1306. ! What follows is a list of changes that have occured during this release...
  1307. ! ------------------------------------------------------------------------------
  1308. X  
  1309. !             general:
  1310. X  
  1311. ! Modified the Makefile handle dependencies better.
  1312. X  
  1313. ! Moved the rkive.cf file into /usr/local/lib/rkive. This new directory
  1314. ! is being used to store all the external applications such as update_netdocs
  1315. ! as well.
  1316. X  
  1317. ! Added the decompression routines to the compression suffix table.
  1318. X  
  1319. ! rename.c used in the 1.x versions but is not used anymore...
  1320. X  
  1321. - Removed alot of duplicated code and added some more.
  1322. X  
  1323. - Removed the History lines from the files. Little, if any informational
  1324. - content. Just bulks up the source files unnecessarily.  History is in
  1325. - the sccs files... If you really want it, send me email and I will send
  1326. - you prs output... :-)
  1327. X  
  1328. !             article:
  1329. X  
  1330. - Added support for comp.archives auxiliary headers
  1331. X  
  1332. ! Added support for comp.sources.apple2 extended auxiliary headers
  1333. X  
  1334. ! Added compression recognition to article so that it can deal
  1335. ! transparently with compressed/packed files. There is no longer
  1336. ! a need to "zcat filename | article".
  1337. X  
  1338. X  
  1339. !             rkive:
  1340. X  
  1341. - Added the ability to use the X-Checksun-Snefru: auxiliary header line
  1342. - used in c.s.unix and comp.sources.misc.
  1343. X  
  1344. ! Added the ability to archive comp.archives using the auxiliary headers
  1345. ! supplied by the moderator's posting software.
  1346. X  
  1347. ! Added the ability to archive comp.sources.apple2 using the extended
  1348. ! auxiliary headers.
  1349. X  
  1350. ! Added the ability to pass parameter flags to the Compression utility
  1351. ! specified in rkive.cf
  1352. X  
  1353. ! Added NNTP support so that the archives can be maintained on a remote
  1354. ! system(s) In this manner as well, an archive site can use multiple
  1355. ! spool directories locatated on multiple systems to assure timely
  1356. ! update and better news access reliability.
  1357. ! Added the ability to support globbing.  rkive now allows the user to
  1358. ! specify a match string to search for in the newsgroup. When a match is
  1359. ! found, that article is archive. Only articles that match the specific
  1360. ! patterns are archived. This mechanism works for all the different types
  1361. ! of archiving.
  1362. ! Added the ability for archive to execute external applications as
  1363. ! if it was done internally. It logs and writes index files for these
  1364. ! as specified in the rkive.cf configuration file.
  1365. ! Added the update_netdocs script and the appropriate entries in the 
  1366. ! supplied rkive.cf. This script provides an example of how the
  1367. ! external archive mechanism works. It also allows a site to maintain
  1368. ! the set of periodic postings that are specified in the rkive.cf and
  1369. ! the update_netdocs. This script was a QUICK AND DIRTY EXAMPLE. It
  1370. ! needs rewriting to be really used.
  1371. ! Rkive can now accept articles on stdin.
  1372. ! Rkive can now accept articles to be archived from a batch file
  1373. ! This allows the rkive use a batch file generated by the news system
  1374. ! in order to determine which articles need to be archived.
  1375. ! #ifdef added to allow the volumes to be zero-padded so that volume1
  1376. ! now becomes volume01
  1377. ! Added aditional format specifications to format.c so that the information
  1378. ! contained in the rkive.cf file could be supplied to external commands
  1379. ! for their specific use.
  1380. ! Does a better job going through saber and lint now.. :-)
  1381. ! Added the ability for the person configuring the rkive.cf to specify
  1382. ! where the .patchlog and .archived files are to reside. This was needed
  1383. ! for maintaining uunet's c.s.misc archives.
  1384. X  
  1385. --- 1,85 ----
  1386. ! @(#)Changes    2.2 5/9/91 
  1387. X  
  1388. ! A different configuration method is being used. A localize.sh script
  1389. ! is created at the local site that allows you to isolate changes to
  1390. ! a single file. This makes upgrades and patches easier and local configuration
  1391. ! is easier to manage. Local configuration is like its done in B News.
  1392. X  
  1393. ! An INSTALL file has been added describing how to make localize.sh scripts
  1394. ! and discusses just what some of the configuration parameters are/mean.
  1395. X  
  1396. ! The rkive.h and Makefiles are distributed as the rkive.h.dst and
  1397. ! Makefile.dst and are a template of the target rkive.h and Makefile
  1398. ! that will be created by localize.sh.
  1399. X  
  1400. ! Moved the mkdir() defines into rkive.h instead of the Makefile.
  1401. ! Changed defines from HAVE_MKDIR to MKDIR... Don't ask...
  1402. X  
  1403. ! Added support for the new X-Md4-Signature: header in use in comp.sources.misc.
  1404. X  
  1405. ! Added the ability for rkive to accept articles on standard input... Yes, this
  1406. ! time it is real... :-)  A sys.cf configuration file is supplied as a sample 
  1407. ! configuration file for sys file usage.
  1408. X  
  1409. ! Corrected a problem locating the next higest problem article number to
  1410. ! use in the event of problem storage. This was encountered when two systems
  1411. ! had problems with an article that had the same news article number. One 
  1412. ! of the articles was from a local news system, one was via NNTP, same group
  1413. ! from two different sources...
  1414. X  
  1415. ! In 2.0 I added the support for article to deal directly with compressed 
  1416. ! articles when the user specified the filename with the commpression suffix
  1417. ! attached. ("article *.Z") This time I added the ability for article to deal
  1418. ! with compressed articles better by allowing the user to specify the files
  1419. ! without the compression suffix. This means that if I say "article v17i016" 
  1420. ! it will find v17i016.Z.  If you have two files, one compressed, one 
  1421. ! uncompressed, article will find the one you specify.
  1422. X  
  1423. X  
  1424. X  
  1425. ! uunet!utai!mnetor!tmsoft!beaudin!john (John Beaudin) pointed out two
  1426. !     problems with global external archiving. Global External archiving 
  1427. !     works now.. I think.. :-) 
  1428. X  
  1429. X  
  1430. ! Chip Rosenthal <uunet!cs.utexas.edu!chinacat!chip> alerted me to:
  1431. X  
  1432. !     A matching problem in the suffix() routine was fixed. It was not stripping
  1433. !     the options correctly,
  1434. X  
  1435. +     NO_MONTH_DIR was missing from rkive.h, and
  1436. X  
  1437. !     When using the "Chronological" mode, with the "NO_MONTH_DIR" defined,
  1438. !     a "%v" in the index format yielded a "v-1" rather than a "v91". Incorrect
  1439. !     initialization, fixed.
  1440. X  
  1441. X  
  1442. ! Chet Wood <uunet!apple.com!arc!chet> for directing me to the following five 
  1443. ! problems/ideas and gave me a couple more to ponder... :-)
  1444. X  
  1445. !     Corrected write_archived so that it assures that the directories exist
  1446. !     prior to attempting to write a record to the newsgroup's .archived file.
  1447. !     Boundary condition :-) If the first article in a newsgroup was a problem
  1448. !     article, rkive could not write the .archived record since the directory
  1449. !     did not exist.
  1450. !     
  1451. !     Assured that the filename specified within the INDEX_FORMAT contained the
  1452. !     final path name which may or may not have a compression suffix attached.
  1453. !     
  1454. !     Added support for a relative path filename from where the BASEDIR to the
  1455. !     actual storage location. This is done with a %Z format character.
  1456. !     
  1457. !     Added the ability for external command archiving to use the NNTP temporary
  1458. !     transfer file if they need to. Added the $F specification character to 
  1459. !     support this.
  1460. !     
  1461. !     Updated update_netdocs with some new FAQs. Also shut off "set -x" as the 
  1462. !     default. That was left over from debugging... :-)
  1463. !     
  1464. !              *** THANKS ALL! ***
  1465. X  
  1466. ! Updated article.1 and rkive.5 to reflect the format specification character 
  1467. ! changes.
  1468. X  
  1469. ! Various other minor fixes as well... 
  1470. X  
  1471. diff -cr ../usenet/IDEAS ./IDEAS
  1472. *** ../usenet/IDEAS    Wed May  8 21:31:59 1991
  1473. --- ./IDEAS    Thu May  9 01:16:32 1991
  1474. ***************
  1475. *** 1,4 ****
  1476. ! @(#)IDEAS    2.1 2/21/91
  1477. X  What follows is my ideas file. It gives you a glimse into some enhancements,
  1478. X  ideas, problems and work in progress for rkive. This is a minimal list but
  1479. X  it will grow after you send me your good ideas. :-)
  1480. --- 1,4 ----
  1481. ! @(#)IDEAS    2.2 5/9/91
  1482. X  What follows is my ideas file. It gives you a glimse into some enhancements,
  1483. X  ideas, problems and work in progress for rkive. This is a minimal list but
  1484. X  it will grow after you send me your good ideas. :-)
  1485. ***************
  1486. *** 13,60 ****
  1487. X      All articles should be storable in *as many* of the user-requested 
  1488. X      formats as possible.  
  1489. X  
  1490. ! 3.  Add a Configure.sh to handle configuration of default parameters 
  1491. !     and to setup the software.
  1492. ! 4.  Better and more extensive documentation as well as documentation
  1493. X      that explains archiving in general.
  1494. X  
  1495. ! 6.  An application that would allow retrieval requests from the archives 
  1496. X      by reading the rkive.cf file to determine the location of the 
  1497. X      newsgroup's archive and to retrieve packages by any of the archive
  1498. X      methods.  This may end up using software like narc to actually do
  1499. X      the unpacking for the requester. This too is just an idea now...
  1500. X  
  1501. ! 7.  An application that would allow retrieval requests from the archives 
  1502. X      for patches or entire packages including all posted patches. This is
  1503. X      still currently in progress... :-) The mythical "random downloader" :-)
  1504. X  
  1505. ! 8.  Have rkive be able to handle crosspostings intelligently instead of
  1506. !     making to copies of the article as it does now.
  1507. X  
  1508. ! 9.  Changes needed to prevent the attempted compression of articles
  1509. !      whose basenames are longer than 12 characters on systems that support
  1510. !      only 14 character file names.
  1511. X  
  1512. ! 10.  Why not make the archive types specified by a table then it would be easy 
  1513. !      to add extra types. Surely the more the merry.
  1514. X  
  1515. ! 11.  Ta-rkive - have rkive feed the articles to be archived into tar
  1516. !      by printing the article on stdout so that rkive -T | tar cvf - > date.tar
  1517. !      could be used for putting the articles on to tape. tarkive would be
  1518. !      an application that does only the article reading and taring.
  1519. X  
  1520. ! 12.  Allow for directory modes in the .cf file.
  1521. X  
  1522. ! 13.  Program to clean up the INDEX file and move the sources to tape.
  1523. ! 14.  Use the posted date for chronological archiving instead of the 
  1524. !      archived date.
  1525. ! 15. Mail on error only.
  1526. ! 16. Add a selection control-character which gives the local system article 
  1527. X      number to put in 'log' and 'index'.  Would help if one runs into trouble. 
  1528. X  
  1529. X  Well that's the direction I am heading... If you have *any* additional
  1530. X  ideas that are constructive, positive or negative (flames to /nev/dull)
  1531. --- 13,51 ----
  1532. X      All articles should be storable in *as many* of the user-requested 
  1533. X      formats as possible.  
  1534. X  
  1535. ! 3.  Better and more extensive documentation as well as documentation
  1536. X      that explains archiving in general.
  1537. X  
  1538. ! 4.  An application that would allow retrieval requests from the archives 
  1539. X      by reading the rkive.cf file to determine the location of the 
  1540. X      newsgroup's archive and to retrieve packages by any of the archive
  1541. X      methods.  This may end up using software like narc to actually do
  1542. X      the unpacking for the requester. This too is just an idea now...
  1543. X  
  1544. ! 5.  An application that would allow retrieval requests from the archives 
  1545. X      for patches or entire packages including all posted patches. This is
  1546. X      still currently in progress... :-) The mythical "random downloader" :-)
  1547. X  
  1548. ! 6.  Changes needed to prevent the attempted compression of articles
  1549. !     whose basenames are longer than 12 characters on systems that support
  1550. !     only 14 character file names.
  1551. X  
  1552. ! 7.  Why not make the archive types specified by a table then it would be easy 
  1553. !     to add extra types. Surely the more the merry.
  1554. X  
  1555. ! 8.  Allow for directory modes in the .cf file.
  1556. SHAR_EOF
  1557. true || echo 'restore of patch2.1 failed'
  1558. fi
  1559. echo 'End of  part 1'
  1560. echo 'File patch2.1 is continued in part 2'
  1561. echo 2 > _shar_seq_.tmp
  1562. exit 0
  1563. exit 0 # Just in case...
  1564. -- 
  1565. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1566. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1567. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1568. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1569.