[mod.recipes] The mod.recipes software

reid@glacier.ARPA (Brian Reid) (12/21/85)

Many sites missed the mod.recipes software the first time around, because
several backbone sites dropped the posting. Here it is again. This is a very
slightly different version from what was posted before. If you got it working
before, there's no particular point in installing this new version. However,
if you were unable to get the software to work before, or if you had to
butcher it a lot, then read on. There is now a separate BSD and SYSV
installation procedure, and a completely separate installation procedure for
novices and non-programmers to try if they can't get any help from their
system managers.

	Brian Reid	decwrl!glacier!reid
	Stanford	reid@SU-Glacier.ARPA


#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Unpack the file by typing "sh filename", where "filename" is the
#    name of your file. It will create these files in your current
#    directory:
#	 README
#	 Makefile.bsd
#	 Makefile.sysv
#	 Novice
#	 Novice.install
#	 Novice.makefile
#	 Novice.start
#	 Novice.step1
#	 Novice.step2
#	 Novice.step3a
#	 Novice.step3b
#	 cookbook.doc
#	 recipes.doc
#	 cookbook.1.X
#	 rcbook.n.X
#	 rcbook.t.X
#	 rcextract.X
#	 rcindex.X
#	 rcintro.X
#	 rckeep.X
#	 rcnroff.X
#	 rcshow.X
#	 rctypeset.X
#	 recipes.5.X
#	 configure.sh
#	 tmac.recip
 
echo extracting README
cat > README << '16415!mod.recipes!'
This is the directory of programs that work with mod.recipes files, to make
the USENET cookbook.

If you are not a programmer, but want to use this software, and can't enlist
the help of a programmer, please read the file Novice. It contains simplified
instructions, and can lead you through the installation procedure even if you
have never installed software before.

To install the recipe software at your site, copy either Makefile.bsd or
Makefile.sysv over to be named "Makefile", then edit it per the instructions
in the beginning.

If you have the "less" program, you will probably want to use it instead of
"more". You may find that the best version of troff at your site is called
"ptroff" or "dtroff" or "itroff" or "qtroff" or whatever--the first letter
tends to correspond to the manufacturer of the machine for which that troff
is targeted. I have never used "ditroff", and I don't know if these macros
will work with it or not. I kind of doubt it.

Once you have edited your Makefile, type
	make configure
This will produce configured executable versions of the cookbook software in
your current directory. Once you have satisfied yourself that it is not a
trojan horse, type
	make install
which will copy the executable programs to the directory you have chosen for
them (we put them in /usr/local/bin) and copy the manual pages to
/usr/man/man1 and /usr/man/man5. You needn't be root to install, you only
need to be a user who has write permission in the bin and man directories.

Once you've done that, go read the man pages, then go play with "rn" and have
fun printing cookbooks. This will also work with readnews; I don't know from
notesfiles, and I have never tried it with vnews or yarn or any of those
other programs.

Here are the program names and what they do:

rcbook.n	make a cookbook with nroff
rcbook.t	make a cookbook with troff
rcextract	extract a recipe from a news article (called by rctypeset)
rcindex		produce an index of saved recipes (called by rcbook)
rcintro		generate the introduction to the cookbook (called by rcbook)
rckeep		keep a recipe
rcnroff		run one recipe through nroff
rcshow		show one recipe on the screen
rctypeset	run one recipe through troff

	Brian Reid	{sun,decwrl,hplabs}!glacier!reid
	Stanford	reid@SU-Glacier.ARPA
			reid@Glacier.stanford.edu
16415!mod.recipes!
echo extracting Makefile.bsd
cat > Makefile.bsd << '16415!mod.recipes!'
# mod.recipes software Makefile. To install, edit the following variables,
# then type "make install"
#
# Where are the object files for the recipe software kept?
OBJDIR=/usr/local/bin

# Where is the news spooling directory?
NEWSDIR=/usr/spool/news

# What is the default "keep" directory. If you want a per-person keep
# directory, put $$HOME/something; if you want a systemwide keep directory
# (to save disk space), then put an absolute pathname here.
DEFDIR=$$HOME/Recipes

# What PATH do you want used inside the shell scripts? At the very least,
# it must contain $OBJDIR
DEFPATH=:$(OBJDIR):/usr/ucb:/usr/bin:/bin:

# What version of TRoff works best at your site, and with what options does it
# do its best job on the Unix manual pages macros?
DEFTROFF=troff -man

# What is your favorite pager and what are its options?
DEFPAGER=more -s
############################################################################

OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
	rcintro

configure: Makefile 
	sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
		'$(DEFTROFF)' '$(DEFPAGER)'

install:
	cp $(OBJECTS) $(OBJDIR)
	cp cookbook.1 /usr/man/man1
	cp recipes.5 /usr/man/man5
16415!mod.recipes!
echo extracting Makefile.sysv
cat > Makefile.sysv << '16415!mod.recipes!'
# mod.recipes software Makefile. To install, edit the following variables,
# then type "make install"
#
# Where are the object files for the recipe software kept?
OBJDIR=/usr/local/bin

# Where is the news spooling directory?
NEWSDIR=/usr/spool/news

# What is the default "keep" directory. If you want a per-person keep
# directory, put $$HOME/something; if you want a systemwide keep directory
# (to save disk space), then put an absolute pathname here.
DEFDIR=$$HOME/Recipes

# What PATH do you want used inside the shell scripts? At the very least,
# it must contain $OBJDIR
DEFPATH=:$(OBJDIR):/usr/bin:/bin:

# What version of TRoff works best at your site, and with what options does it
# do its best job on the Unix manual pages macros?
DEFTROFF=troff -man

# What is your favorite pager and what are its options?
DEFPAGER=pg
############################################################################

OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
	rcintro

configure: Makefile 
	sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
		'$(DEFTROFF)' '$(DEFPAGER)'

install:
	cp $(OBJECTS) $(OBJDIR)
	cp cookbook.1 /usr/man/man1
	cp recipes.5 /usr/man/man5
16415!mod.recipes!
echo extracting Novice
cat > Novice << '16415!mod.recipes!'
This file is for people who know how to cook but who don't know how to
program, and who find that they are unable to get the help of a programmer in
getting the mod.recipes software installed.

The novice installation is set up as a series of steps; at the end of each
you will be told what to do next.

To begin, type this command:
	Novice.start
Make sure you put the capital N at the beginning of it. If it doesn't work,
try typing this command:
	chmod 755 Novice.*
and then try
	Novice.start
a second time. If it still doesn't work, then you gotta get help.
16415!mod.recipes!
echo extracting Novice.install
cat > Novice.install << '16415!mod.recipes!'
#! /bin/sh
# This program is part of the novice mod.recipes installation procedure.
# Please read the file "Novice".
trap "rm -f mod.rec.$$" 0 1 2 3 15
echo $$ > mod.rec.$$
if test -f $HOME/mod.rec.$$
then
    cat Novice.step3a
else
    echo Installing ...
    cp $*
    cat Novice.step3b
fi
16415!mod.recipes!
echo extracting Novice.makefile
cat > Novice.makefile << '16415!mod.recipes!'
### This file is used as part of the Novice installation procedure. Please
### read file "Novice".
##=
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# (1) Where is the news spooling directory? If you don't have any idea, then
# leave this line alone--this is the best guess. If you get this wrong,
# all of the programs will still work, though they may give strange error
# messages at times.

NEWSDIR=/usr/spool/news

# (2) What version of troff works best at your site? Change the word "troff" 
# to the name of your version, if it is different.
#
# If you don't know, then try one of these guesses:
# If you have an Apple LaserWriter, your best guess is "ptroff"
# If you have an Imagen printer, your best guess is "itroff"
# If you have a QMS or Talaris printer, your best guess is "qtroff"
# Otherwise try just "troff", or ask for help.
# If you get this wrong, you will be able to save recipes but you won't be
# able to typeset them or print them out.

MYTROFF=troff

# (3) What is your favorite pager and what are its options? If you don't have
# any idea, then leave this line alone. If you have a "pg" program, then edit
# the word "cat" into "pg" below. If you have a "more" program, then edit the
# word "cat" into "more". Even if you get this completely wrong, almost
# everything will still work.

DEFPAGER=cat

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# You should not have to change anything below this line.

DEFTROFF=$(MYTROFF) -man
DEFDIR=$$HOME/Recipes
OBJDIR=$$HOME
DEFPATH=:$(OBJDIR):XXDEFPATH
OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
	rcintro

configure: Makefile 
	@sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
		'$(DEFTROFF)' '$(DEFPAGER)'
	@cat Novice.step2

install:
	@Novice.install $(OBJECTS) $(OBJDIR)
16415!mod.recipes!
echo extracting Novice.start
cat > Novice.start << '16415!mod.recipes!'
#! /bin/sh
# This script is used to begin the Novice installation procedure. Please read
# file "Novice" for instructions. Pay no attention to the man behind the
# curtain.
#
###########################################################################
sed -e "s|XXDEFPATH|$PATH|" \
    -e "/###/d" \
    -e '/##=/a\
# This version of the mod.recipes Makefile is for people who are not really\
# programmers, and who cannot get other help. Edit the file to answer the 3\
# questions  below, and then type "make configure".\
' -e '/##=/d' Novice.makefile > Makefile
cat Novice.step1
16415!mod.recipes!
echo extracting Novice.step1
cat > Novice.step1 << '16415!mod.recipes!'

OK, your Makefile is now created. Using your favorite text editor, edit it to
try to answer the 3 questions at the beginning. If you can't answer them,
don't give up--the system will still work to a certain extent without the
answers.

Once you have finished editing the Makefile, type this:

	make configure
16415!mod.recipes!
echo extracting Novice.step2
cat > Novice.step2 << '16415!mod.recipes!'

OK, the mod.recipe software and documentation are now all "configured". That
means that they have been updated to reflect the details of your installation.
What you need to do next is to "install" them, which means to copy them to
your home directory where you can execute them while reading news. To do
that, type this:

	make install
16415!mod.recipes!
echo extracting Novice.step3a
cat > Novice.step3a << '16415!mod.recipes!'

Because you have been working in your home directory, the software is already
installed there. We're done! Go read the files "cookbook.doc" and
"recipes.doc" for further instructions on how to use mod.recipes (They are
now in your home directory)

		-- Brian Reid
16415!mod.recipes!
echo extracting Novice.step3b
cat > Novice.step3b << '16415!mod.recipes!'

You're done. The programs are all installed. Go read the files "cookbook.doc"
and "recipes.doc" for instructions. Happy recipe collecting!

		-- Brian Reid
16415!mod.recipes!
echo extracting cookbook.doc
cat > cookbook.doc << '16415!mod.recipes!'



COOKBOOK(1)         UNIX Programmer's Manual          COOKBOOK(1)



NAME
     cookbook: rckeep, rcbook.t, rcbook.n, rctypeset, rcnroff -
     Store and print the mod.recipes USENET Cookbook

SYNOPSIS
     rckeep < /usr/spool/news/mod/recipes/?  (or s |rckeep from a
     news-reading program.)
     rcbook.t to typeset a cookbook from saved recipes
     rcbook.n to nroff a cookbook from saved recipes

DESCRIPTION
     The USENET Cookbook is an online database distributed in the
     mod.recipes newsgroup. This software makes it easy for you
     to clip recipes that interest you, to store them in your own
     directory, and to make printed cookbooks from those stored
     recipes.

SAVING RECIPES
     Read the news with your favorite news reading program. If
     you don't have a favorite, try rn. When you see a recipe
     that interests you, type
          s |rckeep
     The ``s'' command means ``save''; the vertical bar means
     ``save into a program''. rckeep is the program that keeps
     recipes. It will save recipes into a directory named
     Recipes, and it will create that directory for you if it
     does not currently exist. If you would like recipes saved in
     some other place, you can type
          s |rckeep PartyRecipes
          s |rckeep ~/PartyRecipes
          s |rckeep /usr/local/lib/Recipes
     and so forth.  From time to time, an entry will come through
     in mod.recipes that is labeled PATCH. This is not a recipe,
     but an update to a previously-posted recipe. If you use
     rckeep in the regular way, i.e. type s |rckeep, it will
     apply the patch(1) program to update your stored copy of the
     recipe.

HOW RECIPES ARE SAVED
     Every recipe is given a code word by the editor of
     mod.recipes. That code word is contained in the first few
     lines of the article body. The rckeep program uses the code
     word as a file name in your keep directory. For example, if
     you are saving a recipe whose 1-line description is
          PHEASANT-PERRY - Pheasant for Thanksgiving
     it will be saved in your keep directory under the filename
     ``pheasant-perry''.  These filenames are forced to lower
     case by rckeep.

MAKING A COOKBOOK
     To typeset a cookbook, just type
          rcbook.t



Printed 12/20/85            27 Nov 85                           1






COOKBOOK(1)         UNIX Programmer's Manual          COOKBOOK(1)



     and all of the recipes in your keep directory will be
     typeset in alphabetical order, with an index, introduction,
     and title page added. If you don't have a typesetter or if
     you don't have the troff(1) program, then use ``rcbook.n''
     instead; it uses nroff(1).

     If you have more than one keep directory, for specialty
     cookbooks of different types, you can give rcbook a direc-
     tory name as an argument, e.g.:
        rcbook.t /usr/local/lib/Recipes

FILES
     /usr/spool/news/mod/recipes   USENET recipe directory
     $HOME/Recipes                 Your keep directory (saved
     recipes)
     /mnt/reid/rc*                 The recipe software

SEE ALSO
     recipes(5), rn(1), patch(1),

AUTHOR
     Brian K. Reid, Stanford University

































Printed 12/20/85            27 Nov 85                           2



16415!mod.recipes!
echo extracting recipes.doc
cat > recipes.doc << '16415!mod.recipes!'



RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)



NAME
     recipes - USENET Cookbook (mod.recipes) format and submit-
     ting procedure.

SYNOPSIS
     Use the manual macros.  Mail your recipe to mod-
     recipes@glacier. Try not to plagiarize.

DESCRIPTION
     The way you submit to mod.recipes is to mail the recipe to
     the moderator. The moderator's mailbox is
          glacier!mod-recipes.UUCP,
     if you believe in that kind of address, or
          {hplabs, decwrl, bellcore, sun}!glacier!mod-recipes
     if you believe in the other kind of address. The addresses
          mod-recipes@Glacier.ARPA and  mod-
     recipes@Glacier.STANFORD.EDU
     also work, if you know how to mail to them.

     If your netnews administrator has set things up properly and
     if you are running the right news software, you can just
     post to mod.recipes as you would any other group, but your
     posting will be mailed to the moderator insted of being
     placed directly in the newsgroup.

HOW TO STRUCTURE A RECIPE
     Every recipe that goes out will be formatted with a small
     set of troff commands. If you don't know any troff, then
     just send the text of your recipe. If you can do the format-
     ting yourself, then great! That will save the editor a lot
     of time. Some hints for how to do it are in a later section
     of this documentation.  If you don't know about
     xroff/troff/nroff but you do want to be helpful, then you
     can help a lot by doing this:

     1    Put your recipe in the standard sequence:
               - Title and 1-line description
               - Introductory commentary, explaining (if possi-
               ble) where you got the recipe from.
               - list of ingredients, using "Tbsp.", "tsp.",
               "cup", "oz", and "lb",
               - Numbered sequence of recipe steps.
               - Notes (if any). Comments on how you like to make
               it, or ingredient availability, etc.
               - your signature file. I'll put as much of it as
               will fit into the outgoing recipe.

     2    Don't put any tab characters (^I) in the file. They
          confuse troff something terrible, and I'll just have to
          take them out.

     3    If you are a troff wizard, please don't use any of that



Printed 12/20/85            27 Nov 85                           1






RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)



          wizardry in these recipes. If you stick to the set of
          commands used in the Unix manual macros (see man(7)),
          and the set of commands that are part of the USENET
          Cookbook package (see following section), then things
          should work.

     You can also submit evaluations, modifications, suggestions,
     or bug-fixes to existing recipes.

COPYRIGHT NOTES
     It's important that you tell us where you got the recipe
     from. It's ok if you cribbed it from a book or magazine or
     newspaper, but if you copy exactly the words that you found
     there, there might be a problem with copyright violation.

     While the main purpose of the USENET cookbook is to let us
     all make our own custom cookbooks, we can't ignore the real-
     ity of the copyright law. Surely you have noticed that every
     modern book says ``No part of this publication may be repro-
     duced, stored in a retrieval system, or transmitted, in any
     form or by any means, electronic, ..., or otherwise without
     the prior written permission of the publisher.''

     Copyright law is complex, and only a lawyer can reliably
     advise you on whether or not you are violating it, but in
     general if you rewrite a recipe, in your own words, even if
     you don't change the recipe, then you are not infringing the
     copyright by submitting that recipe to the network. The
     copyright is on the words that explain the recipe, and not
     the recipe itself.

DO YOUR OWN FORMATTING
     If you put formatting commands in the recipes that you sub-
     mit, they will go out more quickly, since the editor won't
     have to do it.  It's easy to learn how.

     The basic principle is to use as few commands as possible,
     and in general to use only commands that are defined in the
     manual macros or the recipe macro package. Various process-
     ing programs search through these files and look for string
     matches on things like ".IG" and ".RZ".  Print out a few of
     the recipe source files from /usr/spool/news/mod/recipes,
     and then use /mnt/reid/rctypeset or OBJDIR/rcnroff to pro-
     duce formatted versions of them. Have that at hand when you
     are formatting your recipe. You can test your formatting by
     using rctypeset or rcnroff on your draft versions before you
     submit the recipe.

     A ``skeleton'' recipe follows. .RH is the recipe header com-
     mand; it must be the first line of each recipe and it must
     have 4 arguments. "RECIPE-ID" is the file name under which
     the recipe will be stored; it must be 14 characters or less.



Printed 12/20/85            27 Nov 85                           2






RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)



     The "?" is a "what kind of recipe" code from the code table
     below.
         .RH MOD.RECIPES-SOURCE RECIPE-ID ? "22 Dec 83"
         .RZ "RECIPE TITLE" "One-line description of it"
         Introductory comments; use .PP for new paragraph.
         .IH "Serves 13"               <-- Ingredients Header
         .IG "1/2 cup" "butter"        <-- Ingredient (please use quotes)
         .IG "1" "onion"
         (medium to large, chopped fine. Don't try to use instant onion
         in this recipe)
         .PH                           <-- Procedure header
         .SK 1                         <-- Procedure step
         Preheat oven to 600 degrees   <-- Text for that step
         .SK 2                         <-- and so forth.
         .NX                           <-- Notes header
         Notes (commentary) goes here; use .PP to separate paragraphs.
         .WR                           <-- Wrapup
         Signature information goes here.
         Remember that when you post to a moderated newsgroup, the news software
         usually forgets to include your .signature file, so you should be sure to
         include it manually. If it manages to get there twice, I will remove the
         extra copy.
     You can also use the following -man macros; see man(7) for
     the complete list.
         .I "italic words"
         .B "boldface words"
         .SM "small words"
         .PP                           <-- paragraph break
         .PD <distance>                <-- paragraph distance
         .IP "indented paragraph".
         .RS                           <-- relative start: move things to the right
         .RE                           <-- relative end: move things left again
     You can also use these nroff/troff commands: .if, .ds, .br,
     .nf, .fi, and .ta,

CATEGORY CODES
         M     Main dish           SL    Salad
         A     Appetizer or snack  SP    Soup
         B     Bread/cake/pasta    D     Dessert
         L     Beverage (Liquid)
     The suffix ``V'' on any category means that it is
     vegetarian; for example, a vegetarian main dish recipe would
     be marked ``MV''.

SEE ALSO
     cookbook(1), rn(1)









Printed 12/20/85            27 Nov 85                           3



16415!mod.recipes!
echo extracting cookbook.1.X
cat > cookbook.1.X << '16415!mod.recipes!'
.TH COOKBOOK 1 "27 Nov 85" "USENET Cookbook"
.SH NAME
cookbook: rckeep, rcbook.t, rcbook.n, rctypeset, rcnroff \- Store and print the mod.recipes USENET Cookbook
.SH SYNOPSIS
.B rckeep
<
NEWSDIR/mod/recipes/?
(or 
.B s\ |rckeep
from a news-reading program.)
.br
.B rcbook.t
to typeset a cookbook from saved recipes
.br
.B rcbook.n
to nroff a cookbook from saved recipes
.SH DESCRIPTION
The USENET Cookbook is an online database distributed in the 
.B mod.recipes
newsgroup. This software makes it easy for you to clip recipes that interest
you, to store them in your own directory, and to make printed cookbooks from
those stored recipes.
.SH SAVING RECIPES
.PP
Read the news with your favorite news reading program. If you don't have a
favorite, try 
.B rn.
When you see a recipe that interests you, type
.br
.B 	s |rckeep
.br
The ``s'' command means ``save''; the vertical bar means ``save into a
program''. 
.B rckeep
is the program that keeps recipes. It will save recipes into a directory
named Recipes, and it will create that directory for you if it does not
currently exist. If you would like recipes saved in some other place, you can
type
.br
.B 	s |rckeep PartyRecipes
.br
.B 	s |rckeep ~/PartyRecipes
.br
.B 	s |rckeep /usr/local/lib/Recipes
.br
and so forth.
From time to time, an entry will come through in mod.recipes that is labeled
PATCH. This is not a recipe, but an update to a previously-posted recipe. If
you use 
.B rckeep
in the regular way, i.e. type
.B s\ |rckeep,
it will apply the
.B patch(1)
program to update your stored copy of the recipe.
.SH HOW RECIPES ARE SAVED
Every recipe is given a code word by the editor of mod.recipes. That code
word is contained in the first few lines of the article body. The 
.B rckeep
program uses the code word as a file name in your keep directory. For
example, if you are saving a recipe whose 1-line description is
.br
.B 	PHEASANT-PERRY - Pheasant for Thanksgiving
.br
it will be saved in your keep directory under the filename ``pheasant-perry''.
These filenames are forced to lower case by
.B rckeep.
.SH MAKING A COOKBOOK

To typeset a cookbook, just type
.br
.B 	rcbook.t
.br
and all of the recipes in your keep directory will be typeset in alphabetical
order, with an index, introduction, and title page added. If you don't have a
typesetter or if you don't have the
.B troff(1)
program, then use ``\fBrcbook.n\fR'' instead; it uses 
.B nroff(1).
.PP
If you have more than one keep directory, for specialty cookbooks of
different types, you can give rcbook a directory name as an argument, e.g.:
.br
.B	rcbook.t /usr/local/lib/Recipes
.SH FILES
.ta 3i
NEWSDIR/mod/recipes	USENET recipe directory
.br
DEFDIR	Your keep directory (saved recipes)
.br
OBJDIR/rc*	The recipe software
.SH SEE ALSO
recipes(5), rn(1), patch(1), 
.SH AUTHOR
Brian K. Reid, Stanford University
16415!mod.recipes!
echo extracting rcbook.n.X
cat > rcbook.n.X << '16415!mod.recipes!'
#! /bin/sh
# rcbook.t - make a cookbook with nroff
#
# Brian Reid, November 1985
#
TROFF="nroff -man"
PATH=DEFPATH
export PATH
TMAC=/tmp/tmac.$$
INDEX=/tmp/Index.$$
trap "rm -f $TMAC $INDEX" 0 1 2 3 15
TFLAG=
while [ $# -gt 0 ];
do
    case $1 in
	    -t) TFLAG="$1";;
	    -*) echo $0: Unknown option $1 1>&2 ; exit;;
	    "") KEEPDIR=$HOME/Recipes;;
	    *) KEEPDIR=$1;;
    esac
    shift
done
if [ ! -d $KEEPDIR ]; then
	echo Your keep directory $KEEPDIR does not seem to exist. 1>&2
	exit 1
fi;
echo Formatting cookbook from files in $KEEPDIR 1>&2
cd $KEEPDIR
rcindex -t $KEEPDIR
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
set `date`
TODAY="$3 $2 $6"
sed -e "s/DATE/$TODAY/" > $INDEX << 'Index'
.RH MOD.RECIPES-SOURCE INDEX Recipes DATE 
.ll 6.5i
.nf
.br
.de XX
.tr ~ 
.ta 2.4iR 2.6i 5.3i
	\\$1~~~~~\\$2	\\$3 \\$4	\\$5
..
.so INDEX
Index
rcintro > Introduction
$TROFF $TFLAG $TMAC Introduction $INDEX [a-z]* > Cookbook.nr
echo Cookbook.nr created 1>&2
16415!mod.recipes!
echo extracting rcbook.t.X
cat > rcbook.t.X << '16415!mod.recipes!'
#! /bin/sh
# rcbook.t - make a cookbook for the typesetter
#
# Brian Reid, November 1985
#
TROFF="DEFTROFF"
PATH=DEFPATH
export PATH
TMAC=/tmp/tmac.$$
INDEX=/tmp/Index.$$
trap "rm -f $TMAC $INDEX" 0 1 2 3 15
TFLAG=
while [ $# -gt 0 ];
do
    case $1 in
	    -t) TFLAG="$1";;
	    -*) echo $0: Unknown option $1 1>&2 ; exit;;
	    "") KEEPDIR=$HOME/Recipes;;
	    *) KEEPDIR=$1;;
    esac
    shift
done
if [ ! -d $KEEPDIR ]; then
	echo Your keep directory $KEEPDIR does not seem to exist. 1>&2
	exit 1
fi;
echo Typesetting cookbook from files in $KEEPDIR 1>&2
cd $KEEPDIR
rcindex -t $KEEPDIR
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
set `date`
TODAY="$3 $2 $6"
sed -e "s/DATE/$TODAY/" > $INDEX << 'Index'
.RH MOD.RECIPES-SOURCE INDEX Recipes DATE 
.ll 6.5i
.nf
.br
.de XX
.tr ~ 
.ta 2.4iR 2.6i 5.3i
	\\$1~~~~~\\$2	\\$3 \\$4	\\$5
..
.so INDEX
Index
rcintro > Introduction
$TROFF $TFLAG $TMAC Introduction $INDEX [a-z]*
16415!mod.recipes!
echo extracting rcextract.X
cat > rcextract.X << '16415!mod.recipes!'
#! /bin/sh
# rcextract - extract article from mod.recipes
#
# This shell script extracts the portion of a mod.recipes
# article that is supposed to be fed into xroff. It strips off the
# article header and any signature, and sends the resulting text to stdout.
#
# Brian Reid, November 1985

PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
trap "rm -f $TMPFILE" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
awk -f $TMPFILE
16415!mod.recipes!
echo extracting rcindex.X
cat > rcindex.X << '16415!mod.recipes!'
#! /bin/sh
# rcindex - produce index of recipes
#
# usage:
#   rcindex  [ -options ] [ keepdir ]
#
# This shell script produces an index of all recipes in a keep directory.
# That index is an nroff/troff document that will be used as a part
# of the book produced from that directory.
#
# If you don't specify a keep directory, it will use DEFDIR, which
# is as good a place as any.
#
# Brian Reid, November 1985
#
PATH=DEFPATH
export PATH
case $1 in
	-*) OPTIONS=$1; shift;;
	*) OPTIONS=;;
esac
case $1 in
	"") KEEPDIR=DEFDIR;;
	*) KEEPDIR=$1;;
esac
if [ ! -d $KEEPDIR ]; then
	echo Your keep directory $KEEPDIR does not seem to exist.
	exit 1
fi;
cd $KEEPDIR
grep \^.RZ [a-z]* |\
  sed -e 's/\: *.RZ //' |\
  awk -F\" '{print $1,$4}' |\
  ptx -f -r $OPTIONS |\
  sed -e 's/^\.xx/.XX/' > INDEX
16415!mod.recipes!
echo extracting rcintro.X
cat > rcintro.X << '16415!mod.recipes!'
#! /bin/sh
cat << 'YumYumEatemup'
.RH MOD.RECIPES-SOURCE INTRODUCTION M "27 Nov 85"
.SH "\s16THE USENET COOKBOOK\s10"
USENET is the Unix community's communication network. It is used
for communicating all manner of information among Unix computer sites
worldwide. The USENET cookbook is a collection of recipes that were
contributed by USENET participants, transmitted electronically to the editor
in California, and then distributed via USENET to thousands of sites.
.PP
The USENET cookbook is a database and not just a book. The paper copy that you
are holding was printed from a copy of the online database at some USENET
site, but even as you are reading it, new recipes are being added to that
database, and perhaps old tired ones are being abandoned.
.PP
The USENET cookbook is distributed with software that enables every user to
make his own customized edition of it, leaving out the recipes that he has no
interest in, and perhaps adding a few of his own that he hasn't yet submitted
to the network. There will be hundreds, or even thousands, of different
versions and editions of it, all with the same title.
.SH THE EDITOR
The editor of the USENET cookbook is Brian Reid, of Stanford University. Like
the editor of any publication, he did not do a majority of the writing. He
has contributed a few of his own recipes, but his contribution is primarily
that he organized the cookbook venture, that he wrote the software that
publishes the cookbook from the online database, and he edits and takes final
responsibility for the appearance and content of recipes that are put into
the database. He does not test every recipe, though he is an experienced cook
and he reads them all carefully for problems.
.SH INGREDIENTS
The USENET cookbook is distributed in the newsgroup named ``mod.recipes''.
You will need to get that newsgroup at your site.
A package of software for dealing with mod.recipes, including troff macros,
extraction programs, indexing programs, and this introduction, is posted from
time to time into mod.recipes and net.sources. Get that software and install
it on your machine.
.SH PROCEDURE
To submit a recipe to the USENET cookbook, just mail its text to the
newsgroup moderator, glacier!mod-recipes by uucp or
mod-recipes@glacier.stanford.edu by internet. The netnews software on most
machines will do this automatically if you try to post to mod.recipes
.PP
You can also submit evaluations, modifications, suggestions, or bug-fixes to
existing recipes.
.SH NOTES
It's important that you tell us where you got the recipe from. It's ok if you
cribbed it from a book or magazine or newspaper, but if you copy exactly the
words that you found there, there might be a problem with copyright violation.
.PP
While the main purpose of the USENET cookbook is to let us all make our own
custom cookbooks, we can't ignore the reality of the copyright law. Surely
you have noticed that every modern book says ``\fINo part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form
or by any means, electronic, ..., or otherwise without the prior written
permission of the publisher.\fR''
.PP
Copyright law is complex, and only a lawyer
can reliably advise you on whether or not you are violating it, but in
general if you rewrite a recipe, in your own words, even if you don't change
the recipe, then you are not infringing the copyright by submitting that
recipe to the network. The copyright is on the words that explain the recipe,
and not the recipe itself.
.PP
.WR
Brian Reid, glacier!reid, reid@glacier.stanford.edu
Stanford University, Computer Systems Laboratory
'YumYumEatemup'
16415!mod.recipes!
echo extracting rckeep.X
cat > rckeep.X << '16415!mod.recipes!'
#! /bin/sh
# rckeep - keep a recipe by adding it to a keep directory
#
# usage:
#   rckeep [ keepdir ]  [ filename ]
#
# This program lets you snatch recipes out of newsgroups and store them in
# a "keep" directory. They are stored in a file name that matches the 
# recipe id, which is found in the .RH command in the recipe.
#
# If you don't specify a keep directory, it will use $HOME/Recipes, which
# is as good a place as any. You can use ~/ to stand for $HOME/ if you want.
#
# Brian Reid, November 1985
#
PATH=DEFPATH
export PATH
TEMPFILE=/tmp/rckeep.$$
case $1 in
	"") KEEPDIR=$HOME/Recipes;;
	~/*) KEEPDIR=$HOME/`expr $1 : '~/\(.*\)'`;;
	~*) echo Sorry, I cannot process ~ notation, except for ~/...;
	       exit 1;;
	*) KEEPDIR=$1;;
esac
if [ ! -d $KEEPDIR ]; then
	echo Creating new keep directory $KEEPDIR;
	mkdir $KEEPDIR;
fi;
case $2 in
	"") rcextract > $TEMPFILE;;
	*) rcextract < $2 > $TEMPFILE;;
esac
# the [A-Z] in tr arg below is for compatibility with SysV
IDLINE=`awk '{print $2,$3; exit;}' < $TEMPFILE | tr "[A-Z]" "[a-z]" `
case $IDLINE in
    "") echo This is not a mod.recipes datafile. I do not know what to do with it.
	exit 1;;
esac
set $IDLINE
KEEPNAME=$2
FILETYPE=$1
case $FILETYPE in
    mod.recipes-source) if [ -f $KEEPDIR/$KEEPNAME ]; then
	echo Overwriting previous version of `basename $KEEPNAME`
	fi
	mv $TEMPFILE $KEEPDIR/$KEEPNAME
	echo Saved as $KEEPDIR/$KEEPNAME;;
    mod.recipes-patch) if [ -f $KEEPDIR/$KEEPNAME ]; then
	echo Updating old version of $KEEPNAME
	patch -s $KEEPDIR/$KEEPNAME < $TEMPFILE
	    else
	echo Sorry, but the recipe $KEEPNAME is not there. I cannot patch it.
	fi;;
    *) echo This is not a mod.recipes datafile. I do not know what to do with it.;
       exit 1;;
esac
16415!mod.recipes!
echo extracting rcnroff.X
cat > rcnroff.X << '16415!mod.recipes!'
#! /bin/sh
# rcnroff - nroff a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and 
# nroffs that recipe to the standard output.
#
# Brian Reid, November 1985
#
TROFF="nroff -man"
PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC -
16415!mod.recipes!
echo extracting rcshow.X
cat > rcshow.X << '16415!mod.recipes!'
#! /bin/sh
# rcshow - show a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and 
# nroffs it for display on the screen. This differs slightly from "nrecipe"
# in that it is not page-oriented. Actually, this program is almost too slow
# to use, because it has to run nroff every time.
#
# Brian Reid, November 1985
#
# If you don't have "less", you will want to 
# add "ul" to the pipeline to get the underlines right.
TROFF="nroff -man"
PAGER="DEFPAGER"

PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC - | $PAGER
# if you don't have "less", you will probably want to change the above line
# into $TROFF $TMAC - | ul | $PAGER
16415!mod.recipes!
echo extracting rctypeset.X
cat > rctypeset.X << '16415!mod.recipes!'
#! /bin/sh
# rctypeset - typeset a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and 
# typesets it with troff. TRoff sends directly to the typesetter; if you
# don't have a typesetter, or have more than one, please consult your site
# administrators to find out what to do.
#
# Brian Reid, November 1985
#
TROFF="DEFTROFF"
PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC -
16415!mod.recipes!
echo extracting recipes.5.X
cat > recipes.5.X << '16415!mod.recipes!'
.TH RECIPES 5 "27 Nov 85" "USENET Cookbook"
.SH NAME
recipes \- USENET Cookbook (mod.recipes) format and submitting procedure.
.SH SYNOPSIS
Use the manual macros.
Mail your recipe to mod-recipes@glacier. Try not to plagiarize.
.SH DESCRIPTION
The way you submit to mod.recipes is to mail the recipe to the
moderator. The moderator's mailbox is
.br
	glacier!mod-recipes.UUCP,
.br
if you believe in that kind of address, or
.br
	{hplabs, decwrl, bellcore, sun}!glacier!mod-recipes
.br
if you believe in the other kind of address. The addresses
.br
	mod-recipes@Glacier.ARPA 
and	mod-recipes@Glacier.STANFORD.EDU
.br
also work, if you know how to mail to them.
.PP
If your netnews administrator has set things up properly and if you are
running the right news software, you can just post to mod.recipes as you
would any other group, but your posting will be mailed to the moderator
insted of being placed directly in the newsgroup.
.SH HOW TO STRUCTURE A RECIPE
Every recipe that goes out will be formatted with a small set of troff
commands. If you don't know any troff, then just send the text of your
recipe. If you can do the formatting yourself, then great! That will save 
the editor a lot of time. Some hints for how to do it are in a later section
of this documentation.
If you don't know about xroff/troff/nroff but you do want to be helpful,
then you can help a lot by doing this:
.PP
.IP 1 5
Put your recipe in the standard sequence:
.RS 10
- Title and 1-line description
.br
- Introductory commentary, explaining (if possible) where you got
the recipe from. 
.br
- list of ingredients, using "Tbsp.", "tsp.", "cup", "oz", and "lb",
.br
- Numbered sequence of recipe steps.
.br
- Notes (if any). Comments on how you like to make it, or ingredient
availability, etc.
.br
- your signature file. I'll put as much of it as will fit into
the outgoing recipe.
.RE
.IP 2 5
Don't put any tab characters (^I) in the file. They confuse troff
something terrible, and I'll just have to take them out.
.IP 3 5
If you are a troff wizard, please don't use any of that wizardry in these
recipes. If you stick to the set of commands used in the Unix manual macros
(see \fIman(7)\fR), and the set of commands that are part of the USENET
Cookbook package (see following section), then things should work.
.RE
.PP
You can also submit evaluations, modifications, suggestions, or bug-fixes to
existing recipes.
.SH COPYRIGHT NOTES
It's important that you tell us where you got the recipe from. It's ok if you
cribbed it from a book or magazine or newspaper, but if you copy exactly the
words that you found there, there might be a problem with copyright violation.
.PP
While the main purpose of the USENET cookbook is to let us all make our own
custom cookbooks, we can't ignore the reality of the copyright law. Surely
you have noticed that every modern book says ``\fINo part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form
or by any means, electronic, ..., or otherwise without the prior written
permission of the publisher.\fR''
.PP
Copyright law is complex, and only a lawyer
can reliably advise you on whether or not you are violating it, but in
general if you rewrite a recipe, in your own words, even if you don't change
the recipe, then you are not infringing the copyright by submitting that
recipe to the network. The copyright is on the words that explain the recipe,
and not the recipe itself.
.SH DO YOUR OWN FORMATTING
If you put formatting commands in the recipes that you submit, they will go
out more quickly, since the editor won't have to do it.
It's easy to learn how. 
.PP
The basic principle is to use as few commands as possible, and in general to
use only commands that are defined in the manual macros or the recipe macro
package. Various processing programs search through these files and look for
string matches on things like ".IG" and ".RZ".
Print out a few of the recipe source files from NEWSDIR/mod/recipes,
and then use OBJDIR/rctypeset or OBJDIR/rcnroff to produce 
formatted versions of them. Have that at hand when you are formatting
your recipe. You can test your formatting by using rctypeset or rcnroff on
your draft versions before you submit the recipe.
.PP
A ``skeleton'' recipe follows. .RH is the recipe header command; it must be
the first line of each recipe and it must have 4 arguments. 
"RECIPE-ID" is the file name under which the recipe will be stored; it must
be 14 characters or less. The "?" is a "what kind of recipe" code from the
code table below.
.nf
.ta 3i
.RS 4
\&.RH MOD.RECIPES-SOURCE RECIPE-ID ? "22 Dec 83" 
\&.RZ "RECIPE TITLE" "One-line description of it"
Introductory comments; use .PP for new paragraph.
\&.IH "Serves 13"	<-- Ingredients Header
\&.IG "1/2 cup" "butter"	<-- Ingredient (please use quotes)
\&.IG "1" "onion"
(medium to large, chopped fine. Don't try to use instant onion
in this recipe)
\&.PH	<-- Procedure header
\&.SK 1	<-- Procedure step
Preheat oven to 600 degrees	<-- Text for that step
\&.SK 2	<-- and so forth.
\&.NX	<-- Notes header
Notes (commentary) goes here; use .PP to separate paragraphs.
\&.WR	<-- Wrapup
Signature information goes here.
Remember that when you post to a moderated newsgroup, the news software
usually forgets to include your .signature file, so you should be sure to
include it manually. If it manages to get there twice, I will remove the
extra copy.
.RE 4
.fi
You can also use the following -man macros; see \fIman(7)\fR for the complete
list.
.nf
.RS 4
.ta 3i
\&.I "italic words"
\&.B "boldface words"
\&.SM "small words"
\&.PP	<-- paragraph break
\&.PD <distance>	<-- paragraph distance
\&.IP "indented paragraph".
\&.RS	<-- relative start: move things to the right
\&.RE	<-- relative end: move things left again
.RE 4
.fi
You can also use these nroff/troff commands:
\&.if, 
\&.ds,
\&.br,
\&.nf,
\&.fi,
and .ta,
.SH CATEGORY CODES
.nf
.ta .4i 1i 3i 3.6i
	M	Main dish	SL	Salad
	A	Appetizer or snack	SP	Soup
	B	Bread/cake/pasta	D	Dessert
	L	Beverage (Liquid)
.fi
The suffix ``V'' on any category means that it is vegetarian; for example, a
vegetarian main dish recipe would be marked ``MV''.
.SH SEE ALSO
cookbook(1), rn(1)
16415!mod.recipes!
echo extracting configure.sh
cat > configure.sh << '16415!mod.recipes!'
#! /bin/sh 
# Script to configure and install the other shell scripts for mod.recipes.
#	Brian Reid, December 1985
#
OBJDIR="$1"
NEWSDIR="$2"
DEFDIR="$3"
DEFPATH="$4"
DEFTROFF="$5"
DEFPAGER="$6"
# make rcbook.n.X from rcbook.t.X
sed -e "s+DEFTROFF+nroff -man+" \
    -e "s+for the typesetter+with nroff+" \
    -e "s+Typesetting+Formatting+" \
    -e '/^\$TROFF/s+$+ > Cookbook.nr+' \
    -e '/^\$TROFF/a\
echo Cookbook.nr created 1>&2' \
    < rcbook.t.X > rcbook.n.X

# now configure the executable programs
for i in *.X
do
    j=`basename $i .X`
    echo Processing $i into $j
    sed -e "s+OBJDIR+$OBJDIR+" \
        -e "s+NEWSDIR+$NEWSDIR+" \
	-e "s+DEFDIR+$DEFDIR+" \
	-e "s+DEFPATH+$DEFPATH+" \
	-e "s+DEFPAGER+$DEFPAGER+" \
	-e '/^TMAC.RECIP$/r tmac.recip' \
	-e '/^TMAC.RECIP$/d' \
	-e "s+DEFTROFF+$DEFTROFF+" < $i > $j
    chmod 755 $j
done
16415!mod.recipes!
echo extracting tmac.recip
cat > tmac.recip << '16415!mod.recipes!'
'	# Recipe Heading
.de RH
.TH \\$2 "\\$3" "\\$4" "mod.recipes" "USENET Cookbook"
.ds ]H \\$2
..
.de RZ
.SH \\s14\\$1
\\*(]H \- \\$2
.PP
..
' 	# Ingredient
.de IG
.TP 10
\&\\$1
.I \\$2
..
'	# Step
.de SK
.IP "(\\$1)" 5n
..
'	# Ingredient header
.de IH
.SH INGREDIENTS (\\$1)
.PD 0
..
'	# Procedure header
.de PH
.PD
.SH PROCEDURE
.RS 5
..
'	# Notes
.de NX
.PD
.SH NOTES
..
'	# Wrapup
.de WR
.RE 5
.PD
.SH CONTRIBUTOR
.nf
..
.\" these macros courtesy of Bernie Cosell and Matt Bishop
.de CS  \" do the fancy "go into cs mode right" guy
.   ie \\n(.z .cs \\$1 \\$2 \\$3
.   el              \!.CS \\$1 \\$2 \\$3
..
.
.de FW \" Go into fixed-width mode: put both italic and bold fonts in it
.   CS B 21 \\(.s
.   CS I 21 \\(.s
.   ss 24
.   lg 0
..
.
.de Fw \" Leave fixed-width mode
.   CS B
.   CS I
.   ss 12
.   lg 1
..
16415!mod.recipes!
-- 
	Brian Reid	decwrl!glacier!reid
	Stanford	reid@SU-Glacier.ARPA

reid@glacier.ARPA (Brian Reid) (01/21/86)

Here is the software, and the man pages, for mod.recipes. If you have
installed an earlier version of this software there is no need to update,
though there have been some minor changes to software and to documentation.

If you are not a programmer and cannot enlist the help of a programmer, then
read the file "Novice" after you unpack this file. You should be able to get
the software installed without any help from anyone, even if you have no
system privileges.

        Brian Reid      decwrl!glacier!reid
        Stanford        reid@SU-Glacier.ARPA


#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Unpack the file by typing "sh filename", where "filename" is the
#    name of your file. It will create these files in your current
#    directory:
#        README
#        Makefile.bsd
#        Makefile.sysv
#        Novice
#        Novice.install
#        Novice.makefile
#        Novice.start
#        Novice.step1
#        Novice.step2
#        Novice.step3a
#        Novice.step3b
#        cookbook.doc
#        recipes.doc
#        cookbook.1.X
#        rcbook.t.X
#        rcextract.X
#        rcindex.X
#        rcintro.X
#        rckeep.X
#        rcnroff.X
#        rcshow.X
#        rctypeset.X
#        recipes.5.X
#        configure.sh
#        tmac.recip
     
echo extracting README
cat > README << '7536!mod.recipes!'
This is the directory of programs that work with mod.recipes files, to make
the USENET cookbook.

If you are not a programmer, but want to use this software, and can't enlist
the help of a programmer, please read the file Novice. It contains simplified
instructions, and can lead you through the installation procedure even if you
have never installed software before.

To install the recipe software at your site, copy either Makefile.bsd or
Makefile.sysv over to be named "Makefile", then edit it per the instructions
in the beginning.

If you have the "less" program, you will probably want to use it instead of
"more". You may find that the best version of troff at your site is called
"ptroff" or "dtroff" or "itroff" or "qtroff" or whatever--the first letter
tends to correspond to the manufacturer of the machine for which that troff
is targeted. I have never used "ditroff", and I don't know if these macros
will work with it or not. I kind of doubt it.

Once you have edited your Makefile, type
        make configure
This will produce configured executable versions of the cookbook software in
your current directory. Once you have satisfied yourself that it is not a
trojan horse, type
        make install
which will copy the executable programs to the directory you have chosen for
them (we put them in /usr/local/bin) and copy the manual pages to
/usr/man/man1 and /usr/man/man5. You needn't be root to install, you only
need to be a user who has write permission in the bin and man directories.

Once you've done that, go read the man pages, then go play with "rn" and have
fun printing cookbooks. This will also work with readnews; I don't know from
notesfiles, and I have never tried it with vnews or yarn or any of those
other programs.

Here are the program names and what they do:

rcbook.n        make a cookbook with nroff
rcbook.t        make a cookbook with troff
rcextract       extract a recipe from a news article (called by rctypeset)
rcindex         produce an index of saved recipes (called by rcbook)
rcintro         generate the introduction to the cookbook (called by rcbook)
rckeep          keep a recipe
rcnroff         run one recipe through nroff
rcshow          show one recipe on the screen
rctypeset       run one recipe through troff

        Brian Reid      {sun,decwrl,hplabs}!glacier!reid
        Stanford        reid@SU-Glacier.ARPA
                        reid@Glacier.stanford.edu
7536!mod.recipes!
echo extracting Makefile.bsd
cat > Makefile.bsd << '7536!mod.recipes!'
# mod.recipes software Makefile. To install, edit the following variables,
# then type "make install"
#
# Where are the object files for the recipe software kept?
OBJDIR=/usr/local/bin

# Where is the news spooling directory?
NEWSDIR=/usr/spool/news

# What is the default "keep" directory. If you want a per-person keep
# directory, put $$HOME/something; if you want a systemwide keep directory
# (to save disk space), then put an absolute pathname here.
DEFDIR=$$HOME/Recipes

# What PATH do you want used inside the shell scripts? At the very least,
# it must contain $OBJDIR
DEFPATH=:$(OBJDIR):/usr/ucb:/usr/bin:/bin:

# What version of TRoff works best at your site, and with what options does it
# do its best job on the Unix manual pages macros?
DEFTROFF=troff -man

# What is your favorite pager and what are its options?
DEFPAGER=more -s
############################################################################

OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
        rcintro

configure: Makefile
        sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
                '$(DEFTROFF)' '$(DEFPAGER)'

install:
        cp $(OBJECTS) $(OBJDIR)
        cp cookbook.1 /usr/man/man1
        cp recipes.5 /usr/man/man5
7536!mod.recipes!
echo extracting Makefile.sysv
cat > Makefile.sysv << '7536!mod.recipes!'
# mod.recipes software Makefile. To install, edit the following variables,
# then type "make install"
#
# Where are the object files for the recipe software kept?
OBJDIR=/usr/local/bin

# Where is the news spooling directory?
NEWSDIR=/usr/spool/news

# What is the default "keep" directory. If you want a per-person keep
# directory, put $$HOME/something; if you want a systemwide keep directory
# (to save disk space), then put an absolute pathname here.
DEFDIR=$$HOME/Recipes

# What PATH do you want used inside the shell scripts? At the very least,
# it must contain $OBJDIR
DEFPATH=:$(OBJDIR):/usr/bin:/bin:

# What version of TRoff works best at your site, and with what options does it
# do its best job on the Unix manual pages macros?
DEFTROFF=troff -man

# What is your favorite pager and what are its options?
DEFPAGER=pg
############################################################################

OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
        rcintro

configure: Makefile
        sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
                '$(DEFTROFF)' '$(DEFPAGER)'

install:
        cp $(OBJECTS) $(OBJDIR)
        cp cookbook.1 /usr/man/man1
        cp recipes.5 /usr/man/man5
7536!mod.recipes!
echo extracting Novice
cat > Novice << '7536!mod.recipes!'
This file is for people who know how to cook but who don't know how to
program, and who find that they are unable to get the help of a programmer in
getting the mod.recipes software installed.

The novice installation is set up as a series of steps; at the end of each
you will be told what to do next.

To begin, type this command:
        Novice.start
Make sure you put the capital N at the beginning of it. If it doesn't work,
try typing this command:
        chmod 755 Novice.*
and then try
        Novice.start
a second time. If it still doesn't work, then you gotta get help.
7536!mod.recipes!
echo extracting Novice.install
cat > Novice.install << '7536!mod.recipes!'
#! /bin/sh
# This program is part of the novice mod.recipes installation procedure.
# Please read the file "Novice".
trap "rm -f mod.rec.$$" 0 1 2 3 15
echo $$ > mod.rec.$$
if test -f $HOME/mod.rec.$$
then
    cat Novice.step3a
else
    echo Installing ...
    cp $*
    cat Novice.step3b
fi
7536!mod.recipes!
echo extracting Novice.makefile
cat > Novice.makefile << '7536!mod.recipes!'
### This file is used as part of the Novice installation procedure. Please
### read file "Novice".
##=
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# (1) Where is the news spooling directory? If you don't have any idea, then
# leave this line alone--this is the best guess. If you get this wrong,
# all of the programs will still work, though they may give strange error
# messages at times.

NEWSDIR=/usr/spool/news

# (2) What version of troff works best at your site? Change the word "troff"
# to the name of your version, if it is different.
#
# If you don't know, then try one of these guesses:
# If you have an Apple LaserWriter, your best guess is "ptroff"
# If you have an Imagen printer, your best guess is "itroff"
# If you have a QMS or Talaris printer, your best guess is "qtroff"
# Otherwise try just "troff", or ask for help.
# If you get this wrong, you will be able to save recipes but you won't be
# able to typeset them or print them out.

MYTROFF=troff

# (3) What is your favorite pager and what are its options? If you don't have
# any idea, then leave this line alone. If you have a "pg" program, then edit
# the word "cat" into "pg" below. If you have a "more" program, then edit the
# word "cat" into "more". Even if you get this completely wrong, almost
# everything will still work.

DEFPAGER=cat

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# You should not have to change anything below this line.

DEFTROFF=$(MYTROFF) -man
DEFDIR=$$HOME/Recipes
OBJDIR=$$HOME
DEFPATH=:$(OBJDIR):XXDEFPATH
OBJECTS=rcbook.t rcbook.n rcextract rcindex rckeep rcnroff rcshow rctypeset \
        rcintro

configure: Makefile
        @sh configure.sh $(OBJDIR) $(NEWSDIR) '$(DEFDIR)' $(DEFPATH) \
                '$(DEFTROFF)' '$(DEFPAGER)'
        @cat Novice.step2

install:
        @Novice.install $(OBJECTS) $(OBJDIR)
7536!mod.recipes!
echo extracting Novice.start
cat > Novice.start << '7536!mod.recipes!'
#! /bin/sh
# This script is used to begin the Novice installation procedure. Please read
# file "Novice" for instructions. Pay no attention to the man behind the
# curtain.
#
###########################################################################
sed -e "s|XXDEFPATH|$PATH|" \
    -e "/###/d" \
    -e '/##=/a\
# This version of the mod.recipes Makefile is for people who are not really\
# programmers, and who cannot get other help. Edit the file to answer the 3\
# questions  below, and then type "make configure".\
' -e '/##=/d' Novice.makefile > Makefile
cat Novice.step1
7536!mod.recipes!
echo extracting Novice.step1
cat > Novice.step1 << '7536!mod.recipes!'

OK, your Makefile is now created. Using your favorite text editor, edit it to
try to answer the 3 questions at the beginning. If you can't answer them,
don't give up--the system will still work to a certain extent without the
answers.

Once you have finished editing the Makefile, type this:

        make configure
7536!mod.recipes!
echo extracting Novice.step2
cat > Novice.step2 << '7536!mod.recipes!'

OK, the mod.recipe software and documentation are now all "configured". That
means that they have been updated to reflect the details of your installation.
What you need to do next is to "install" them, which means to copy them to
your home directory where you can execute them while reading news. To do
that, type this:

        make install
7536!mod.recipes!
echo extracting Novice.step3a
cat > Novice.step3a << '7536!mod.recipes!'

Because you have been working in your home directory, the software is already
installed there. We're done! Go read the files "cookbook.doc" and
"recipes.doc" for further instructions on how to use mod.recipes (They are
now in your home directory)

                -- Brian Reid
7536!mod.recipes!
echo extracting Novice.step3b
cat > Novice.step3b << '7536!mod.recipes!'

You're done. The programs are all installed. Go read the files "cookbook.doc"
and "recipes.doc" for instructions. Happy recipe collecting!

                -- Brian Reid
7536!mod.recipes!
echo extracting cookbook.doc
cat > cookbook.doc << '7536!mod.recipes!'


     
COOKBOOK(1)         UNIX Programmer's Manual          COOKBOOK(1)


     
NAME
     cookbook: rckeep, rcbook.t, rcbook.n, rctypeset, rcnroff -
     Store and print the mod.recipes USENET Cookbook

SYNOPSIS
     rckeep < /usr/spool/news/mod/recipes/?  (or s |rckeep from a
     news-reading program.)
     rcbook.t to typeset a cookbook from saved recipes
     rcbook.n to nroff a cookbook from saved recipes

DESCRIPTION
     The USENET Cookbook is an online database distributed in the
     mod.recipes newsgroup. This software makes it easy for you
     to clip recipes that interest you, to store them in your own
     directory, and to make printed cookbooks from those stored
     recipes.

SAVING RECIPES
     Read the news with your favorite news reading program. If
     you don't have a favorite, try rn. When you see a recipe
     that interests you, type
          s |rckeep
     The ``s'' command means ``save''; the vertical bar means
     ``save into a program''. rckeep is the program that keeps
     recipes. It will save recipes into a directory named
     Recipes, and it will create that directory for you if it
     does not currently exist. If you would like recipes saved in
     some other place, you can type
          s |rckeep PartyRecipes
          s |rckeep ~/PartyRecipes
          s |rckeep /usr/local/lib/Recipes
     and so forth.  From time to time, an entry will come through
     in mod.recipes that is labeled PATCH. This is not a recipe,
     but an update to a previously-posted recipe. If you use
     rckeep in the regular way, i.e. type s |rckeep, it will
     apply the patch(1) program to update your stored copy of the
     recipe.

HOW RECIPES ARE SAVED
     Every recipe is given a code word by the editor of
     mod.recipes. That code word is contained in the first few
     lines of the article body. The rckeep program uses the code
     word as a file name in your keep directory. For example, if
     you are saving a recipe whose 1-line description is
          PHEASANT-PERRY - Pheasant for Thanksgiving
     it will be saved in your keep directory under the filename
     ``pheasant-perry''.  These filenames are forced to lower
     case by rckeep.

MAKING A COOKBOOK
     To typeset a cookbook, just type
          rcbook.t


     
Printed 1/20/86             27 Nov 85                           1


     


     
COOKBOOK(1)         UNIX Programmer's Manual          COOKBOOK(1)


     
     and all of the recipes in your keep directory will be
     typeset in alphabetical order, with an index, introduction,
     and title page added. If you don't have a typesetter or if
     you don't have the troff(1) program, then use ``rcbook.n''
     instead; it uses nroff(1).

     If you have more than one keep directory, for specialty
     cookbooks of different types, you can give rcbook a direc-
     tory name as an argument, e.g.:
        rcbook.t /usr/local/lib/Recipes

COPYRIGHT
     The entire USENET cookbook is copyrighted by the USENET
     Recipe Trust. The purpose of this copyright is to prevent
     commercial use of the material. The USENET Recipe Trust per-
     mits any noncommercial use of the contents of the recipe
     database, and forbids any commercial use.

FILES
     /usr/spool/news/mod/recipes   USENET recipe directory
     $HOME/Recipes                 Your keep directory (saved
     recipes)
     /usr/stanford/bin/rc*         The recipe software

SEE ALSO
     recipes(5), rn(1), patch(1),

AUTHOR
     Brian K. Reid, Stanford University


     


     


     


     


     


     


     


     


Printed 1/20/86             27 Nov 85                           2


     
7536!mod.recipes!
echo extracting recipes.doc
cat > recipes.doc << '7536!mod.recipes!'


     
RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)


     
NAME
     recipes - USENET Cookbook (mod.recipes) format and submit-
     ting procedure.

SYNOPSIS
     Mail your recipe to mod-recipes@glacier. Try not to plagiar-
     ize.  If you want to put in your own troff commands, use the
     manual macros.

DESCRIPTION
     The way you submit to mod.recipes is to mail the recipe to
     the moderator. The moderator's mailbox is
          glacier!mod-recipes,
     if you believe in that kind of address, or
          {hplabs, decwrl, bellcore, pyramid, sun}!glacier!mod-
     recipes
     if you believe in the other kind of address. The addresses
          mod-recipes@SU-Glacier.ARPA and  mod-
     recipes@Glacier.STANFORD.EDU
     also work, if you know how to mail to them.

     If your netnews administrator has set things up properly and
     if you are running the right news software, you can just
     post to mod.recipes as you would any other group, but your
     posting will be mailed to the moderator insted of being
     placed directly in the newsgroup.

HOW TO STRUCTURE A RECIPE
     Every recipe that goes out will be formatted with a small
     set of troff commands. If you don't know any troff, then
     just send the text of your recipe. If you can do the format-
     ting yourself, then great! That will save the editor a lot
     of time. Some hints for how to do it are in a later section
     of this documentation.  If you don't know about
     xroff/troff/nroff but you do want to be helpful, then you
     can help a lot by doing this:

     1    Put your recipe in the standard sequence:
               - Title and 1-line description
               - Introductory commentary, explaining (if possi-
               ble) where you got the recipe from.
               - list of ingredients, using "Tbsp.", "tsp.",
               "cup", "oz", and "lb",
               - Numbered sequence of recipe steps.
               - Notes (if any). Comments on how you like to make
               it, or ingredient availability, etc.
               Your ``signature''. This should include your name
               and net address, the organization that you are a
               part of, and the name of the city it is in. It can
               also include other frivolity or foolishness if you
               like; I'll include as much of it as will fit on
               the page.


     
Printed 1/20/86             27 Nov 85                           1


     


     
RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)


     
     2    Don't put any tab characters (^I) in the file if you
          can possibly avoid it.  They do strange things on
          typesetters.

     3    If you are a troff wizard, please don't use any of that
          wizardry in these recipes. If you stick to the set of
          commands used in the Unix manual macros (see man(7)),
          and the set of commands that are part of the USENET
          Cookbook package (see following section), then things
          should work.

     You can also submit evaluations, modifications, suggestions,
     or bug-fixes to existing recipes.

COPYRIGHT NOTES
     It's important that you tell us where you got the recipe
     from. It's ok if you cribbed it from a book or magazine or
     newspaper, but if you copy exactly the words that you found
     there, there might be a problem with copyright violation.

     While the main purpose of the USENET cookbook is to let us
     all make our own custom cookbooks, we can't ignore the real-
     ity of the copyright law. Surely you have noticed that every
     modern book says ``No part of this publication may be repro-
     duced, stored in a retrieval system, or transmitted, in any
     form or by any means, electronic, ..., or otherwise without
     the prior written permission of the publisher.''

     Copyright law is complex, and only a lawyer can reliably
     advise you on whether or not you are violating it, but in
     general if you rewrite a recipe, in your own words, even if
     you don't change the recipe, then you are not infringing the
     copyright by submitting that recipe to the network. The
     copyright is on the words that explain the recipe, and not
     the recipe itself.

     That's the letter of the law. The reality of it seems to be
     that recipes, like jokes, are almost always stolen rather
     than invented. Nearly every cookbook I have ever seen con-
     tains recipes that were stolen from some other cookbook, and
     I have never seen an instance of anybody being prosecuted
     for it.

DO YOUR OWN FORMATTING
     If you put formatting commands in the recipes that you sub-
     mit, they will go out more quickly, since the editor won't
     have to do it.  It's easy to learn how.

     The basic principle is to use as few commands as possible,
     and in general to use only commands that are defined in the
     manual macros or the recipe macro package. Various process-
     ing programs search through these files and look for string


     
Printed 1/20/86             27 Nov 85                           2


     


     
RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)


     
     matches on things like ".IG" and ".RZ".  Print out a few of
     the recipe source files from /usr/spool/news/mod/recipes,
     and then use /usr/stanford/bin/rctypeset or
     /usr/stanford/bin/rcnroff to produce formatted versions of
     them. Have that at hand when you are formatting your recipe.
     You can test your formatting by using rctypeset or rcnroff
     on your draft versions before you submit the recipe.

     A ``skeleton'' recipe follows. .RH is the recipe header com-
     mand; it must be the first line of each recipe and it must
     have 4 arguments. "RECIPE-ID" is the file name under which
     the recipe will be stored; it must be 14 characters or less.
     The "?" is a "what kind of recipe" code from the code table
     below.
         .RH MOD.RECIPES-SOURCE RECIPE-ID ? "22 Dec 83"
         .RZ "RECIPE TITLE" "One-line description of it"
         Introductory comments; use .PP for new paragraph.
         .IH "Serves 13"               <-- Ingredients Header
         .IG "1/2 cup" "butter"        <-- Ingredient (please use quotes)
         .IG "1" "onion"
         (medium to large, chopped fine. Don't try to use instant onion
         in this recipe)
         .PH                           <-- Procedure header
         .SK 1                         <-- Procedure step
         Preheat oven to 600 degrees   <-- Text for that step
         .SK 2                         <-- and so forth.
         .NX                           <-- Notes header
         Notes (commentary) goes here; use .PP to separate paragraphs.
         .WR                           <-- Wrapup
         Signature information goes here. As a minimum you should list your name,
         network address, organization (company, university, etc.), and the city you
         live or work in.
     Remember that when you post to a moderated newsgroup, the
     news software usually forgets to include your .signature
     file, so you should be sure to include it manually. If it
     manages to get there twice, I will remove the extra copy.

     You can also use the following -man macros; see man(7) for
     the complete list.
         .I "italic words"
         .B "boldface words"
         .SM "small words"
         .PP                           <-- paragraph break
         .PD <distance>                <-- paragraph distance
         .IP "indented paragraph".
         .RS                           <-- relative start: move things to the right
         .RE                           <-- relative end: move things left again
     You can also use these nroff/troff commands: \fI, \fB, \fR,
     .if, .ds, .br, .nf, .fi, and .ta,

CATEGORY CODES
         M     Main dish           SL    Salad


     
Printed 1/20/86             27 Nov 85                           3


     


     
RECIPES(5)          UNIX Programmer's Manual           RECIPES(5)


     
         A     Appetizer or snack  SP    Soup
         B     Bread/cake/pasta    D     Dessert
         L     Beverage (Liquid)   V     Vegetable dish
     The suffix ``V'' on any category means that it is
     vegetarian; for example, a vegetarian main dish recipe would
     be marked ``MV''.

SEE ALSO
     cookbook(1), rn(1)

AUTHOR
     Brian Reid is the organizer of mod.recipes and the author of
     most of the software.


     


     


     


     


     


     


     


     


     


     


     


     


     


     
Printed 1/20/86             27 Nov 85                           4


     
7536!mod.recipes!
echo extracting cookbook.1.X
cat > cookbook.1.X << '7536!mod.recipes!'
.TH COOKBOOK 1 "27 Nov 85" "USENET Cookbook"
.SH NAME
cookbook: rckeep, rcbook.t, rcbook.n, rctypeset, rcnroff \- Store and print the mod.recipes USENET Cookbook
.SH SYNOPSIS
.B rckeep
<
NEWSDIR/mod/recipes/?
(or
.B s\ |rckeep
from a news-reading program.)
.br
.B rcbook.t
to typeset a cookbook from saved recipes
.br
.B rcbook.n
to nroff a cookbook from saved recipes
.SH DESCRIPTION
The USENET Cookbook is an online database distributed in the
.B mod.recipes
newsgroup. This software makes it easy for you to clip recipes that interest
you, to store them in your own directory, and to make printed cookbooks from
those stored recipes.
.SH SAVING RECIPES
.PP
Read the news with your favorite news reading program. If you don't have a
favorite, try
.B rn.
When you see a recipe that interests you, type
.br
.B      s |rckeep
.br
The ``s'' command means ``save''; the vertical bar means ``save into a
program''.
.B rckeep
is the program that keeps recipes. It will save recipes into a directory
named Recipes, and it will create that directory for you if it does not
currently exist. If you would like recipes saved in some other place, you can
type
.br
.B      s |rckeep PartyRecipes
.br
.B      s |rckeep ~/PartyRecipes
.br
.B      s |rckeep /usr/local/lib/Recipes
.br
and so forth.
From time to time, an entry will come through in mod.recipes that is labeled
PATCH. This is not a recipe, but an update to a previously-posted recipe. If
you use
.B rckeep
in the regular way, i.e. type
.B s\ |rckeep,
it will apply the
.B patch(1)
program to update your stored copy of the recipe.
.SH HOW RECIPES ARE SAVED
Every recipe is given a code word by the editor of mod.recipes. That code
word is contained in the first few lines of the article body. The
.B rckeep
program uses the code word as a file name in your keep directory. For
example, if you are saving a recipe whose 1-line description is
.br
.B      PHEASANT-PERRY - Pheasant for Thanksgiving
.br
it will be saved in your keep directory under the filename ``pheasant-perry''.
These filenames are forced to lower case by
.B rckeep.
.SH MAKING A COOKBOOK

To typeset a cookbook, just type
.br
.B      rcbook.t
.br
and all of the recipes in your keep directory will be typeset in alphabetical
order, with an index, introduction, and title page added. If you don't have a
typesetter or if you don't have the
.B troff(1)
program, then use ``\fBrcbook.n\fR'' instead; it uses
.B nroff(1).
.PP
If you have more than one keep directory, for specialty cookbooks of
different types, you can give rcbook a directory name as an argument, e.g.:
.br
.B      rcbook.t /usr/local/lib/Recipes
.SH COPYRIGHT
The entire USENET cookbook is copyrighted by the USENET Recipe Trust. The
purpose of this copyright is to prevent commercial use of the material. The
USENET Recipe Trust permits any noncommercial use of the contents of the
recipe database, and forbids any commercial use.
.SH FILES
.ta 3i
NEWSDIR/mod/recipes     USENET recipe directory
.br
DEFDIR  Your keep directory (saved recipes)
.br
OBJDIR/rc*      The recipe software
.SH SEE ALSO
recipes(5), rn(1), patch(1),
.SH AUTHOR
Brian K. Reid, Stanford University
7536!mod.recipes!
echo extracting rcbook.t.X
cat > rcbook.t.X << '7536!mod.recipes!'
#! /bin/sh
# rcbook.t - make a cookbook for the typesetter
#
# Brian Reid, November 1985
#
TROFF="DEFTROFF"
PATH=DEFPATH
export PATH
TMAC=/tmp/tmac.$$
INDEX=/tmp/Index.$$
trap "rm -f $TMAC $INDEX" 0 1 2 3 15
TFLAG=
KEEPDIR=DEFDIR
while [ $# -gt 0 ];
do
    case $1 in
            -t) TFLAG="$1";;
            -*) echo $0: Unknown option $1 1>&2 ; exit;;
            "") KEEPDIR=DEFDIR;;
            *) KEEPDIR=$1;;
    esac
    shift
done
if [ ! -d $KEEPDIR ]; then
        echo Your keep directory $KEEPDIR does not seem to exist. 1>&2
        exit 1
fi;
echo Typesetting cookbook from files in $KEEPDIR 1>&2
cd $KEEPDIR
rcindex -t $KEEPDIR
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
set `date`
TODAY="$3 $2 $6"
sed -e "s/DATE/$TODAY/" > $INDEX << 'Index'
.RH MOD.RECIPES-SOURCE INDEX Recipes DATE
.ll 6.5i
.nf
.br
.de XX
.tr ~
.ta 2.4iR 2.6i 5.3i
        \\$1~~~~~\\$2   \\$3 \\$4       \\$5
..
.so INDEX
Index
rcintro > Introduction
$TROFF $TFLAG $TMAC Introduction $INDEX [a-z]*
7536!mod.recipes!
echo extracting rcextract.X
cat > rcextract.X << '7536!mod.recipes!'
#! /bin/sh
# rcextract - extract article from mod.recipes
#
# This shell script extracts the portion of a mod.recipes
# article that is supposed to be fed into xroff. It strips off the
# article header and any signature, and sends the resulting text to stdout.
#
# Brian Reid, November 1985

PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
trap "rm -f $TMPFILE" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
awk -f $TMPFILE
7536!mod.recipes!
echo extracting rcindex.X
cat > rcindex.X << '7536!mod.recipes!'
#! /bin/sh
# rcindex - produce index of recipes
#
# usage:
#   rcindex  [ -options ] [ keepdir ]
#
# This shell script produces an index of all recipes in a keep directory.
# That index is an nroff/troff document that will be used as a part
# of the book produced from that directory.
#
# If you don't specify a keep directory, it will use DEFDIR, which
# is as good a place as any.
#
# Brian Reid, November 1985
#
PATH=DEFPATH
export PATH
case $1 in
        -*) OPTIONS=$1; shift;;
        *) OPTIONS=;;
esac
case $1 in
        "") KEEPDIR=DEFDIR;;
        *) KEEPDIR=$1;;
esac
if [ ! -d $KEEPDIR ]; then
        echo Your keep directory $KEEPDIR does not seem to exist.
        exit 1
fi;
cd $KEEPDIR
grep \^.RZ [a-z]* |\
  sed -e 's/\: *.RZ //' |\
  awk -F\" '{print $1,$4}' |\
  ptx -f -r $OPTIONS |\
  sed -e 's/^\.xx/.XX/' > INDEX
7536!mod.recipes!
echo extracting rcintro.X
cat > rcintro.X << '7536!mod.recipes!'
#! /bin/sh
cat << 'YumYumEatemup'
.RH MOD.RECIPES-SOURCE INTRODUCTION M "Copyright \(co 1986 USENET Recipe Trust"
.SH "\s16THE USENET COOKBOOK\s10"
USENET is the Unix community's communication network. It is used
for communicating all manner of information among Unix computer sites
worldwide. The USENET cookbook is a collection of recipes that were
contributed by USENET participants, transmitted electronically to the editor
in California, and then published via USENET.
.PP
The USENET cookbook is a database and not just a book. The paper copy that you
are holding was printed from a copy of the online database at some USENET
site, but even as you are reading it, new recipes are being added to that
database, and perhaps old tired ones are being abandoned or rewritten.
.PP
The USENET cookbook is distributed with software that enables every user to
make his own personal customized edition of it, leaving out the recipes that
he has no interest in, and perhaps adding a few of his own that he hasn't
yet submitted to the network. There will be hundreds, or even thousands, of
different versions and editions of it, all with the same title, and all
copyrighted.
.SH THE EDITOR
The editor of the USENET cookbook is Brian Reid, of Stanford University. Like
the editor of any publication, he did not do a majority of the writing. He
has contributed a few of his own recipes, but his contribution is primarily
that he organized the cookbook venture, that he wrote the software that
publishes the cookbook from the online database, and he edits and takes final
responsibility for the appearance and content of recipes that are put into
the database. He does not test every recipe, though he is an experienced cook
and he reads them all carefully for problems.
.SH INGREDIENTS
The USENET cookbook is distributed in the newsgroup named ``mod.recipes''.
You will need to get that newsgroup at your site.
A package of software for dealing with mod.recipes, including troff macros,
extraction programs, indexing programs, and this introduction, is posted from
time to time into mod.recipes and net.sources. Get that software and install
it on your machine.
.SH PROCEDURE
To submit a recipe to the USENET cookbook, just mail its text to the
newsgroup moderator, glacier!mod-recipes by uucp or
mod-recipes@glacier.stanford.edu by internet. The netnews software on most
machines will do this automatically if you try to post to mod.recipes
.PP
You can also submit evaluations, modifications, suggestions, or bug-fixes to
existing recipes.
.SH NOTES
It's important that you tell us where you got the recipe from. It's ok if you
cribbed it from a book or magazine or newspaper, but if you copy the
words that you found there, you have probably violated a copyright.
.PP
While the main purpose of the USENET cookbook is to let us all make our own
custom cookbooks, we can't ignore the reality of the copyright law. Surely
you have noticed that every modern book says ``\fINo part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form
or by any means, electronic, ..., or otherwise without the prior written
permission of the publisher.\fR''
.PP
Copyright law is complex, and only a lawyer
can reliably advise you on whether or not you are violating it, but in
general if you rewrite a recipe, in your own words, even if you don't change
the recipe, then you are not infringing the copyright by submitting that
recipe to the network. The copyright is on the words that explain the recipe,
and not the recipe itself.
.SH COPYRIGHT
The USENET Cookbook itself is copyrighted material, and cribbing from it is
every bit as much a violation of the copyright law as cribbing from any
other published cookbook. It is copyrighted to prevent it from being used
for financial gain by other parties.
.WR
Brian Reid, glacier!reid, reid@glacier.stanford.edu
Stanford University, Computer Systems Laboratory
'YumYumEatemup'
7536!mod.recipes!
echo extracting rckeep.X
cat > rckeep.X << '7536!mod.recipes!'
#! /bin/sh
# rckeep - keep a recipe by adding it to a keep directory
#
# usage:
#   rckeep [ keepdir ]  [ filename ]
#
# This program lets you snatch recipes out of newsgroups and store them in
# a "keep" directory. They are stored in a file name that matches the
# recipe id, which is found in the .RH command in the recipe.
#
# If you don't specify a keep directory, it will use DEFDIR which
# is as good a place as any. You can use ~/ to stand for $HOME/ if you want.
#
# Brian Reid, November 1985
#
PATH=DEFPATH
export PATH
TEMPFILE=/tmp/rckeep.$$
case $1 in
        "") KEEPDIR=DEFDIR;;
        ~/*) KEEPDIR=$HOME/`expr $1 : '~/\(.*\)'`;;
        ~*) echo Sorry, I cannot process ~ notation, except for ~/...;
               exit 1;;
        *) KEEPDIR=$1;;
esac
if [ ! -d $KEEPDIR ]; then
        echo Creating new keep directory $KEEPDIR;
        mkdir $KEEPDIR;
fi;
case $2 in
        "") rcextract > $TEMPFILE;;
        *) rcextract < $2 > $TEMPFILE;;
esac
# the [A-Z] in tr arg below is for compatibility with SysV
IDLINE=`awk '{print $2,$3; exit;}' < $TEMPFILE | tr "[A-Z]" "[a-z]" `
case $IDLINE in
    "") echo This is not a mod.recipes datafile. I do not know what to do with it.
        exit 1;;
esac
set $IDLINE
KEEPNAME=$2
FILETYPE=$1
case $FILETYPE in
    mod.recipes-source) if [ -f $KEEPDIR/$KEEPNAME ]; then
        echo Overwriting previous version of `basename $KEEPNAME`
        fi
        mv $TEMPFILE $KEEPDIR/$KEEPNAME
        echo Saved as $KEEPDIR/$KEEPNAME;;
    mod.recipes-patch) if [ -f $KEEPDIR/$KEEPNAME ]; then
        echo Updating old version of $KEEPNAME
        patch -s $KEEPDIR/$KEEPNAME < $TEMPFILE
            else
        echo Sorry, but the recipe $KEEPNAME is not there. I cannot patch it.
        fi;;
    *) echo This is not a mod.recipes datafile. I do not know what to do with it.;
       exit 1;;
esac
7536!mod.recipes!
echo extracting rcnroff.X
cat > rcnroff.X << '7536!mod.recipes!'
#! /bin/sh
# rcnroff - nroff a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and
# nroffs that recipe to the standard output.
#
# Brian Reid, November 1985
#
TROFF="nroff -man"
PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC -
7536!mod.recipes!
echo extracting rcshow.X
cat > rcshow.X << '7536!mod.recipes!'
#! /bin/sh
# rcshow - show a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and
# nroffs it for display on the screen. This differs slightly from "nrecipe"
# in that it is not page-oriented. Actually, this program is almost too slow
# to use, because it has to run nroff every time.
#
# Brian Reid, November 1985
#
# If you don't have "less", you will want to
# add "ul" to the pipeline to get the underlines right.
TROFF="nroff -man"
PAGER="DEFPAGER"

PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC - | $PAGER
# if you don't have "less", you will probably want to change the above line
# into $TROFF $TMAC - | ul | $PAGER
7536!mod.recipes!
echo extracting rctypeset.X
cat > rctypeset.X << '7536!mod.recipes!'
#! /bin/sh
# rctypeset - typeset a recipe
#
# This shell script extracts a recipe from a mod.recipes netnews article and
# typesets it with troff. TRoff sends directly to the typesetter; if you
# don't have a typesetter, or have more than one, please consult your site
# administrators to find out what to do.
#
# Brian Reid, November 1985
#
TROFF="DEFTROFF"
PATH=DEFPATH
export PATH
TMPFILE=/tmp/xart.$$
TMAC=/tmp/tmac.$$
trap "rm -f $TMPFILE $TMAC" 0 1 2 3 15
cat > $TMPFILE << 'extractor.awk'
BEGIN {Seen = 0}
/^\.RH MOD\.RECIPES/ {Seen = 1}
/^-- *$/ {Seen = 0}
Seen == 1 {print $0}
extractor.awk
cat > $TMAC << 'tmac.recip'
TMAC.RECIP
tmac.recip
awk -f $TMPFILE |\
  $TROFF $TMAC -
7536!mod.recipes!
echo extracting recipes.5.X
cat > recipes.5.X << '7536!mod.recipes!'
.TH RECIPES 5 "27 Nov 85" "USENET Cookbook"
.SH NAME
recipes \- USENET Cookbook (mod.recipes) format and submitting procedure.
.SH SYNOPSIS
Mail your recipe to mod-recipes@glacier. Try not to plagiarize.
If you want to put in your own troff commands, use the manual macros.
.SH DESCRIPTION
The way you submit to mod.recipes is to mail the recipe to the
moderator. The moderator's mailbox is
.br
        glacier!mod-recipes,
.br
if you believe in that kind of address, or
.br
        {hplabs, decwrl, bellcore, pyramid, sun}!glacier!mod-recipes
.br
if you believe in the other kind of address. The addresses
.br
        mod-recipes@SU-Glacier.ARPA
and     mod-recipes@Glacier.STANFORD.EDU
.br
also work, if you know how to mail to them.
.PP
If your netnews administrator has set things up properly and if you are
running the right news software, you can just post to mod.recipes as you
would any other group, but your posting will be mailed to the moderator
insted of being placed directly in the newsgroup.
.SH HOW TO STRUCTURE A RECIPE
Every recipe that goes out will be formatted with a small set of troff
commands. If you don't know any troff, then just send the text of your
recipe. If you can do the formatting yourself, then great! That will save
the editor a lot of time. Some hints for how to do it are in a later section
of this documentation.
If you don't know about xroff/troff/nroff but you do want to be helpful,
then you can help a lot by doing this:
.PP
.IP 1 5
Put your recipe in the standard sequence:
.RS 10
- Title and 1-line description
.br
- Introductory commentary, explaining (if possible) where you got
the recipe from.
.br
- list of ingredients, using "Tbsp.", "tsp.", "cup", "oz", and "lb",
.br
- Numbered sequence of recipe steps.
.br
- Notes (if any). Comments on how you like to make it, or ingredient
availability, etc.
.br
Your ``signature''. This should include your name and net address, the
organization that you are a part of, and the name of the city it is in. It can
also include other frivolity or foolishness if you like; I'll include as
much of it as will fit on the page.
.RE
.IP 2 5
Don't put any tab characters (^I) in the file if you can possibly avoid it.
They do strange things on typesetters.
.IP 3 5
If you are a troff wizard, please don't use any of that wizardry in these
recipes. If you stick to the set of commands used in the Unix manual macros
(see \fIman(7)\fR), and the set of commands that are part of the USENET
Cookbook package (see following section), then things should work.
.RE
.PP
You can also submit evaluations, modifications, suggestions, or bug-fixes to
existing recipes.
.SH COPYRIGHT NOTES
It's important that you tell us where you got the recipe from. It's ok if you
cribbed it from a book or magazine or newspaper, but if you copy exactly the
words that you found there, there might be a problem with copyright violation.
.PP
While the main purpose of the USENET cookbook is to let us all make our own
custom cookbooks, we can't ignore the reality of the copyright law. Surely
you have noticed that every modern book says ``\fINo part of this publication
may be reproduced, stored in a retrieval system, or transmitted, in any form
or by any means, electronic, ..., or otherwise without the prior written
permission of the publisher.\fR''
.PP
Copyright law is complex, and only a lawyer
can reliably advise you on whether or not you are violating it, but in
general if you rewrite a recipe, in your own words, even if you don't change
the recipe, then you are not infringing the copyright by submitting that
recipe to the network. The copyright is on the words that explain the recipe,
and not the recipe itself.
.PP
That's the letter of the law. The reality of it seems to be that recipes,
like jokes, are almost always stolen rather than invented. Nearly every
cookbook I have ever seen contains recipes that were stolen from some other
cookbook, and I have never seen an instance of anybody being prosecuted for
it.
.SH DO YOUR OWN FORMATTING
If you put formatting commands in the recipes that you submit, they will go
out more quickly, since the editor won't have to do it.
It's easy to learn how.
.PP
The basic principle is to use as few commands as possible, and in general to
use only commands that are defined in the manual macros or the recipe macro
package. Various processing programs search through these files and look for
string matches on things like ".IG" and ".RZ".
Print out a few of the recipe source files from NEWSDIR/mod/recipes,
and then use OBJDIR/rctypeset
or OBJDIR/rcnroff to produce
formatted versions of them. Have that at hand when you are formatting
your recipe. You can test your formatting by using rctypeset or rcnroff on
your draft versions before you submit the recipe.
.PP
A ``skeleton'' recipe follows. .RH is the recipe header command; it must be
the first line of each recipe and it must have 4 arguments.
"RECIPE-ID" is the file name under which the recipe will be stored; it must
be 14 characters or less. The "?" is a "what kind of recipe" code from the
code table below.
.nf
.ta 3i
.RS 4
\&.RH MOD.RECIPES-SOURCE RECIPE-ID ? "22 Dec 83"
\&.RZ "RECIPE TITLE" "One-line description of it"
Introductory comments; use .PP for new paragraph.
\&.IH "Serves 13"       <-- Ingredients Header
\&.IG "1/2 cup" "butter"        <-- Ingredient (please use quotes)
\&.IG "1" "onion"
(medium to large, chopped fine. Don't try to use instant onion
in this recipe)
\&.PH   <-- Procedure header
\&.SK 1 <-- Procedure step
Preheat oven to 600 degrees     <-- Text for that step
\&.SK 2 <-- and so forth.
\&.NX   <-- Notes header
Notes (commentary) goes here; use .PP to separate paragraphs.
\&.WR   <-- Wrapup
Signature information goes here. As a minimum you should list your name,
network address, organization (company, university, etc.), and the city you
live or work in.
.RE 4
.fi
Remember that when you post to a moderated newsgroup, the news software
usually forgets to include your .signature file, so you should be sure to
include it manually. If it manages to get there twice, I will remove the
extra copy.
.PP
You can also use the following -man macros; see \fIman(7)\fR for the complete
list.
.nf
.RS 4
.ta 3i
\&.I "italic words"
\&.B "boldface words"
\&.SM "small words"
\&.PP   <-- paragraph break
\&.PD <distance>        <-- paragraph distance
\&.IP "indented paragraph".
\&.RS   <-- relative start: move things to the right
\&.RE   <-- relative end: move things left again
.RE 4
.fi
You can also use these nroff/troff commands:
\\fI,
\\fB,
\\fR,
\&.if,
\&.ds,
\&.br,
\&.nf,
\&.fi,
and .ta,
.SH CATEGORY CODES
.nf
.ta .4i 1i 3i 3.6i
        M       Main dish       SL      Salad
        A       Appetizer or snack      SP      Soup
        B       Bread/cake/pasta        D       Dessert
        L       Beverage (Liquid)       V       Vegetable dish
.fi
The suffix ``V'' on any category means that it is vegetarian; for example, a
vegetarian main dish recipe would be marked ``MV''.
.SH SEE ALSO
cookbook(1), rn(1)
.SH AUTHOR
Brian Reid is the organizer of mod.recipes and the author of most of the
software.
7536!mod.recipes!
echo extracting configure.sh
cat > configure.sh << '7536!mod.recipes!'
#! /bin/sh
# Script to configure and install the other shell scripts for mod.recipes.
#       Brian Reid, December 1985
#
OBJDIR="$1"
NEWSDIR="$2"
DEFDIR="$3"
DEFPATH="$4"
DEFTROFF="$5"
DEFPAGER="$6"
# make rcbook.n.X from rcbook.t.X
sed -e "s+DEFTROFF+nroff -man+" \
    -e "s+for the typesetter+with nroff+" \
    -e "s+Typesetting+Formatting+" \
    -e "/^rcindex/s+ -t++" \
    -e '/^\$TROFF/s+$+ > Cookbook.nr+' \
    -e '/^\$TROFF/a\
echo Cookbook.nr created 1>&2' \
    < rcbook.t.X > rcbook.n.X

# now configure the executable programs
for i in *.X
do
    j=`basename $i .X`
    echo Processing $i into $j
    sed -e "s+OBJDIR+$OBJDIR+" \
        -e "s+NEWSDIR+$NEWSDIR+" \
        -e "s+DEFDIR+$DEFDIR+" \
        -e "s+DEFPATH+$DEFPATH+" \
        -e "s+DEFPAGER+$DEFPAGER+" \
        -e '/^TMAC.RECIP$/r tmac.recip' \
        -e '/^TMAC.RECIP$/d' \
        -e "s+DEFTROFF+$DEFTROFF+" < $i > $j
    chmod 755 $j
done
7536!mod.recipes!
echo extracting tmac.recip
cat > tmac.recip << '7536!mod.recipes!'
'       # Recipe Heading
.de RH
.TH \\$2 "\\$3" "\\$4" "mod.recipes" "USENET Cookbook"
.ds ]H \\$2
..
.de RZ
.SH \\s14\\$1
\\*(]H \- \\$2
.PP
..
'       # Ingredient
.de IG
.TP 10
\&\\$1
.I \\$2
..
'       # Step
.de SK
.IP "(\\$1)" 5n
..
'       # Ingredient header
.de IH
.SH INGREDIENTS (\\$1)
.PD 0
..
'       # Procedure header
.de PH
.PD
.SH PROCEDURE
.RS 5
..
'       # Notes
.de NX
.PD
.SH NOTES
..
'       # Wrapup
.de WR
.RE 5
.PD
.SH CONTRIBUTOR
.nf
..
.\" these macros courtesy of Bernie Cosell and Matt Bishop
.de CS  \" do the fancy "go into cs mode right" guy
.   ie \\n(.z .cs \\$1 \\$2 \\$3
.   el              \!.CS \\$1 \\$2 \\$3
..
.
.de FW \" Go into fixed-width mode: put both italic and bold fonts in it
.   CS B 21 \\(.s
.   CS I 21 \\(.s
.   ss 24
.   lg 0
..
.
.de Fw \" Leave fixed-width mode
.   CS B
.   CS I
.   ss 12
.   lg 1
..
7536!mod.recipes!
--
        Brian Reid      decwrl!glacier!reid
        Stanford        reid@SU-Glacier.ARPA