v19i099: Usenet sources archiver, Part02/04

Rich Salz rsalz at uunet.uu.net
Sat Jul 1 00:46:43 AEST 1989


Submitted-by: Kent Landfield <ssbell!kent>
Posting-number: Volume 19, Issue 99
Archive-name: rkive/part02

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 2 (of 4)."
# Contents:  Makefile article.1 article.c ckconfig.c format.c
#   record_arc.c rkive.5 rkive.h
# Wrapped by kent at ssbell on Thu Jun  1 16:19:08 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'Makefile'\"
else
echo shar: Extracting \"'Makefile'\" \(6450 characters\)
sed "s/^X//" >'Makefile' <<'END_OF_FILE'
X##########################################################
X#
X#	@(#)Makefile	1.1 6/1/89 - USENET Source Archiver
X#
X#
X# This software is Copyright (c) 1989 by Kent Landfield.
X#
X# Permission is hereby granted to copy, distribute or otherwise 
X# use any part of this package as long as you do not try to make 
X# money from it or pretend that you wrote it.  This copyright 
X# notice must be maintained in any copy made.
X#
X# Use of this software constitutes acceptance for use in an AS IS 
X# condition. There are NO warranties with regard to this software.  
X# In no event shall the author be liable for any damages whatsoever 
X# arising out of or in connection with the use or performance of this 
X# software.  Any use of this software is at the user's own risk.
X#
X#  If you make modifications to this software that you feel 
X#  increases it usefulness for the rest of the community, please 
X#  email the changes, enhancements, bug fixes as well as any and 
X#  all ideas to me. This software is going to be maintained and 
X#  enhanced as deemed necessary by the community.
X#		
X#		Kent Landfield
X#		uunet!ssbell!kent
X#
X#  History:
X#	Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
X#                                                               
X##########################################################
X#
X# Which mkdir function do you want to use ?
X#
X# Define HAVE_MKDIR if there is a mkdir() function in your 
X# system library (AT&T 5.2 or earlier systems are probably
X# out of luck..)
X#
X# Define USE_SYSMKDIR if you wish to system off /bin/mkdir.
X# (not recommended for *real* use...)
X#
X# If you do not define either, the function makedir will
X# create the directory itself. 
X#
X#CFLAGS=-O -DUSE_SYSMKDIR
X#CFLAGS=-O -DHAVE_MKDIR
XCFLAGS= -O 
X#
X# Define your favorite C compiler here...
X#
XCC=gcc
X
X#
X# Define flags to be passed to lint.
X#
XLINTFLAGS=
X
X#
X# rkive needs to have POSIX Compatible directory access routines.
X# If you have it builtin to your system libraries then
X# comment out the following. If you use Doug Gwyn's routines, (or 
X# other compatible routines) define the library in which they appear.
X#
XLDFLAGS=-lndir
X
XI = /usr/include
XLP = /usr/lbin/clist
XNROFF = /usr/bin/nroff
XBINDIR=/usr/lbin
X
XDOCS = article.1 rkive.1 ckconfig.1 rkive.5
XSUPPORT = rkive.cf Makefile README IDEAS MANIFEST
XINCLUDES = rkive.h article.h cfg.h patchlevel.h
X
XARTICLE_SRCS =  article.c efopen.c format.c header.c str.c version.c
XARTICLE_OBJS =  article.o efopen.o format.o header.o str.o version.o
X
XCKCONFIG_SRCS = ckconfig.c disp_grp.c efopen.c setup.c str.c version.c
XCKCONFIG_OBJS = ckconfig.o disp_grp.o efopen.o setup.o str.o version.o
X
XARCHIVE_SRCS =  disp_grp.c efopen.c format.c header.c \
X		makedir.c news_arc.c record_arc.c rename.c \
X		rkive.c setup.c str.c version.c
XARCHIVE_OBJS =  disp_grp.o efopen.o format.o header.o \
X		makedir.o news_arc.o record_arc.o rename.o \
X		rkive.o setup.o str.o version.o
X
XSRCS = article.c ckconfig.c disp_grp.c efopen.c format.c \
X	header.c news_arc.c rkive.c rename.c record_arc.c \
X	makedir.c setup.c str.c version.c
X
XPROGS = article ckconfig rkive
X
Xall: $(PROGS)
X
Xinstall: $(PROGS)
X	strip $(PROGS)
X	cp $(PROGS) $(BINDIR)
X
Xckconfig: $(CKCONFIG_OBJS)
X	$(CC) $(CFLAGS) -o ckconfig $(CKCONFIG_OBJS)
X
Xarticle: $(ARTICLE_OBJS)
X	$(CC) $(CFLAGS) -o article $(ARTICLE_OBJS)
X
Xrkive: $(ARCHIVE_OBJS)
X	$(CC) $(CFLAGS) -o rkive $(ARCHIVE_OBJS) $(LDFLAGS)
X
Xman:
X	$(NROFF) -man $(DOCS)
X
X################################
X#        Dependencies
X################################
X
Xrkive.o: $(I)/sys/types.h
Xrkive.o: $(I)/sys/stat.h
Xrkive.o: $(I)/dirent.h
Xrkive.o: $(I)/stdio.h
Xrkive.o: article.h
Xrkive.o: cfg.h
Xrkive.o: rkive.h
X
Xarticle.o: $(I)/stdio.h
Xarticle.o: $(I)/ctype.h
Xarticle.o: $(I)/sys/types.h
Xarticle.o: article.h
X
Xckconfig.o: $(I)/sys/types.h
Xckconfig.o: $(I)/dirent.h
Xckconfig.o: $(I)/stdio.h
Xckconfig.o: $(I)/pwd.h
Xckconfig.o: $(I)/grp.h
Xckconfig.o: cfg.h
Xckconfig.o: rkive.h
X
Xdisp_grp.o: $(I)/sys/types.h
Xdisp_grp.o: $(I)/dirent.h
Xdisp_grp.o: $(I)/stdio.h
Xdisp_grp.o: $(I)/pwd.h
Xdisp_grp.o: $(I)/grp.h
Xdisp_grp.o: cfg.h
Xdisp_grp.o: rkive.h
X
Xefopen.o: $(I)/stdio.h
X
Xformat.o: $(I)/stdio.h
Xformat.o: $(I)/sys/types.h
Xformat.o: article.h
X
Xheader.o: $(I)/stdio.h
Xheader.o: $(I)/ctype.h
Xheader.o: $(I)/sys/types.h
Xheader.o: article.h
X
Xmakedir.o: $(I)/sys/types.h
Xmakedir.o: $(I)/sys/stat.h
Xmakedir.o: $(I)/stdio.h
Xmakedir.o: $(I)/dirent.h
Xmakedir.o: rkive.h
X
Xnews_arc.o: $(I)/sys/types.h
Xnews_arc.o: $(I)/sys/stat.h
Xnews_arc.o: $(I)/dirent.h
Xnews_arc.o: $(I)/stdio.h
Xnews_arc.o: $(I)/ctype.h
Xnews_arc.o: article.h
Xnews_arc.o: cfg.h
Xnews_arc.o: rkive.h
X
Xrecord_arc.o: $(I)/sys/types.h
Xrecord_arc.o: $(I)/sys/stat.h
Xrecord_arc.o: $(I)/dirent.h
Xrecord_arc.o: $(I)/stdio.h
Xrecord_arc.o: cfg.h
Xrecord_arc.o: rkive.h
X
Xrename.o: $(I)/stdio.h
X
Xsetup.o: $(I)/sys/types.h
Xsetup.o: $(I)/sys/stat.h
Xsetup.o: $(I)/stdio.h
Xsetup.o: $(I)/ctype.h
Xsetup.o: $(I)/pwd.h
Xsetup.o: $(I)/grp.h
Xsetup.o: $(I)/dirent.h
Xsetup.o: cfg.h
Xsetup.o: rkive.h
X
Xversion.o: $(I)/stdio.h
Xversion.o: patchlevel.h
X
X################################
X#           Print
X################################
X
Xprint: print_docs print_support print_include 
X	$(LP) $(SRCS)
X
Xprint_support:
X	 pr $(SUPPORT) | lp
X
Xprint_include:
X	$(LP) $(INCLUDES)
X
Xprint_article:
X	$(LP) $(ARTICLE_SRCS)
X
Xprint_ckconfig:
X	$(LP) $(CKCONFIG_SRCS)
X
Xprint_rkive:
X	$(LP) $(ARCHIVE_SRCS)
X
Xprint_docs:
X	$(NROFF) -man $(DOCS) | os | lp
X
X################################
X#           LINT
X################################
X
Xlint:  
X	@echo "linting Article sources: " > Lint.out
X	lint $(LINTFLAGS) $(ARTICLE_SRCS) | tee -a Lint.out
X	@echo "linting Ckconfig sources: " >> Lint.out
X	lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
X	@echo "linting Archiver sources: " >> Lint.out
X	lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
X
Xlint_article:
X	@echo "linting Article sources: " > Lint.out
X	lint $(LINTFLAGS) $(ARTICLE_SRCS) 2>&1 | tee -a Lint.out
X
Xlint_ckconfig:
X	@echo "linting Ckconfig sources: " > Lint.out
X	lint $(LINTFLAGS) $(CKCONFIG_SRCS) | tee -a Lint.out
X
Xlint_rkive:
X	@echo "linting Archiver sources: " > Lint.out
X	lint $(LINTFLAGS) $(ARCHIVE_SRCS) | tee -a Lint.out
X
X################################
X#      	    CLEANUP        
X################################
X
Xclean:
X	rm -f *.o Lint.out
X
Xclobber: clean
X	rm -f $(PROGS)
X
Xinspection:  
X	-inspect -abv $(ARTICLE_SRCS) 
X	-inspect -abv $(CKCONFIG_SRCS) 
X	-inspect -abv $(ARCHIVE_SRCS) 
X
Xinspect_rkive:
X	-inspect -abv $(ARCHIVE_SRCS) 
END_OF_FILE
if test 6450 -ne `wc -c <'Makefile'`; then
    echo shar: \"'Makefile'\" unpacked with wrong size!
fi
# end of 'Makefile'
fi
if test -f 'article.1' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'article.1'\"
else
echo shar: Extracting \"'article.1'\" \(5160 characters\)
sed "s/^X//" >'article.1' <<'END_OF_FILE'
X'br "@(#)article.1	1.1 6/1/89"
X.op 1i
X.TH ARTICLE 1
X.SH NAME
Xarticle \- print formatted news article header information
X.SH SYNOPSIS
X.B article
X[ -adnvV ] [-f format ] newsarticle [ ... ]
X.SH DESCRIPTION
X.I article
Xallows the user to display information contained in the news article 
Xheaders. This information includes the auxiliary headers added by the 
Xmoderators of most of the source newsgroups.
X.I article
Xtakes the names of article files from standard input or as specified 
Xon the command line. By default, 
X.I article 
Xproduces output in a format of:
X.PP
X(Newsarticle                     Article Subject)
Xsources.d/1210           Re:  Archiving USENET Software             
X.PP
XIf the user has specified that only potential archive members are to
Xbe displayed, article produces output in a format of:
X.PP   
X(Newsarticle  Archive Name           Article Description)
Xunix/1420   archive/part01   Source Archiver, Part 1 of 8
X.PP
XThe user can select almost any information contained within a news article
Xheader and can then specify the way in which the information should be
Xdisplayed. The format that the user specifies is much like that of a
XC printf statement. 
X.SH OPTIONS
X.IP "-a" 6
XPrint information (in the specified format if supplied) if and only if 
Xthe news article contains the auxiliary headers added by the sources 
Xnewsgroup moderators. Do not print any information about files that do 
Xnot contain auxiliary headers.
X.IP "-d" 
XTurn on debugging output. This option allows the user to display the 
Xinformation found in an article header. This is basically a formatted dump 
Xof the header structure after parsing the article's header.
X.IP "-f format"
XThis option allows the user to specify a format.  The format is used to 
Xdetermine which parts of the article header information are to be displayed. 
XIt also specifies the presentation format of the article information in 
Xmuch the same manner as the C printf function.  See Formatting below.
X.IP "-n" 
XPrint information (in the specified format if supplied) if and only if 
Xthe news article does not contains the auxiliary headers added by the 
Xsources newsgroup moderators.
X.IP "-v"
XPrint additional information about the newsgroup.
X.IP "-V"
XPrint the version and patchlevel of the current executable.
X.SH FORMATTING 
X.PP
X.I article
Xplaces output on the standard output stream stdout.  
X.I article 
Xselects, formats, and prints its output under control of the format.  
XThe format is a character string that contains two types of objects: 
Xplain characters, which are copied directly to the output stream, and 
Xselection specifications. Specifying a selection results in fetching 
Xthe selected items from the news article.  The results are undefined 
Xif there is no associated information found in the news article.
X.PP
XEach selection specification is introduced by the character %.  After 
Xthe %, a character follows that indicates the type of selection to be
Xmade.
X.PP
XThe selection characters and their meanings are:
X.nf
X
X		Article Information Lines
X
X        A - Print the Approved line.
X        C - Print the Supersedes line.
X        D - Print the Date line.
X        F - Print the From line.
X        K - Print the Keywords line.
X        L - Print the Lines line.
X        M - Print the Message-ID line.
X        N - Print the Newsgroups line.
X        P - Print the Path line.
X        R - Print the References line.
X        S - Print the Subject line.
X        a - Print the Archive-name line.
X        b - Print the Submitted-by line.
X        c - Print the Control line.
X        d - Print the Distribution line.
X        e - Print the Expires line.
X        f - Print the Followup-to line.
X        o - Print the Organization line.
X        p - Print the Posting-number line.
X        r - Print the Reply-to line.
X        s - Print the Sender line.
X        u - Print the Summary line.
X        x - Print the Xref line.
X
X		Archive Information 
X
X        B - Print the base file name.
X        O - Print the Full path of the specified file.
X        G - Print the newsGroup name.
X        i - Print the issue (if archive) line.
X        l - Print the Author's logon address line.
X        n - Print the Author's name.
X        v - Print the volume (if archive) line.
X
X		Additional Specification Characters 
X
X        T - Print the Subject line's topic information.
X        % - Print a %, no argument is converted.
X..nr
X.PP
XIn addition to the conversion characters, the following 
Xcharacters have meaning during the formatting of the output.
X.nr
X
X    \\n - Print a new-line in the output.
X    \\t - Print a tab in the output.
X.nf
X.SH EXAMPLES 
X.PP
XTo print all files in the sources directory that have auxiliary 
Xheaders and can be archived by Archive-Name or Volume-Issue methods:
X.PP
X$ find /usr/spool/news/comp/sources -print | article -a
X.PP
XTo print a list of files in 
X.PP
X$ cd /usr/spool/news/comp/sources; article -f"%O  %T" unix/*
X.RS
X.IP
Xunix/1843    Introduction to comp.sources.unix	
Xunix/1844    List of sources in the archives	
X.RE
X.SH "SEE ALSO"
Xrkive(1), ckconfig(1), rkive.cf(5)
X.SH BUGS
X.I article
Xdoes not know about the X-Archiver format used in Volume 1 of comp.sources.misc.
X.LP
END_OF_FILE
if test 5160 -ne `wc -c <'article.1'`; then
    echo shar: \"'article.1'\" unpacked with wrong size!
fi
# end of 'article.1'
fi
if test -f 'article.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'article.c'\"
else
echo shar: Extracting \"'article.c'\" \(5446 characters\)
sed "s/^X//" >'article.c' <<'END_OF_FILE'
X/*
X**                                                                
X**  Subsystem:   USENET Sources Archiver             
X**  File Name:   article.c               
X**                                                        
X**  usage: article [ -adnvV ] [-f format ] newsarticle [ ... ]
X**
X**
X** This software is Copyright (c) 1989 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X** Use of this software constitutes acceptance for use in an AS IS 
X** condition. There are NO warranties with regard to this software.  
X** In no event shall the author be liable for any damages whatsoever 
X** arising out of or in connection with the use or performance of this 
X** software.  Any use of this software is at the user's own risk.
X**
X**  If you make modifications to this software that you feel 
X**  increases it usefulness for the rest of the community, please 
X**  email the changes, enhancements, bug fixes as well as any and 
X**  all ideas to me. This software is going to be maintained and 
X**  enhanced as deemed necessary by the community.
X**		
X**		Kent Landfield
X**		uunet!ssbell!kent
X**
X**  History:
X**	Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
X**                                                               
X*/
Xchar sccsid[] = "@(#)article.c	1.1 6/1/89";
X
X#include <stdio.h>
X#include <ctype.h>
X#include <sys/types.h>
X#include "article.h"
X
X#define ARCHIVE_ONLY  1
X#define NO_ARCHIVE   -1
X
X#define USAGE  "usage: %s [ -adnvV ] [-f format ] newsarticle [ ... ]\n"
X
Xchar *progname;                 /* name of executable              */
Xchar *format_ptr = NULL;        /* pointer to user supplied format */
Xint verify_archive = 0;         /* archive verification needed ?   */
XFILE *errfp;                    /* standard error file pointer     */
XFILE *logfp;                    /* standard output file pointer    */
X
Xchar *strchr();                 /* external function declaration   */
X
Xmain(argc, argv)
Xint argc;
Xchar **argv;
X{
X   int c;
X   extern char *optarg;
X   extern int optind;
X
X   progname = argv[0];
X   debug = verbose = 0;
X   logfp = stdout;
X   errfp = stderr;
X
X   if (argc > 1) {
X      while ((c = getopt(argc, argv, "adnvVf:")) != EOF) {
X         switch (c) {
X             case 'a':
X                 verify_archive = ARCHIVE_ONLY;
X                 break;
X             case 'd':
X                 debug++;
X                 break;
X             case 'f':
X                 format_ptr = optarg;
X                 break;
X             case 'n':
X                 verify_archive = NO_ARCHIVE;
X                 break;
X             case 'v':
X                 verbose++;
X                 break;
X             case 'V':
X                 version();
X             default:
X                 (void) fprintf(errfp,USAGE, progname);
X                 return(1);
X         }
X      }
X   }
X
X   if ((optind >= argc) || (argc == 1)) {  /* file from stdin */
X        char buf[BUFSIZ];
X        while (fgets(buf,sizeof buf,stdin) != NULL) {
X               buf[strlen(buf) -1] = '\0';
X               article_header(buf);
X        }
X   }
X   else { 
X        for (; optind < argc; optind++)    /* process files to print */
X             article_header(argv[optind]);
X   }
X   return(0);                              /* terminate this process */
X}
X
Xarticle_header(flname)
X    char *flname;
X{
X    char *dp;
X    int header_ok = 0;
X    char *strcpy();
X    FILE *file, *efopen();
X
X    int default_format = ARTICLE;
X
X    init_article();
X
X    file = efopen(flname,"r");
X
X    (void) strcpy(article.newsarticle,flname);
X
X    while (fgets(s,sizeof s,file) != NULL) {
X        /*
X        ** Check if the line is not a header line.
X        ** Allow 2 lines to go by that are not header
X        ** lines. In this manner, the auxilliary sources
X        ** headers can be interpreted.
X        */
X        if (!isalpha(*s) || (strchr(s,':') == NULL)) {
X           ++header_ok;
X           if (header_ok == 2) {
X               /* 
X               ** Has the user requested to produce 
X               ** only an archive listing ?
X               */
X               if (verify_archive == ARCHIVE_ONLY) {
X                  if (!header.archive_name[0] || !article.description[0])
X                       break;
X                   default_format = ARCHIVE;
X               }
X               /* 
X               ** Has the user requested to produce 
X               ** a listing excluding all archive 
X               ** potential members ?
X               */
X               else if (verify_archive == NO_ARCHIVE) {
X                   if (header.archive_name[0] && article.description[0]) 
X                       break;
X                   default_format = ARTICLE;
X               }
X               /* 
X               ** Print out the information as requested
X               */
X               format_output(logfp, format_ptr, flname, default_format);
X               break;
X            }
X            continue;
X        }
X
X        dp = s;
X        while (*++dp)
X           if (*dp == '\n')
X               *dp = '\0';
X        /*
X        ** Determine the type of the line and then
X        ** store the line in its appropriate structure
X	** element for later retrieval.
X        */
X        store_line();
X    }
X    (void) fclose(file);
X
X    if (verbose)
X        dump_article();
X}
END_OF_FILE
if test 5446 -ne `wc -c <'article.c'`; then
    echo shar: \"'article.c'\" unpacked with wrong size!
fi
# end of 'article.c'
fi
if test -f 'ckconfig.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'ckconfig.c'\"
else
echo shar: Extracting \"'ckconfig.c'\" \(4959 characters\)
sed "s/^X//" >'ckconfig.c' <<'END_OF_FILE'
X/*
X**                                                                
X**  Subsystem:   USENET Sources Archiver             
X**  File Name:   ckconfig.c               
X**                                                        
X**  usage: config [ -gV ] [ -f config_file ]
X**
X**
X** This software is Copyright (c) 1989 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X** Use of this software constitutes acceptance for use in an AS IS 
X** condition. There are NO warranties with regard to this software.  
X** In no event shall the author be liable for any damages whatsoever 
X** arising out of or in connection with the use or performance of this 
X** software.  Any use of this software is at the user's own risk.
X**
X**  If you make modifications to this software that you feel 
X**  increases it usefulness for the rest of the community, please 
X**  email the changes, enhancements, bug fixes as well as any and 
X**  all ideas to me. This software is going to be maintained and 
X**  enhanced as deemed necessary by the community.
X**		
X**		Kent Landfield
X**		uunet!ssbell!kent
X**
X**  History:
X**	Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
X**                                                               
X*/
Xchar sccsid[] = "@(#)ckconfig.c	1.1 6/1/89";
X
X#include <sys/types.h>
X#include <dirent.h>
X#include <stdio.h>
X#include <pwd.h>
X#include <grp.h>
X#include "cfg.h"
X
X#define M1 "The following values are used if the administrator has"
X#define M2 "not set a value for a necessary configuration item(s)."
X#define USAGE  "usage: %s [ -gV ] [ -f config_file ]\n"
X
Xextern struct passwd *pw;
Xextern struct group *gr;
X
Xstruct passwd *getpwuid();
Xstruct group *getgrgid();
X
Xmain(argc,argv)
Xint argc;
Xchar **argv;
X{
X   int c;
X   extern char *optarg;
X   extern int optind;
X
X   logfp = stdout;
X   errfp = stderr;
X   progname = argv[0];
X   fill_in_defaults = 0;
X   config_file = LOCATION;
X
X   if (argc > 1) {
X      while ((c = getopt(argc, argv, "gVf:")) != EOF) {
X         switch (c) {
X             case 'f':
X                 config_file = optarg;
X                 break;
X             case 'g':
X                 fill_in_defaults++;
X                 break;
X             case 'V':
X                 version();
X             default:
X                 (void) fprintf(errfp,USAGE, progname);
X                 return(1);
X         }
X      }
X   }
X   setup_defaults();
X
X   display_config();
X   return(0);
X}
X
X
Xdisplay_config()
X{
X    register int i;
X
X    (void) fprintf(logfp,"\n\t\tConfiguration Check for %s\n", 
X                         config_file);
X
X    (void) fprintf(logfp,"\n\t\t\tGlobal Defines\n\n");
X
X    (void) fprintf(logfp,"News Directory:      %s\n",spooldir);
X    (void) fprintf(logfp,"Problems Directory:  %s\n",problems_dir);
X    (void) fprintf(logfp,"Global Logfile:      %s\n",
X                         *log ? log : "NO LOGGING");
X    (void) fprintf(logfp,"Global Index:        %s\n", 
X                         *index ? index:"NO INDEXING");
X    (void) fprintf(logfp,"Logfile Format:      %s\n",
X                         *log_format ? log_format : "NOT SPECIFIED");
X    (void) fprintf(logfp,"Index Format:        %s\n",
X                         *index_format ? index_format : "NOT SPECIFIED");
X    (void) fprintf(logfp,"Mail Results To:     %s\n\n", 
X                         *mail ? mail : "NO ONE");
X    (void) fprintf(logfp,"%s\n%s\n\n",  M1, M2);
X    (void) fprintf(logfp,"Archive Type:    %s\n",
X                         default_type == ARCHIVE_NAME ? "Archive-Name": 
X                         default_type == VOLUME_ISSUE ? "Volume-Issue":
X                                                        "Article-Number"); 
X    (void) fprintf(logfp,"Patches Type:    %s\n",
X                         default_patch_type == PACKAGE ? "Package" :
X                                                         "Historical");
X
X
X    pw = getpwuid(default_owner);
X    (void) fprintf(logfp,"Default Owner:   %d <%s>\n", 
X                         default_owner,pw->pw_name);
X
X    gr = getgrgid(default_group);
X    (void) fprintf(logfp,"Default Group:   %d <%s>\n", 
X                         default_group, gr->gr_name);
X    (void) fprintf(logfp,"Default Modes:   %o\n", default_modes);
X    (void) fprintf(logfp,"Compression:     %s\n\n",
X                          *compress ? compress : "NO COMPRESSION");
X
X    if (default_patch_type == PACKAGE && default_type != ARCHIVE_NAME) {
X        (void) fprintf(logfp,"WARNING: Package Patches archiving is only\n");
X        (void) fprintf(logfp,"         used with Archive-Name archiving.\n\n");
X    }
X
X    (void) fprintf(logfp,"\t\tNewsgroup Archive Configuration\n\n\n");
X    for (i = 0; i <= num; i++)  {
X         display_group_info(&group[i]);
X         (void) fprintf(logfp,"\n\n");
X    }
X    return;
X}
END_OF_FILE
if test 4959 -ne `wc -c <'ckconfig.c'`; then
    echo shar: \"'ckconfig.c'\" unpacked with wrong size!
fi
# end of 'ckconfig.c'
fi
if test -f 'format.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'format.c'\"
else
echo shar: Extracting \"'format.c'\" \(7380 characters\)
sed "s/^X//" >'format.c' <<'END_OF_FILE'
X/*
X**
X** This software is Copyright (c) 1989 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X**
X**  History:
X**	Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
X**                                                               
X*/
X#ifndef lint
Xstatic char SID[] = "@(#)format.c	1.1 6/1/89";
X#endif
X
X#include <stdio.h>
X#include <sys/types.h>
X#include "article.h"
X
Xextern FILE *errfp;
X
Xchar *itoa(n)
Xint n;
X{
X    static char str[20];
X
X    int i, c, j, sign;
X	
X    if ((sign = n) < 0) 
X	n = -n;
X
X    i = 0;
X    do {
X        str[i++] = n % 10 + '0';
X    } while ((n /= 10) > 0);
X
X    if (sign < 0)
X        str[i++] = '-';
X    str[i] = '\0';
X
X    for (i = 0, j = strlen(str)-1; i < j; i++,j--) {
X        c = str[i];
X        str[i] = str[j];
X        str[j] = c;
X    }
X    return(str);
X}
X
Xchar *add_string(ptr, member_str)
Xchar *ptr, *member_str;
X{
X    while(*member_str)
X        *ptr++ = *member_str++;
X    return(ptr);
X}
X
X
Xchar *basename(name)
X    char *name;
X{
X    char *p;
X    char *strrchr();
X    
X    if ((p = strrchr(name,'/')) == NULL)
X        return(name);
X    return(++p);
X}
X
X
Xformat_output(fp, frmptr, filename, default_type)
XFILE *fp;              /* Output file pointer                   */
Xchar *frmptr;          /* Selection Format pointer              */
Xchar *filename;        /* File name the info came from          */
Xint default_type;      /* Where called from, Rkive or Article   */
X{
X    char *basename();
X    char *aptr, *cp, c;
X    char format[BUFSIZ];
X    void exit();
X 
X    /* Did the user specify a format to use   */
X    /* or should the default format be used ? */
X
X    if (frmptr == NULL) {
X       if (default_type == ARCHIVE) 
X           (void) fprintf(fp,"%-s\t%-s\t%s\n",
X                 article.newsarticle, header.archive_name,
X                 article.description);
X       else
X           (void) fprintf(fp,"%-s\t%-s\n", filename, header.subject);
X       return;
X    }
X
X    for (cp = format; cp < format + BUFSIZ; cp++)
X         *cp = '\0';
X 
X    aptr = frmptr;
X    cp = format;
X
X    while (c = *aptr++) {
X        if (c == '%') {
X           switch (*aptr++) {
X               case '%':
X                   *cp++ = '%';
X                   continue;
X               case 'A':     /* Approved  */
X                   cp = add_string(cp, header.approved);
X                   continue;
X               case 'B':     /* Base name of the file path  */
X                   cp = add_string(cp, basename(filename));
X                   continue;
X               case 'C':     /* Supersedes  */
X                   cp = add_string(cp, header.supersedes);
X                   continue;
X               case 'D':     /* Date  */
X                   cp = add_string(cp, header.subdate);
X                   continue;
X               case 'F':     /* From */
X                   cp = add_string(cp, header.from);
X                   continue;
X               case 'G':     /* newGroups disk location */
X                   cp = add_string(cp, article.newsgroup);
X                   continue;
X               case 'K':     /* Keywords  */
X                   cp = add_string(cp, header.keywords);
X                   continue;
X               case 'L':     /* Lines */
X                   cp = add_string(cp, header.numlines);
X                   continue;
X               case 'M':     /* Message-ID */
X                   cp = add_string(cp, header.ident);
X                   continue;
X               case 'N':     /* Newsgroups */
X                   cp = add_string(cp, header.nbuf);
X                   continue;
X               case 'O':     /* Actual Archived filename */
X                   cp = add_string(cp, filename);
X                   continue;
X               case 'P':     /* Path  */
X                   cp = add_string(cp, header.path);
X                   continue;
X               case 'R':     /* References  */
X                   cp = add_string(cp, header.references);
X                   continue;
X               case 'S':     /* Subject  */
X                   cp = add_string(cp, header.subject);
X                   continue;
X               case 'T':     /* Subject Topic  */
X                   cp = add_string(cp, article.description);
X                   continue;
X               case 'V':     /* Volume-Issue article filename  */
X                   cp = add_string(cp, article.filename);
X                   continue;
X               case 'a':     /* Archive-name */
X                   cp = add_string(cp, header.archive_name);
X                   continue;
X               case 'b':     /* Submitted-by */
X                   cp = add_string(cp, header.submitted_by);
X                   continue;
X               case 'c':     /* Control  */
X                   cp = add_string(cp, header.ctlmsg);
X                   continue;
X               case 'd':     /* Distribution  */
X                   cp = add_string(cp, header.distribution);
X                   continue;
X               case 'e':     /* Expires  */
X                   cp = add_string(cp, header.expdate);
X                   continue;
X               case 'f':     /* Followup-to  */
X                   cp = add_string(cp, header.followup_to);
X                   continue;
X               case 'i':     /* issue (if archive) */
X                   cp = add_string(cp,itoa(article.issue));
X                   continue;
X               case 'l':     /* Author's logon address */
X                   cp = add_string(cp, article.author_signon);
X                   continue;
X               case 'n':     /* Author's name */
X                   cp = add_string(cp, article.author_name);
X                   continue;
X               case 'o':     /* Organization */
X                   cp = add_string(cp, header.organization);
X                   continue;
X               case 'p':     /* Posting-number */
X                   cp = add_string(cp, header.posting_num);
X                   continue;
X               case 'r':     /* Reply-to */
X                   cp = add_string(cp, header.replyto);
X                   continue;
X               case 's':     /* Sender  */
X                   cp = add_string(cp, header.sender);
X                   continue;
X               case 't':     /* Patch-To  */
X                   cp = add_string(cp, header.patch_to);
X                   continue;
X               case 'u':     /* Summary */
X                   cp = add_string(cp, header.summary);
X                   continue;
X               case 'v':     /* volume (if archive) */
X                   cp = add_string(cp,itoa(article.volume));
X                   continue;
X               case 'x':     /* Xref */
X                   cp = add_string(cp, header.xref);
X                   continue;
X               default:
X                  (void) fprintf(errfp, "invalid format - %c\n", *--aptr);
X                  exit(2);
X           }    /* end switch */
X        }
X        else if (c == '\134') {
X           switch (*aptr++) {
X               case 'n':
X                   *cp++ = '\n';
X                   continue;
X               case 't':
X                   *cp++ = '\t';
X                   continue;
X           }
X        }
X        *cp++ = c;
X     }  /* end while */
X
X     (void) fprintf(fp, "%s\n", format);
X     return;
X}
END_OF_FILE
if test 7380 -ne `wc -c <'format.c'`; then
    echo shar: \"'format.c'\" unpacked with wrong size!
fi
# end of 'format.c'
fi
if test -f 'record_arc.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'record_arc.c'\"
else
echo shar: Extracting \"'record_arc.c'\" \(5492 characters\)
sed "s/^X//" >'record_arc.c' <<'END_OF_FILE'
X/*
X**
X** This software is Copyright (c) 1989 by Kent Landfield.
X**
X** Permission is hereby granted to copy, distribute or otherwise 
X** use any part of this package as long as you do not try to make 
X** money from it or pretend that you wrote it.  This copyright 
X** notice must be maintained in any copy made.
X**
X**
X**  History:
X**	Creation: Tue Feb 21 08:52:35 CST 1989 due to necessity.
X**                                                               
X*/
X#ifndef lint
Xstatic char SID[] = "@(#)record_arc.c	1.1 6/1/89";
X#endif
X
X#include <sys/types.h>
X#include <sys/stat.h>
X#include <dirent.h>
X#include <stdio.h>
X#include "cfg.h"
X
Xstatic char work[BUFSIZ];
Xstatic int len;
Xstatic FILE *archived_fp;
X
XFILE *fopen();
XFILE *efopen();
X
Xextern int test;
Xextern struct group_archive *newsgrp;
X
X/*
X** needs_to_be_archived:
X**
X** int needs_to_be_archived(filename) char *filename; { return(0); }
X**
X** This function is used to determine if the filename
X** passed to it requires archiving. If the filename is
X** found in the .archived file, it has been previously
X** archived and does not need to be now. If it is not
X** found in the .archived file, it needs to be archived.
X*/
X
Xint needs_to_be_archived(filename)
X    char *filename;
X{
X    /*
X    ** If the .archived file is missing, it must be
X    ** the first time that it is to be archived.
X    */
X    if ((archived_fp = fopen(newsgrp->arc_done,"r")) == NULL) 
X	return(1);
X
X    len = strlen(filename);
X 
X    while (fgets(work, sizeof work, archived_fp) != NULL) {
X        if (*work == '#')
X            continue;
X        if (strncmp(work,filename,len) == 0) {
X            (void) fclose(archived_fp);
X            return(0);
X        }
X    }
X    (void) fclose(archived_fp);
X    return(1);
X}
X
X/*
X** remove_expired:
X**
X** This function is used to maintain the .archived file in the
X** newsgroup's archive BASEDIR directory. This file is used to assure
X** that files are not archived over and over and that the 
X** administrator does not need to wait until the files have
X** expired before they are added to the archive. 
X** The .archived file stores a list of filenames of files that have been 
X** archived already. The remove_expired function removes filenames 
X** from the .archived file that no longer exist. In this manner the 
X** file is self maintaining. Expired entries are removed.
X*/
X
Xremove_expired()
X{
X    char news_file[20];
X    char fl_loc[MAXNAMLEN];
X    char tmp_loc[MAXNAMLEN];
X    FILE *tmp_archived;
X    struct stat stbuf;
X
X    /* Is this being run as a test ? */
X
X    if (test)
X        return;
X
X    /* Is this the first time this group is to be archived ? */
X
X    if (stat(newsgrp->arc_done, &stbuf) < 0) 
X        return;
X    
X    /* open the necessary files, creating a temp file */
X    (void) sprintf(tmp_loc,"%s/.arch_tmp", newsgrp->location);
X
X    tmp_archived = efopen(tmp_loc,"w");
X    archived_fp = efopen(newsgrp->arc_done,"r");
X
X    /* 
X    ** for every line in the .archived file,
X    **    check it comment line. If so, save it in the temp file
X    **    strip the string of any blanks or tabs inadvertantly 
X    **      added by admin in manual mode (editor)
X    **    check to see if the file still exists.
X    **    if so, write filename to the temp file
X    ** endfor
X    */
X
X    while (fgets(work, sizeof work, archived_fp) != NULL) {
X        if (*work == '#')      /* maintain comments in .archived */
X            (void) fprintf(tmp_archived,work);
X        else {
X            (void) sscanf(work, "%s %s", news_file, fl_loc);
X            if (stat(news_file, &stbuf) == 0) 
X                (void) fprintf(tmp_archived,work);
X        }
X    }
X
X    /*
X    ** Close both files and rename the temp 
X    ** file to the new .archived file.
X    */
X
X    (void) fclose(tmp_archived);
X    (void) fclose(archived_fp);
X    (void) rename(tmp_loc,newsgrp->arc_done);
X    return;
X}
X
X/*
X** get_archived_rec:
X**
X** get_archived_rec(filename) char *filename; { return(filename); }
X**
X** get_archived_rec is used to determine if the filename
X** passed to it has been archived. If its name is found
X** in the .archived file, it has been previously archived
X** and its archive information record is  returned to the
X** caling routine. Else it returns NULL.
X*/
X
Xchar *get_archived_rec(filename)
X    char *filename;
X{
X    /*
X    ** If the .archived file is missing, it must be
X    ** the first time that it is to be archived.
X    */
X    if ((archived_fp = fopen(newsgrp->arc_done,"r")) == NULL) 
X	return(NULL);
X
X    len = strlen(filename);
X 
X    while (fgets(work, sizeof work, archived_fp) != NULL) {
X        if (*work == '#')
X            continue;
X        if (strncmp(work,filename,len) == 0) {
X            (void) fclose(archived_fp);
X            *(work+(strlen(work)-1)) = '\0';
X            return(work);
X        }
X    }
X    (void) fclose(archived_fp);
X    return(NULL);
X}
X
X/*
X** write_archived:
X**
X** write_archived(filename, path) char *filename, path; {}
X**
X** This function is used to write a filename and its archived location
X** to the .archived file in the newsgroup's archive BASEDIR
X** directory since we do not want it rearchived tomorrow.
X*/
X
Xwrite_archived(filename, path)
X    char *filename;
X    char *path;
X{
X    FILE *fp;
X
X    /* 
X    ** If in test mode no actual operations are 
X    ** to be done...
X    */
X    if (test)
X        return;
X
X    /*
X    ** open the file and append the record
X    */
X
X    fp = efopen(newsgrp->arc_done,"a+");
X    (void) fprintf(fp,"%s %s\n",filename, path);
X    (void) fclose(fp);
X    return;
X}
END_OF_FILE
if test 5492 -ne `wc -c <'record_arc.c'`; then
    echo shar: \"'record_arc.c'\" unpacked with wrong size!
fi
# end of 'record_arc.c'
fi
if test -f 'rkive.5' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive.5'\"
else
echo shar: Extracting \"'rkive.5'\" \(8629 characters\)
sed "s/^X//" >'rkive.5' <<'END_OF_FILE'
X'br "@(#)rkive.5	1.1 6/1/89"
X.TH RKIVE 5
X.SH NAME
Xrkive.cf \- USENET Source Archiver Configuration File.
X.SH DESCRIPTION
X.I rkive.cf
Xallows the administrator to configure the way in which USENET sources
Xare archived.
X.PP
XThe configuration file is used to indicate where the archives are
Xto be located, who will own the archive members, etc. The configuration 
Xfile is divided into two sections, a global section and the individual 
Xnewsgroup specifications.
X.PP
XThe syntax of the individual line types are as follows:
X.RS
X.IP "Global Variable Line"
XVariable = value
X.IP "Newsgroup Identifier"
X$$comp.source.whatever
X.IP "Newsgroup Variable Line"
XVariable : value
X.RE
X.LP
XNote that the '=' is used to designate a global variable and
Xthat the ':' is used to determine a newsgroup variable.
X.PP
XThe global variables are divided up into variables that pertain to
Xall archiving as well as defaults to be used in the event that the
Xarchive administrator has not set a specific value for a "defaultable"
Xvariable.
X.PP
X.SH "GLOBAL VARIABLES"
X.PP
X.IP "SPOOLDIR =" 15
XThis is the base directory for the news subsystem.
X.IP "PROBLEMS ="
XThe name of the base directory used to store any duplicate or "problem"
Xarticles that rkive(1) cannot deal with. All articles are stored under 
Xthis directory in a newsgroup / volume directory structure.
X.IP "LOG ="
XThe location of the master log in which actions are logged. 
XIf this variable is not set, no logging takes place.
X.IP "LOG_FORMAT ="
XThe format of the records of the master log file.  This variable only
Xpertains to the global log file format. The actual format specification
Xmust be enclosed in "". See article(1) for a discussion of the available 
Xselection format capabilities.
X.IP "INDEX =" 
XThe location of the master index file (if one is to be kept).  The index 
Xcan be used to interface with the netlib source retrieval software facility.
X.IP "INDEX_FORMAT ="
XThe format of the records of the master index file. The actual format
Xspecification must be enclosed in "".   See article(1) for a
Xdiscussion of the available selection format capabilities.
X.IP "MAIL ="
XIf specified, logged actions are mailed to the users listed. 
XThe user names are a comma separated list. It is not necessary to
Xspecify any users. 
X.PP
XThe following values are used if the administrator has not
Xset a value for a corresponding newsgroup configuration item.
X.IP "TYPE =" 15
XThis is the default archive type.  There are 3 possible ways
Xin which to archive USENET sources,
X.RS
X.IP
XVolume-Issue, Archive-Name or Article Number.
X.RE
X.IP
XThese are used to determine if you wish the articles archived in a 
X.RS
X.IP
X/basedir/amiga/Volume1/v001i22 or /basedir/amiga/Volume1/sitonit or
X/basedir/amiga/Volume1/44 format.
X.RE
X.IP "PATCHES ="
XThis variable determines the way in which patches are installed into 
Xthe archive. If the PATCHES entry is not defined either globally or within
Xthe newsgroup, the article is handled as a regular article and is stored 
Xaccording to the specified parameters of the newsgroup. The following are
Xthe valid possible values for the PATCHES variable:
X.RS
X.IP "PATCHES=Historical" 6 
XThis is the same as if no PATCHES entry existed at all. It is useful 
Xif Historical patches archiving is the default but there are certain 
Xnewsgroups that have it specified differently.
X.IP "PATCHES=Package"
XPackage patches archiving allows the inbound patch to be placed with 
Xthe directory with the initially posted articles. In this manner
Xall parts and fixes of a package are together making it easier for 
Xsoftware retrieval by uucp requests and mail request facilities
Xsuch as netlib.
X.RE
X.IP "OWNER ="
XThe owner of the archive files after they are stored in the archive.
X.IP "GROUP ="
XThe group ownership of the archive files after they are stored in the archive.
X.IP "MODE ="
XThe default modes of the files residing in the archive.
X.IP "COMPRESS =" 
XThe location of the compression utility if the files are to be reduced.
XIf this variable is specified, it must contain the full path to the command
Xused to perform the compression.
X.PP
XThe following is a sample global variable section.
X.PP
X.nf
XSPOOLDIR=/usr/spool/news      
XPROBLEMS=/usenet/problems
XLOG=/usenet/archive.log
XLOG_FORMAT= "%O %T %l" 
XINDEX= /usenet/index
XINDEX_FORMAT= "%a %T" 
XMAIL=kent,rick,chris
XTYPE= Archive-Name
XPATCHES= Package
XOWNER=src
XGROUP=archive
XMODE=0444
X#COMPRESS=/usr/lbin/compress
X.nr
X.PP
XIn the above sample, if any of the individual newsgroups had not
Xhad the type of the archive specified, the type would have defaulted
Xto an Archive-Name (if the newsgroup had the auxiliary headers required
Xto support Archive-Name). By default, no compression was to be done. All
Xresults would have been mailed to the accounts of kent, rick and chris.
XIf a newsgroup had not specified the ownership and modes of the destination
Xarchive members, the values specified in the global OWNER, GROUP, and MODE
Xwould have been used.
X.LP
X.SH "NEWSGROUP SPECIFICATIONS"
X.PP
X.PP
XAn individual newsgroup entry is identified by a $$ as the first two
Xcharacters of the line. The name of the newsgroup (in newsgroup format)
Xfollows such as
X.IP
X$$comp.sources.unix		
X.LP
X.IP "BASEDIR :" 15
XThis is the base directory for the archive.
X.IP "LOG :"
XThe location of the log file in which actions are logged. 
XIf this variable is not set, no logging takes place.
X.IP "LOG_FORMAT :"
XThe format of the records of the log file.  The actual format
Xspecification must be enclosed in "".  See article(1) for a 
Xdiscussion of the available selection format capabilities.
X.IP "INDEX :" 
XThe location of the index file (if one is to be kept).  The index can be 
Xused to interface with the netlib source retrieval software facility.
X.IP "INDEX_FORMAT :"
XThe format of the records of the index file.  The actual format
Xspecification must be enclosed in "".  See article(1) for a
Xdiscussion of the available selection format capabilities.
X.IP "MAIL :"
XIf specified, logged actions are mailed to the list of users specified. 
XThe user names are a comma separated list. It is not necessary to
Xspecify any users. 
X.IP "TYPE :" 
XThis is the archive type.  There are 3 possible ways
Xin which to archive USENET sources,
X.RS
X.IP
XVolume-Issue, Archive-Name or Article Number.
X.RE
X.IP "PATCHES ="
XThis variable determines the way in which patches are installed into 
Xthe newsgroup's archive. If the PATCHES entry is not defined either 
Xglobally or within the newsgroup, the article is handled as a regular 
Xarticle and is stored according to the specified parameters of the 
Xnewsgroup. The following are the valid possible values for the 
XPATCHES variable:
X.RS
X.IP "PATCHES: Historical" 6 
XThis is the same as if no PATCHES entry existed at all. It is useful 
Xif Historical patches archiving is the default but there are certain 
Xnewsgroups that have it specified differently.
X.IP "PATCHES: Package"
XPackage patches archiving allows the inbound patch to be placed with 
Xthe directory with the initially posted articles. In this manner
Xall parts and fixes of a package are together making it easier for 
Xsoftware retrieval by uucp requests and mail request facilities
Xsuch as netlib.
X.RE
X.IP "OWNER :"
XThe the owner of the files after they are stored in the archive 
Xdirectory for the newsgroup.
X.IP "GROUP :"
XThe group ownership of the archive files after they are stored in the 
Xarchive directory for the newsgroup.
X.IP "MODE :"
XThe default modes of the files residing in the archive directory.
X.IP "COMPRESS :" 
XThe location of the compression utility if the files are to be reduced.
XIf this variable is specified, it must contain the full path to the command
Xused to perform the compression.
X.PP
XA sample entry for comp.sources.unix might look like:
X.nf
X$$comp.sources.unix		
X	BASEDIR: /usenet/unix 
X	TYPE: Volume-Issue
X	PATCHES: Historical
X	OWNER: kent
X	GROUP: support
X	MODE: 0664
X	INDEX: /usenet/unix/index
X	INDEX_FORMAT: "%O %a %S" 
X	COMPRESS: /usr/lbin/compress
X	MAIL: kent,bob,sally
X.nr
X.PP
XIn the above sample, comp.sources.unix would be archived in /usenet/unix.
XThe individual volume directories would be created there. All files would
Xbe owned by kent and the group support. The files would be writable by the
Xgroup as well as the owner. (Not a smart idea but just for examples sake.)
XLogging is not being done although an index entry is being generated for
Xeach article archived. All files stored in the archive for this newsgroup
Xare to be compressed using the compress program in /usr/lbin. Mail is sent 
Xto kent, bob and sally when the archiving of comp.sources.unix has been
Xcompleted. 
X.SH "SEE ALSO"
Xrkive(1), article(1), ckconfig(1)
X.LP
END_OF_FILE
if test 8629 -ne `wc -c <'rkive.5'`; then
    echo shar: \"'rkive.5'\" unpacked with wrong size!
fi
# end of 'rkive.5'
fi
if test -f 'rkive.h' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'rkive.h'\"
else
echo shar: Extracting \"'rkive.h'\" \(7464 characters\)
sed "s/^X//" >'rkive.h' <<'END_OF_FILE'
X/*
X** 	@(#)rkive.h	1.1 6/1/89 
X**
X**	This is the rkive source configuration header file. 
X**	Please examine and change to suite your own site's needs..
X**
X*/
X
X/*
X** The default owner, group and modes of the archived files
X** need to be stated below. The values are only used if the
X** appropriate values are not in the configuration file.
X*/ 
X
X#define OWNER    0
X#define GROUP    3
X#define MODES    0444
X
X/* 
X** If you have a smart mailer that supports a "-s subject" command
X** and you wish to have the subject line added when archived mail
X** is sent, define SUBJECT_LINE. 
X*/
X
X#define SUBJECT_LINE 
X
X#ifdef SUBJECT_LINE
X#define MAIL        "/usr/bin/mailx"	 /* mail program to use */
X/* #define MAIL        "/usr/local/bin/elm" */
X#else
X#define MAIL        "/bin/mail"	 /* mail program to use */
X#endif
X
X/*
X** The PROBLEMS_DIR is the default directory to use in the event 
X** problems are encountered such as duplicate article names and 
X** the execution flags do not specify overwriting. 
X**
X** The new, inbound article is stored in the PROBLEMS_DIR in the 
X** problems_dir/newsgroup/volume/filename so that the administrator 
X** can review and fix the problem whenever time becomes available...
X**
X** The PROBLEMS_DIR define is used only if the administrator has not 
X** specified the PROBLEMS path variable inside of the LOCATION 
X** (config) file.
X*/
X
X#define PROBLEMS_DIR "/usenet/problems"  
X
X/* 
X** Home directory for news    
X*/
X
X#define SPOOLDIR     "/usr/spool/news"   
X
X/* 
X** Location of the default rkive configuration file.
X*/
X
X#define LOCATION     "/usr/local/lib/rkive.cf"  
X
X/*
X** Defines to control the handling of repostings.
X**
X** ADD_REPOST_SUFFIX && REPOST_SUFFIX
X**
X**     If ADD_REPOST_SUFFIX is defined, all reposts will have the 
X**     string specified in REPOST_SUFFIX appended to the archive
X**     filename so that a repost of elm/part07 would appear in
X**     the archive as elm/part07-repost prior to any compression.
X**
X**     CAUTION: This should *not* be used on a filesystem with
X**		14 character file name limits. If you are going
X**		to be making your archive available to the general
X**		community do *not* use this. The portability of
X**		filenames is greatly reduced. This has been added
X**		with much hesitation. The rational was that there
X**		was no reason to punish/limit the functionality
X**		just because of limitations of a specific "brand"
X**		of unix and since that "brand" was correcting its
X**		"error" in the future, why not put it in now ?
X**		This is not a configuration item on a per newsgroup
X**		basis. It might be useful for Historical archiving
X**		using only Volume/Issue archiving with no COMPRESSION.
X**
X** MV_ORIGINAL
X**     The original article is placed into a "original" directory in 
X**     the problems directory (if duplicated). The inbound reposted
X**     article is placed into the archive in the correct position.
X**
X** No Reposting Defines specified:
X**    The inbound article would be placed into the archive in the 
X**    correct position only if the initial article is not in the archive.
X**    Otherwise the reposted article is placed in the problems directory 
X**    as a normal duplicate article is now.
X*/
X
X/* #define ADD_REPOST_SUFFIX */
X#define MV_ORIGINAL 
X
X#ifdef ADD_REPOST_SUFFIX 
X#define REPOST_SUFFIX  "-repost" 
X#endif
X
X/* 
X** If you wish your volume directories to be Volume, VOL, vOLuMe
X** or any other such nonsense, change the VOLUME define below.
X*/
X
X#define VOLUME       "volume"
X
X/* 
X** If you wish to have the headers "trimmed" when the file is archived,
X** assure that REDUCE_HEADERS is defined. Currenlty all header lines that
X** are not either;
X**	 From:, Newsgroups:, Subject:, Message-ID:, and Date:
X** will be removed. See news_arc.c if you wish to add or subtract header
X** lines to keep. This can produce a savings of between 200 to 500 bytes
X** per archived article.
X*/
X
X#define REDUCE_HEADERS 
X
X/* 
X** The following define specifies a default format for generating
X** index file records in the event that there is no index format
X** specified for either the newsgroup or for the global default.
X** See article.1 for a discussion of the different types of selection
X** characters available for use in the format specifications.
X*/
X
X#define DEFAULT_INDEX_FORMAT       "%B\t%S"
X
X/* 
X** The following define specifies a default format for generating
X** log file records in the event that there is no log format
X** specified for either the newsgroup or for the global default.
X*/
X#define DEFAULT_LOG_FORMAT         "%O\t%T"
X
X/*
X** The size of the group array. If you are archiving the world
X** you might need to bump this up...
X*/
X
X#define NUM_NEWSGROUPS  32
X
X/**********************************************************************
X*******************  NO CHANGES REQUIRED PAST HERE  *******************
X**********************************************************************/
X
X/*
X** check to assure repost defines are in order...
X*/
X
X#if defined(ADD_REPOST_SUFFIX) + defined(MV_ORIGINAL) > 1
X#include "ERROR - Can only specify a maximum of one way to handle reposts!"
X#endif
X
X/*
X** Standard stuff
X*/
X
X#ifndef TRUE
X#define TRUE   1
X#endif
X
X#ifndef FALSE
X#define FALSE  0
X#endif
X
X/*
X** archive type defines 
X**
X** These defines are used to determine which type of archiving 
X** methods the administrator has requested for the newsgroup.
X**
X*/
X
X#define ARCHIVE_NAME     0	/* Archive as "elm/part03"  */
X#define VOLUME_ISSUE     1	/* Archive as "v16i003"     */
X#define ARTICLE_NUMBER   2	/* Archive with same name   */
X				/* as the file to archive   */
X
X/*
X** patch handling type defines 
X**
X** These defines are used to determine which type of 
X** method the administrator has requested for the the
X** handling of patches received in the newsgroup.
X**
X*/
X
X#define HISTORICAL   0    	/* Archive as normally done.        */
X#define PACKAGE      1    	/* Archive patches in the directory */
X                                /* containing the initial posting.  */
X
Xstruct group_archive {
X    int owner;                  /* owner id of the archive files     */
X    int group;                  /* group id of the archive files     */
X    int modes;                  /* modes of the stored archive files */
X    int type;                   /* Type of archiving to be used.     */
X				/*        0 = Archive-Name           */
X                                /*        1 = Volume-Issue           */
X                                /*        2 = Article-Number         */
X    int patch_type;             /* Method of handling patches.       */
X                                /*        0 = Historical             */
X                                /*        1 = Package                */
X    char ng_name[MAXNAMLEN];    /* Newsgroup to be archived.         */
X    char location[MAXNAMLEN];	/* Path to archive's base directory. */
X    char arc_done[MAXNAMLEN];	/* Archive's .archived already file  */
X    char mail_list[BUFSIZ];	/* List of users to mail when new    */
X				/* members are added to the archive. */
X    char logfile[MAXNAMLEN];	/* Path to archive specific log file */
X    char index[MAXNAMLEN]; 	/* Path to archive specific index.   */
X    char patchlog[MAXNAMLEN];	/* Path to archive's patches log.    */
X    char logformat[BUFSIZ];	/* Format of the logfile entry.      */
X    char indformat[BUFSIZ];	/* Format of the index entry.        */
X    char compress[MAXNAMLEN];	/* Command line to use to compress   */
X				/* new archive members, optional.    */
X};
END_OF_FILE
if test 7464 -ne `wc -c <'rkive.h'`; then
    echo shar: \"'rkive.h'\" unpacked with wrong size!
fi
# end of 'rkive.h'
fi
echo shar: End of archive 2 \(of 4\).
cp /dev/null ark2isdone
MISSING=""
for I in 1 2 3 4 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 4 archives.
    rm -f ark[1-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0

-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.



More information about the Comp.sources.unix mailing list