From 0d8b52dcebd0124fe2c92a44cb0e7b632c524a1a Mon Sep 17 00:00:00 2001 From: Jeff Bigler Date: Fri, 6 Sep 1996 17:16:30 +0000 Subject: [PATCH] Completely rewrote Makefile. Fixed up man2ps script and wrote manpage for it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9040 dc483132-0cff-0310-8789-dd5450dbe970 --- doc/ChangeLog | 20 +++++++++++++++ doc/Makefile | 71 ++++++++++++++++++++++++++++++++++++++++++++------- doc/man2ps | 32 ++++++++++++----------- doc/man2ps.M | 44 +++++++++++++++++++++++++++++++ 4 files changed, 143 insertions(+), 24 deletions(-) create mode 100644 doc/man2ps.M diff --git a/doc/ChangeLog b/doc/ChangeLog index d37beef66..7f6c416f1 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,23 @@ +Fri Sep 6 12:59:43 1996 Jeff Bigler + + * man2ps: shell script to create postscript include files for + user's guide. + + * man2ps.M: man page for above shell script + + * build.texinfo: this is now included by cyg-install.texinfo + (which should eventually replace install.texi.) + + * definitions.texinfo: added flags "MIT" and "CYGNUS". + + * cyg-install.texinfo: added @ifset and @ifclear sections to + separate MIT-specific and Cygnus-specific sections. + + * admin.texinfo: added @ifset and @ifclear sections as with + cyg-install.texinfo + + * Makefile: rewrote entire contents of file. + Fri Sep 6 01:22:56 1996 Theodore Y. Ts'o * build.texinfo: Remove --enable options which are no longer diff --git a/doc/Makefile b/doc/Makefile index dfbc9430f..0603cba97 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,15 +1,68 @@ -.SUFFIXES: .texi .dvi .ps .info +SRCDIR=../src +DVI=texi2dvi +DVIPS=dvips -o "$@.ps" +INFO=makeinfo +HTML=texi2html +RM=rm -f +TAR=tar -chvf +GZIP=gzip -9 +MANPS=./man2ps +all:: admin-guide-full install-guide-full user-guide-full tgz -all:: install.info install.dvi +admin-guide-full:: admin-guide admin-guide-info admin-guide-html -.texi.dvi: - texi2dvi $*.texi +admin-guide:: + $(DVI) admin.texinfo + $(DVIPS) admin +admin-guide-html:: + $(HTML) admin.texinfo -.texi.info: - makeinfo $*.texi +admin-guide-info:: + $(INFO) admin.texinfo +install-guide-full:: install-guide install-guide-info install-guide-html -clean:: - rm -f *.log *.info *.dvi *.aux *.toc *.cp *.fn *.vr *.tp *.ky \ - *.pg *.ps *.info-? +install-guide:: + $(DVI) cyg-install.texinfo + $(DVIPS) install + +install-guide-html:: + $(HTML) cyg-install.texinfo + +install-guide-info:: + $(INFO) cyg-install.texinfo + +user-guide-full:: user-guide user-guide-info user-guide-html + +user-guide:: + $(DVI) user-guide.texinfo + $(MANPS) $(SRCDIR)/appl/gssftp/ftp/ftp.M $(SRCDIR)/clients/kdestroy/kdestroy.M $(SRCDIR)/clients/kinit/kinit.M $(SRCDIR)/clients/klist/klist.M $(SRCDIR)/clients/ksu/ksu.M $(SRCDIR)/appl/bsd/rcp.M $(SRCDIR)/appl/bsd/rlogin.M $(SRCDIR)/appl/bsd/rsh.M $(SRCDIR)/appl/telnet/telnet/telnet.1 + $(DVIPS) user-guide + +user-guide-info:: + $(INFO) user-guide.texinfo + +user-guide-html:: + $(HTML) user-guide.texinfo + +clean:: clean-all + +clean-all:: clean-tex clean-backup clean-final clean-tarfiles + +clean-final:: + $(RM) *.ps *.info *.info-? *.html + +clean-tex:: + $(RM) *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr + +clean-backup:: + $(RM) *~ #* + +clean-tarfiles:: + $(RM) *.tar *.tar.gz *.tgz + +tgz:: + $(TAR) krb5-docs.tar admin.texinfo build.texinfo copyright.texinfo definitions.texinfo document-list.texinfo glossary.texinfo cyg-install.texinfo texinfo.tex user-guide.texinfo *-guide.ps *.info *.info-? *.html + $(GZIP) krb5-docs.tar + $(MV) krb5-docs.tar.gz krb5-docs.tgz diff --git a/doc/man2ps b/doc/man2ps index 33162d402..a42260fc1 100644 --- a/doc/man2ps +++ b/doc/man2ps @@ -2,41 +2,43 @@ com=`basename $0` files=$* -docdir=`pwd` -mandir=$docdir/man -cd $mandir +if [ "$files" = "" ]; then + echo "Usage: $com file [file2 ...]" + exit 1 +fi for file in $files do - troff -C -man -Tps $mandir/man?/$file.? | grops -g > $file.ps + filename=`basename $file | awk -F. '{print $1}'` + troff -C -man -Tps $filename | grops -g > $filename.ps - pages=`grep '%%Pages\:' $file.ps | awk '{print $2}'` + pages=`grep '%%Pages\:' $filename.ps | awk '{print $2}'` pp=$(($pages - 1)) - echo $file': '$pages' pages' + echo $filename': '$pages' pages' if [ -e csplit ]; then - csplit -k $file.ps /Page:/ \{$pp\} + csplit -k $filename.ps /Page:/ \{$pp\} counter=0 for number in `ls xx*` do - cat xx00 > $docdir/$file$counter.ps - echo '.7 dup scale' >> $docdir/$file$counter.ps - cat $number >> $docdir/$file$counter.ps + cat xx00 > $filename$counter.ps + echo '.7 dup scale' >> $filename$counter.ps + cat $number >> $filename$counter.ps if [ $counter != $pages ]; then - echo '%%Trailer' >> $docdir/$file$counter.ps - echo 'end' >> $docdir/$file$counter.ps - echo '%%EOF' >> $docdir/$file$counter.ps + echo '%%Trailer' >> $filename$counter.ps + echo 'end' >> $filename$counter.ps + echo '%%EOF' >> $filename$counter.ps fi counter=$(($counter + 1)) done - rm $file.ps $docdir/$file'0.ps' xx* + rm $filename.ps $filename'0.ps' xx* else - echo "Can't find the csplit command. You'll have to split $file.ps manually." + echo "Can't find the csplit command. You'll have to split $filename.ps manually." fi done diff --git a/doc/man2ps.M b/doc/man2ps.M new file mode 100644 index 000000000..dc4e4ad67 --- /dev/null +++ b/doc/man2ps.M @@ -0,0 +1,44 @@ +.TH MAN2PS 1 +.SH NAME +man2ps \- create individual PostScript files for each page of a man page +.SH SYNOPSIS +.B man2ps +.I file +[\fIfile2\fP [\fI...\fP]] +.SH DESCRIPTION +.B man2ps +is a bourne shell script that turns a man page into a set of PostScript +files, for inclusion in a document. +.B man2ps +converts the man page to a PostScript file using +.IR troff (1), +and then uses the +.IR csplit (1) +command to split the file into individual pages. +.B man2ps +inserts the PostScript command: +.sp +.nf +.in +.5i +\&.7 dup scale +.in -.5i +.fi +.sp +at the beginning of each page, so that the pages will fit onto a page in +a standard size reference manual (7"x9.25"). +.PP +The files created by +.B man2ps +have the same name as the command, with a sequential number and the +string ".ps" appended. For example, running +.B man2ps +on the file "kinit.M" would produce the PostScript files "kinit1.ps", +"kinit2.ps", ... +.SH SEE ALSO +troff(1), csplit(1) +.SH BUGS +.B man2ps +fails if the +.I csplit +command is not in the user's path. + -- 2.26.2