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.9;

1.9
date	96.09.09.11.39.18;	author grog;	state Exp;
branches;
next	1.8;

1.8
date	96.07.17.17.59.19;	author grog;	state Exp;
branches;
next	1.7;

1.7
date	96.06.29.10.16.00;	author grog;	state Exp;
branches;
next	1.6;

1.6
date	96.05.11.14.09.57;	author grog;	state Exp;
branches;
next	1.5;

1.5
date	96.05.05.11.32.37;	author grog;	state Exp;
branches;
next	1.4;

1.4
date	96.04.29.11.07.31;	author grog;	state Exp;
branches;
next	1.3;

1.3
date	96.04.29.09.33.00;	author grog;	state Exp;
branches;
next	1.2;

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

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


desc
@Make man pages for the long version of the book
@


2.1
log
@Base second edition
@
text
@# makelongsect: make a section of the reference manual
#
# Usage: makelongsect 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: makelongsect,v 1.9 1996/09/09 11:39:18 grog Exp grog $
#
# $Log: makelongsect,v $
# Revision 1.9  1996/09/09 11:39:18  grog
# Checkpoint 12 November
#
# Revision 1.8  1996/07/17  17:59:19  grog
# Minor mods
#
# Revision 1.7  1996/06/29  10:16:00  grog
# Checkpoint 30 June, maybe final version of long book for 2.1.5?
#
# Revision 1.6  1996/05/11  14:09:57  grog
# Almost final draft for CD-ROM box
#
# Revision 1.5  1996/05/05  11:32:37  grog
# Minor mods
#
# Revision 1.4  1996/04/29  11:07:31  grog
# Minor mods, checkin for complete "CD Box"
#
# Revision 1.2  1996/04/11  11:52:22  grog
# Checkpoint 11 April
#
# Revision 1.1  1996/04/06  12:53:53  grog
# Initial revision
#
# Revision 1.4  1996/02/24  16:31:45  grog
# More mods
#
# Revision 1.2  1996/02/24  12:17:12  grog
# minor mods
#
# Revision 1.1  1996/02/18  10:39:13  grog
# Initial revision
#
#
sect=`echo $1 | sed 's:Section.::; s:Chapter/long/::'`
if [ -f lastpage ]; then
  read page < 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/long/$sect ../long/Toc/toc.man
mkdir -p ../Chapter/long/$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/long/$sect/$i"
  zcat $i | cleanup $i | gsoelim | ${TBL} |
  groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} - \
   >../Chapter/long/$sect/$i 2>>../long/Toc/toc.man
#   echo   lastpage=\`awk \< ../Chapter/long/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter/long/$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/long
rm -f Section.$sect
find $sect -type f | sort | xargs ../../merge >> Section.$sect
rm -rf $sect Section.$sect~
@


1.9
log
@Checkpoint 12 November
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.8 1996/07/17 17:59:19 grog Exp grog $
d13 3
@


1.8
log
@Minor mods
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.7 1996/06/29 10:16:00 grog Exp grog $
d13 3
d53 2
a54 2
GROFF_TMAC_PATH=`pwd`/../tools export GROFF_TMAC_PATH
PATH=`pwd`/../tools:$PATH
d65 1
a65 1
#  echo "zcat $i | cleanup $i | gsoelim | ${TBL} | groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} -    >../Chapter/long/$sect/$i"
@


1.7
log
@Checkpoint 30 June, maybe final version of long book for 2.1.5?
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.6 1996/05/11 14:09:57 grog Exp grog $
d13 3
d84 1
a84 1
find $sect -type f | xargs ../../merge >> Section.$sect
@


1.6
log
@Almost final draft for CD-ROM box
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.5 1996/05/05 11:32:37 grog Exp grog $
d13 3
d38 1
a38 1
sect=`echo $1 | sed 's:Section.::; s:Chapter.long/::'`
d50 2
a51 2
rm -rf ../Chapter.long/$sect ../Toc.long/toc.man
mkdir -p ../Chapter.long/$sect
d59 1
a59 1
#  echo "zcat $i | cleanup $i | gsoelim | ${TBL} | groff -rD1 -rP$page -r%$page -r$$ -rLL=${HEIGHT} -rIN=${WIDTH} -rN2 -mpic ${MACROFILE} -    >../Chapter.long/$sect/$i"
d62 3
a64 3
   >../Chapter.long/$sect/$i 2>>../Toc.$sect/toc.man
#   echo   lastpage=\`awk \< ../Chapter.long/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'\`
   lastpage=`awk < ../Chapter.long/$sect/$i '/%%Page:/ {page=$2 }; END {print page}'`
d79 1
a79 1
cd Chapter.long
d81 1
a81 1
find $sect -type f | xargs ../merge >> Section.$sect
@


1.5
log
@Minor mods
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.4 1996/04/29 11:07:31 grog Exp grog $
d13 3
a53 1
pwd
d56 1
@


1.4
log
@Minor mods, checkin for complete "CD Box"
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.2 1996/04/11 11:52:22 grog Exp grog $
d13 3
d69 1
a69 1
echo $page > ../lastpage
@


1.3
log
@Checkin before path changes
@
text
@d48 2
a49 1
for i in `xargs < ../filelist`; do		# ../filelist is created by elimdup
d51 1
a51 1
  cleanup $i <$i | gsoelim | ${TBL} |
a55 1
   echo lastpage: $lastpage page: $page
a64 1
   rm -f $i
@


1.2
log
@Checkpoint 11 April
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.1 1996/04/06 12:53:53 grog Exp grog $
d13 3
d43 4
a46 4
echo --- eliminating duplicates
find . -type f -name "*.gz" | xargs ls -l | sort +4 \
   | sed 's:^.* ::; s:^\./::; s:\.gz$::' >> $TEMPFILE
   xargs <$TEMPFILE elimdup
d55 1
@


1.1
log
@Initial revision
@
text
@d10 1
a10 1
# $Id: makelongsect,v 1.4 1996/02/24 16:31:45 grog Exp grog $
d13 3
d38 1
a38 1
rm -rf ../Chapter.long/$sect  ../Toc/$sect
d49 1
a49 1
   >../Chapter.long/$sect/$i 2>>../Toc/$sect
@
