head	2.1;
access;
symbols
	fourth_edition:2.1;
locks
	grog:2.1; strict;
comment	@# @;


2.1
date	97.12.07.08.34.53;	author grog;	state Exp;
branches;
next	1.2;

1.2
date	96.07.02.11.52.26;	author grog;	state Exp;
branches;
next	1.1;

1.1
date	96.06.27.06.04.41;	author grog;	state Exp;
branches;
next	;


desc
@Make script for bisdn docs
@


2.1
log
@Base second edition
@
text
@# makebisdnsect: make a section of the reference manual
#
# Usage: makebisdnsect Section.<number>
#
# If the file 'lastpage' exists, it will be read to get the initial page number
#
# This differs from makesection by not making a table of contents, and also
# in where it puts the files.
#
# $Id: makebisdnsect,v 1.2 1996/07/02 11:52:26 grog Exp grog $
#
# $Log: makebisdnsect,v $
# Revision 1.2  1996/07/02 11:52:26  grog
# Minor mods
#
# Revision 1.1  1996/06/27  06:04:41  grog
# Initial revision
#
#
sect=`echo $1 | sed 's:Section.::; s:Chapter/bisdn/::'`
if [ -f bisdn/lastpage ]; then
  read page < bisdn/lastpage
  page=`expr $page + 1`
else
  page=1
fi
TEMPFILE=/tmp/filelist.$$ export TEMPFILE
cat preferences/$1 > $TEMPFILE
GROFF_TMAC_PATH=`pwd`/../tools export GROFF_TMAC_PATH
PATH=`pwd`/../tools:$PATH
cd man$sect
rm -rf ../Chapter/bisdn/$sect ../bisdn/Toc/toc.man
mkdir -p ../Chapter/bisdn/$sect
# echo --- eliminating duplicates
# find . -type f -name "*.gz" | xargs ls -l | sort +4 \
#    | sed 's:^.* ::; s:^\./::; s:\.gz$::' >> $TEMPFILE
#   xargs <$TEMPFILE elimdup
printf "%-28s\t%s\t%s\t%s\n\n" "Man page" First Last Pages
for i in `ls *.gz`; do
  printf "%-30s\t%d\t" $i $page
#  echo "zcat $i | cleanup $i | gsoelim | ${TBL} | groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} -    >../Chapter/bisdn/$sect/$i"
  zcat $i | cleanup $i | gsoelim | ${TBL} |
  groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} - \
   >../Chapter/bisdn/$sect/$i 2>>../$sect/Toc/toc.man
#   echo   lastpage=\`awk \< ../Chapter/bisdn/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter/bisdn/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'`
   if [ $lastpage -ge $page ]; then
     pages=`expr $lastpage - $page + 1`
     page=$lastpage
   else
     echo '***' $i has incorrect page numbering
     pages=1
   fi
   printf "%d\t%d\n" $page $pages
   page=`expr $page + 1`
done
echo $page > ../appendix-start
echo
cd ..
echo Merging PostScript files
cd Chapter/bisdn
rm -f Section.$sect
find $sect -type f | xargs ../../merge >> Section.$sect
# rm -rf $sect Section.$sect~
@


1.2
log
@Minor mods
@
text
@d10 1
a10 1
# $Id: makebisdnsect,v 1.1 1996/06/27 06:04:41 grog Exp grog $
d13 3
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
# $Id: makebisdnsect,v 1.6 1996/05/11 14:09:57 grog Exp grog $
d12 3
a14 1
# $Log: makelongsect,v $
d16 1
d18 2
a19 2
if [ -f lastpage ]; then
  read page < lastpage
@
