#! /bin/sh
# Make a new directory for the rn sources, cd to it, and run kits 1 thru 11 
# through sh.  When all 11 kits have been run, read README.

echo "This is rn kit 11 (of 11).  If kit 11 is complete, the line"
echo '"'"End of kit 11 (of 11)"'" will echo at the end.'
echo ""
export PATH || (echo "You didn't use sh, you clunch." ; kill $$)
echo Extracting sw.h
cat >sw.h <<'!STUFFY!FUNK!'
/* $Id: sw.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
 *
 * $Log: sw.h,v $
 * Revision 4.4.3.1  1992/02/01  03:09:32  sob
 * Release 4.4 Patchlevel 3
 *
 * Revision 4.4  1991/09/09  20:27:37  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

#ifdef INNERSEARCH
EXT int gline INIT(0);
#endif

void    sw_init ANSI((int,char **,char **));
void    sw_file ANSI((char **,bool_int));
void    sw_list ANSI((char *));
void	decode_switch ANSI((char *));
void	pr_switches ANSI((void));
void	cwd_check ANSI((void));
!STUFFY!FUNK!
echo Extracting addng.h
cat >addng.h <<'!STUFFY!FUNK!'
/* $Id: addng.h,v 4.4.3.1 1992/02/01 03:09:32 sob PATCH_3 sob $
 *
 * $Log: addng.h,v $
 * Revision 4.4.3.1  1992/02/01  03:09:32  sob
 * Release 4.4 Patchlevel 3
 *
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

void	addng_init ANSI((void));
#ifdef FINDNEWNG
    bool	newlist ANSI((bool_int,bool_int));
# ifdef ACTIVE_TIMES
    bool	find_new_groups ANSI((void));
# else
    long	birthof ANSI((char *,ART_NUM));
# endif
    bool	scanactive ANSI((void));
#endif
!STUFFY!FUNK!
echo Extracting Wishlist
cat >Wishlist <<'!STUFFY!FUNK!'
Generalized article set manipulation
	Interface to subject listing.
	Recursive newsgroup visitation.
Virtual article abstract type to allow the following:
	Personalized header munging via % subs.
	Undigestification.
	Personal archive perusal.
	Mail handling.
Parent command (waiting for ARTFILE interface and recursive newsgroups).
Merge Pnews and postnews or possibly make Pnews into a C program.
Replace Rnmail to a direct interface to popular mail user agents.
Vnews duplicate suppression algorithm for sites that can't do Xref patch.
Need to pull parallel arrays into array of structs.
Separation of .newsrc functions and newsgroup functions to separate processes
	communicating via pipes (to make fit on non-separate-I-and-D pdp11,
	or unreasonable facsimiles thereof).
.newsrc management for a variety of NNTP servers.
Add xrn feature to continue to retry when NNTP server is unavailable.
Make it possible to "refresh" the local active file to catch any new 
articles that may have come in via NNTP.
Faster!!!
Smaller!!!
More general!!!
Perfect?

!STUFFY!FUNK!
echo Extracting cheat.h
cat >cheat.h <<'!STUFFY!FUNK!'
/* $Id: cheat.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: cheat.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

#ifdef ARTSEARCH
EXT ART_NUM srchahead INIT(0); 	/* are we in subject scan mode? */
				/* (if so, contains art # found or -1) */
#endif

#ifdef PENDING
#   ifdef CACHESUBJ
	EXT ART_NUM subj_to_get;
#   endif
#endif

void	cheat_init ANSI((void));
void	look_ahead ANSI((void));
void	collect_subjects ANSI((void));
!STUFFY!FUNK!
echo Extracting ngstuff.h
cat >ngstuff.h <<'!STUFFY!FUNK!'
/* $Id: ngstuff.h,v 4.4 1991/09/09 20:23:31 sob Exp sob $
 *
 * $Log: ngstuff.h,v $
 * Revision 4.4  1991/09/09  20:23:31  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

#define NN_NORM 0
#define NN_INP 1
#define NN_REREAD 2
#define NN_ASK 3

EXT bool one_command INIT(FALSE);	/* no ':' processing in perform() */

void	ngstuff_init ANSI((void));
int	escapade ANSI((void));
int	switcheroo ANSI((void));
int	numnum ANSI((void));
int	perform ANSI((char *,int));

!STUFFY!FUNK!
echo Extracting art.h
cat >art.h <<'!STUFFY!FUNK!'
/* $Id: art.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: art.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

/* do_article() return values */

#define DA_NORM 0
#define DA_RAISE 1
#define DA_CLEAN 2
#define DA_TOEND 3

void	art_init ANSI((void));
int	do_article ANSI((void));
int	page_switch ANSI((void));
bool	innermore ANSI((void));
!STUFFY!FUNK!
echo Extracting help.h
cat >help.h <<'!STUFFY!FUNK!'
/* $Id: help.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: help.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

void	help_init ANSI((void));
int	help_ng ANSI((void));
int	help_art ANSI((void));
int	help_page ANSI((void));
#ifdef ESCSUBS
    int	help_subs ANSI((void));
#endif
!STUFFY!FUNK!
echo Extracting uudecode.h
cat >uudecode.h <<'!STUFFY!FUNK!'
/* $Id: uudecode.h,v 4.4 1991/09/09 20:27:37 sob Exp sob $
 *
 * $Log: uudecode.h,v $
 * Revision 4.4  1991/09/09  20:27:37  sob
 * release 4.4
 *
 *
 * 
 */

/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */
EXT FILE *uu_out INIT(NULL);
EXT char uu_fname[MAXFILENAME];

int uud_start ANSI((char *));
int uud_send ANSI((void));
int uudecode ANSI((FILE *));
!STUFFY!FUNK!
echo Extracting init.h
cat >init.h <<'!STUFFY!FUNK!'
/* $Id: init.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: init.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

EXT char *lockname INIT(nullstr);

bool	initialize ANSI((int,char **));
void	lock_check ANSI((void));
void	newsnews_check ANSI((void));
!STUFFY!FUNK!
echo Extracting makekit
cat >makekit <<'!STUFFY!FUNK!'
#!/bin/sh
# $Id: makekit,v 4.4 1991/09/09 20:23:31 sob Exp sob $
#
# $Log: makekit,v $
# Revision 4.4  1991/09/09  20:23:31  sob
# release 4.4
#
#
# 

numkits=$#
for kitlist in $*; do
    kit=`basename $kitlist .list`
    kitnum=`expr "$kit" : 'kit\([0-9][0-9]*\)'`
    echo "*** Making $kit ***"
    kitleader "$kit" "$kitnum" "$numkits"
    for file in `/bin/cat $kitlist`; do
	echo $file
	echo "echo Extracting $file" >> $kit
 	if egrep '^~' $file >/dev/null; then
	    echo "sed >$file <<'!STUFFY!FUNK!' -e 's/X//'" >> $kit
	    sed <$file >>$kit -e 's/^/X/'
	elif egrep '^\.$' $file >/dev/null; then
	    echo "sed >$file <<'!STUFFY!FUNK!' -e 's/X//'" >> $kit
	    sed <$file >>$kit -e 's/^/X/'
	else
	    echo "cat >$file <<'!STUFFY!FUNK!'" >> $kit
	    /bin/cat $file >> $kit
	fi
	echo "!STUFFY!FUNK!" >> $kit
    done
    kittrailer "$kit" "$kitnum" "$numkits"
done
!STUFFY!FUNK!
echo Extracting INTERN.h
cat >INTERN.h <<'!STUFFY!FUNK!'
/* $Id: INTERN.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: INTERN.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

#undef EXT
#define EXT

#undef INIT
#ifdef xenix
#define INIT(x) =x
#else
#define INIT(x) = x
#endif

#define DOINIT
!STUFFY!FUNK!
echo Extracting autosub.h
cat >autosub.h <<'!STUFFY!FUNK!'
/*
 * $Id: autosub.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: autosub.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 *
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

EXT int autosubscribe ANSI((char *));
EXT bool matchlist  ANSI((char *, char *));
!STUFFY!FUNK!
echo Extracting EXTERN.h
cat >EXTERN.h <<'!STUFFY!FUNK!'
/* $Id: EXTERN.h,v 4.4 1991/09/09 20:18:23 sob Exp sob $
 *
 * $Log: EXTERN.h,v $
 * Revision 4.4  1991/09/09  20:18:23  sob
 * release 4.4
 *
 *
 * 
 */
/* This software is Copyright 1991 by Stan Barber. 
 *
 * Permission is hereby granted to copy, reproduce, redistribute or otherwise
 * use this software as long as: there is no monetary profit gained
 * specifically from the use or reproduction of this software, it is not
 * sold, rented, traded or otherwise marketed, and this copyright notice is
 * included prominently in any copy made. 
 *
 * The author make no claims as to the fitness or correctness of this software
 * for any use whatsoever, and it is provided as is. Any use of this software
 * is at the user's own risk. 
 */

#undef EXT
#define EXT extern

#undef INIT
#define INIT(x)

#undef DOINIT
!STUFFY!FUNK!
echo Extracting manimake
cat >manimake <<'!STUFFY!FUNK!'
#!/bin/sh
# $Id: manimake,v 4.4 1991/09/09 20:23:31 sob Exp sob $
#
# $Log: manimake,v $
# Revision 4.4  1991/09/09  20:23:31  sob
# release 4.4
#
#
# 

: make MANIFEST and MANIFEST.new say the same thing
if test -f MANIFEST.new; then
    cat <<'EOH' > MANIFEST
After all the rn kits are run you should have the following files:

Filename	Kit Description
--------	--- -----------
EOH
    sort MANIFEST.new >.mani
    grep . kit*.list | sed 's/^kit\(.*\)\.list:\$*\(.*\)$/\2 |\1|/' | \
	sort | \
	join -a1 - .mani | \
	awk -F'|' '{printf "%-16s%2s %s\n",$1,$2,$3}'  >> MANIFEST
    rm .mani
else
    echo "You don't have a MANIFEST.new file.  Run manifake."
fi
!STUFFY!FUNK!
echo Extracting manifake
cat >manifake <<'!STUFFY!FUNK!'
#!/bin/sh
# $Id: manifake,v 4.4 1991/09/09 20:23:31 sob Exp sob $
#
# $Log: manifake,v $
# Revision 4.4  1991/09/09  20:23:31  sob
# release 4.4
#
#
# 

: make MANIFEST and MANIFEST.new say the same thing
if test ! -f MANIFEST.new; then
    if test -f MANIFEST; then
	sed <MANIFEST >MANIFEST.new \
	    -e '1,/---/d' \
	    -e 's/\([ 	][ 	]*\)[0-9]*  */\1/'
    else
	echo "Make a MANIFEST.new file, with names and descriptions."
    fi
fi
!STUFFY!FUNK!
echo ""
echo "End of kit 11 (of 11)"
cat /dev/null >kit11isdone
config=true
for iskit in 1 2 3 4 5 6 7 8 9 10 11 ; do
    if test -f kit${iskit}isdone; then
	echo "You have run kit ${iskit}."
    else
	echo "You still need to run kit ${iskit}."
	config=false
    fi
done
case $config in
    true)
	echo "You have run all your kits.  Please read README and then type Configure."
	chmod 755 Configure
	;;
esac
: I do not append .signature, but someone might mail this.
exit
