Fixing man2html quirk that pulls in punctuation, and breaks URLs.
[privoxy.git] / doc / source / GNUmakefile.in
index 610bad3..32fa2a7 100644 (file)
@@ -1,6 +1,6 @@
 # Note:  Makefile is built automatically from Makefile.in
 #
-# $Id: Makefile.in,v 1.0 2002/05/28 09:16:15 oes Exp $
+# $Id: GNUmakefile.in,v 1.2 2002/06/05 04:17:19 hal9 Exp $
 #
 # Location: doc/source/Makefile.in 
 # Purpose: Build documentation
@@ -194,27 +194,46 @@ dok-authors: ensure-dkprefix ensure-jadebin ensure-wdump
        $(DB) -V nochunks authors.sgml > tmp.html && $(WDUMP) \
          tmp.html > ../../AUTHORS
 
-# make a man page, and then (lousy) HTML version.
+# Make a man page, and then (lousy) HTML version.
 # Requires docbook2man (short perl script), see comments 
 # in privoxy-man-page.sgml. This target is not invoked from other dok targets.
 # It is built separately due to dependencies on off-beat perl scripts.
-dok-man: ensure-dkprefix ensure-jadebin ensure-wdump
-       cd $(DOC_TMP) && $(RM) * && docbook2man ../privoxy-man-page.sgml &&\
+# Note: docbook2man eats all command line arguments except file name. Bummer.
+dok-man: ensure-dkprefix ensure-jadebin 
+       cd $(DOC_TMP) && $(RM) * && docbook2man $(DOC_STATUS) ../privoxy-man-page.sgml &&\
        perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
        cd $(DOC_TMP) && $(DB) ../privoxy-man-page.sgml &&\
        $(MV) -f index.html privoxy-man-page.html
      # This html is not used. See make man2html.
        $(MV) -f $(DOC_TMP)/privoxy.1 $(ROOT)/privoxy.1
+       # Build a proper HTML man page.
        $(MAKE) man2html
 
-# For those with man2html ala RH7's.
+# This is laternate version of above, that does handle command line options,
+# ie DOC_STATUS.
+dok-man-test: ensure-dkprefix ensure-jadebin dok-release
+       cd $(DOC_TMP) && $(RM) * &&\
+       nsgmls $(DOC_STATUS) ../privoxy-man-page.sgml  | sgmlspl `find /usr/share/sgml -name docbook2man-spec.pl` &&\
+       perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1
+       cd $(DOC_TMP) && $(DB) ../privoxy-man-page.sgml &&\
+       $(MV) -f index.html privoxy-man-page.html
+     # This html is not used. See make man2html.
+       $(MV) -f $(DOC_TMP)/privoxy.1 $(ROOT)/privoxy.1
+       $(MAKE) man2html
+       $(MAKE) clean
+
+# For those with man2html ala RH7s.
 man2html: ensure-dkprefix ensure-jadebin ensure-wdump
+       mkdir -p doc/webserver/man-page
 ifneq ($(MAN2HTML),false)
-       $(MAN2HTML) $(ROOT)/privoxy.1 |grep -v "^Content-type" > tmp.html
+       $(MAN2HTML) privoxy.1 |grep -v "^Content-type" > tmp.html
        $(PERL) -pi.bak -e 's/<A .*Contents<\/A>//; s/<A .*man2html<\/A>/man2html/' tmp.html
        $(PERL) -pi.bak -e 's/(<\/HEAD>)/<LINK REL=\"STYLESHEET\" TYPE=\"text\/css\" HREF=\"..\/p_doc.css\"><\/HEAD>/' tmp.html
+# Twice because my version of man2html is pulling in commas and periods in URLs.
+       $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html
+       $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html
 # Get rid of spurious \a from conversion. (How to do this with perl?)
-       $(SED) -e 's/\a//g' tmp.html > ../webserver/man-page/privoxy-man-page.html
+       $(SED) -e 's/\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
 else
        $(MAKE) groff2html
 endif
@@ -252,7 +271,7 @@ dok-pdf2: dok-release
 
 # Create release announcement in text and html, with short and long versions.
 # This is a standalone target, and must be invoked directly.
-announce: dok-release
+announce: dok-release ensure-wdump
        cd $(DOC_TMP) && $(DB) -iannounce-big ../announce.sgml &&\
        mv -f index.html announce.html && $(WDUMP) announce.html > announce.txt
        cd $(DOC_TMP) && $(DB) ../announce.sgml &&\
@@ -297,7 +316,7 @@ config-file: ensure-dkprefix ensure-jadebin ensure-wdump dok-release
 
 # config file, alternate verison using lynx (perl stuff unfinished). Lynx
 # does not do so good a job.
-config-file-alt: dok-release
+config-file-alt: dok-release ensure-wdump
        $(ECHO) -e ".h2 JUSTIFY\\nJUSTIFY:FALSE" > tmp.lynx_cfg &&\
        $(DB)-notoc -iconfig-file -V nochunks config.sgml > tmp.html &&\
        lynx -cfg=tmp.lynx_cfg -width=78 -dump tmp.html > ../../config.new && $(RM) tmp.*
@@ -326,4 +345,12 @@ coffee:
 
 #############################################################################
 
-# $Log: Makefile.in,v $
+# $Log: GNUmakefile.in,v $
+# Revision 1.2  2002/06/05 04:17:19  hal9
+# Add dok-man-test target as temp workaround for docbook2man ignoring -i command
+# line option.
+#
+# Revision 1.1  2002/06/05 00:28:28  hal9
+# Moving all doc building to doc/source. Rewrite all targets (not well tested).
+# Docs are now built without touching sgml source.
+#