Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man0 add "man.pdf" and "man.tgz" targets



details:   https://anonhg.NetBSD.org/src/rev/bd0578ef0b6a
branches:  trunk
changeset: 512110:bd0578ef0b6a
user:      hubertf <hubertf%NetBSD.org@localhost>
date:      Thu Jul 05 20:52:11 2001 +0000

description:
add "man.pdf" and "man.tgz" targets
PDF optimisations thanks to Valeriy E. Ushakov

diffstat:

 share/man/man0/Makefile |  31 +++++++++++++++++++++++++------
 1 files changed, 25 insertions(+), 6 deletions(-)

diffs (67 lines):

diff -r 22680576e714 -r bd0578ef0b6a share/man/man0/Makefile
--- a/share/man/man0/Makefile   Thu Jul 05 20:47:31 2001 +0000
+++ b/share/man/man0/Makefile   Thu Jul 05 20:52:11 2001 +0000
@@ -1,5 +1,5 @@
 #      from: @(#)Makefile      5.9 (Berkeley) 7/1/91
-#      $NetBSD: Makefile,v 1.7 2001/06/30 01:25:00 hubertf Exp $
+#      $NetBSD: Makefile,v 1.8 2001/07/05 20:52:11 hubertf Exp $
 
 .include <bsd.own.mk>
 
@@ -12,13 +12,24 @@
 CLEANFILES+=   man?
 CLEANFILES+=   man?pages.tmp
 CLEANFILES+=   man?pages.ps
+CLEANFILES+=   man?pages.pdf
 CLEANFILES+=   toc? tocx?
 
+SECTIONS?=     1 2 3 4 5 6 7 8 9
+
+# Takes out some fluff from the PostScript files created bye
+# grops which does some VM saving/restoring that bloats the
+# PDF file pdf2ps generates.              By uwe%netbsd.org@localhost.
+OPTIMIZE_PDF?= \
+                       -e '/^\/level0 0 def/d'                 \
+                       -e '/^\/level0 save/d'                  \
+                       -e '/^level0 restore/d'                 
+
 man:
        sh mkman
 
 man.ps:
-       for i in 1 2 3 4 5 6 7 8 9 ;                            \
+       for i in ${SECTIONS} ;                                  \
        do                                                      \
                for f in `grep "$${i}\$$" intros` `cat man$${i}` ; \
                do                                              \
@@ -31,18 +42,26 @@
                                cat $${f} | tbl | troff -msafer -man -Tps $${f} ; \
                        else                                    \
                                echo >&2 $${f} "(tbl)" ;        \
-                               cat $${f} | troff -msafer -man -Tps $${f} ;     \
+                               cat $${f} | troff -msafer -man -Tps $${f} ; \
                        fi ;                                    \
                done >man$${i}pages.tmp ;                       \
                grops <man$${i}pages.tmp >man$${i}pages.ps ;    \
-               rm man$${i}pages.tmp ;                          \
+               rm man$${i}pages.tmp ;          \
        done
 
 man.pdf:
-       for i in 1 2 3 4 5 6 7 8 9 ;                            \
+       for i in ${SECTIONS} ;                                  \
        do                                                      \
                echo Chewing on man$${i}pages.pdf ;             \
-               ps2pdf man$${i}pages.ps man$${i}pages.pdf  ;    \
+               sed                                             \
+                       ${OPTIMIZE_PDF}                         \
+                       <man$${i}pages.ps >man$${i}pages.ps.tmp ; \
+               ps2pdf man$${i}pages.ps.tmp man$${i}pages.pdf ; \
+               rm man$${i}pages.ps.tmp ;                       \
        done
 
+man.tgz:
+       tar plzvcf manpages-ps.tgz man?pages.ps
+       tar plzvcf manpages-pdf.tgz man?pages.pdf
+
 .include <bsd.prog.mk>



Home | Main Index | Thread Index | Old Index