Deduplicate a line in the dok-release target
[privoxy.git] / GNUmakefile.in
index 94902a2..a751094 100644 (file)
@@ -1,6 +1,6 @@
 # Note:  Makefile is built automatically from Makefile.in
 #
-# $Id: GNUmakefile.in,v 1.186 2010/02/20 12:49:54 fabiankeil Exp $
+# $Id: GNUmakefile.in,v 1.198 2011/08/26 16:11:59 fabiankeil Exp $
 #
 # Written by and Copyright (C) 2001-2010 members of the
 # Privoxy team. http://www.privoxy.org/
@@ -60,6 +60,7 @@ CONF_BASE    = @sysconfdir@
 SBIN_DEST    = @sbindir@
 MAN_DIR      = @mandir@
 MAN_DEST     = $(MAN_DIR)/man1
+MAN_PAGE     = privoxy.1
 SHARE_DEST   = @datadir@
 DOC_DEST     = $(SHARE_DEST)/doc/privoxy
 VAR_DEST     = @localstatedir@
@@ -152,6 +153,9 @@ DOC_STATUS = @DOC_STATUS@
 DOSFILTER  = $(PERL) -p -e 's/\n/\r\n/'
 CVSROOT    = :pserver:anonymous@ijbswa.cvs.sourceforge.net:/cvsroot/ijbswa
 #TMPDIR     := $(shell mktemp -d /tmp/$(PROGRAM).XXXXXX)
+# If your SF user name differs from your local one,
+# change this to "ssh -l sf-username"
+SSH    = ssh
 
 #############################################################################
 # Setup for make distribution for now.
@@ -172,7 +176,7 @@ CONFIG_FILES = $(CONFIGS) \
 DOC_FILES = AUTHORS LICENSE README ChangeLog INSTALL \
                `find doc/webserver/ -name "*.html" | grep -v "\(webserver\|team\)\/index\.html"` \
                `find doc/webserver/ -name "*.css"` \
-                privoxy.1
+                $(MAN_PAGE)
 
 #############################################################################
 # Filenames and libraries
@@ -270,8 +274,7 @@ PID_DEST check_doc install-strip uninstall GROUP_T
 # Strip master copy comments from default.action:
 #############################################################################
 default.action: default.action.master
-       $(GREP) -v '^#MASTER#' $< > $@
-
+       $(GREP) -v '^#MASTER#' default.action.master > $@
 #############################################################################
 # Win32 config files
 #############################################################################
@@ -452,13 +455,14 @@ dok-faq:
 # man page, one variation. Try to use the next target, just 'make man'. 
 dok-man: 
        $(RM) doc/man/* doc/webserver/man-page/*.html
-ifneq ($(MAN2HTML),false)
-       $(ECHO) "<html><head><title>Privoxy Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > doc/webserver/man-page/privoxy-man-page.html
-       man ./privoxy.1 | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html
-       $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html
-else
-       $(MAKE) groff2html
-endif
+       echo MAN2HTML is $(MAN2HTML)
+       @if [ $(MAN2HTML) != "false" ]; then \
+               $(ECHO) "<html><head><title>Privoxy Man page</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../p_web.css\"></head><body><H2>NAME</H2>" > doc/webserver/man-page/privoxy-man-page.html; \
+               man ./$(MAN_PAGE) | $(MAN2HTML) -bare >> doc/webserver/man-page/privoxy-man-page.html; \
+               $(ECHO) "</body></html>" >> doc/webserver/man-page/privoxy-man-page.html; \
+       else \
+               $(MAKE) groff2html; \
+       fi;
 
 # Build man page from sgml. This requires the SGMLSpm perl module.
 # See CPAN, or your favorite perl repository. This is the preferred 
@@ -466,35 +470,32 @@ endif
 man: dok-release
        mkdir -p doc/source/temp && cd doc/source/temp && $(RM) * ;\
        nsgmls ../privoxy-man-page.sgml  | sgmlspl ../../../utils/docbook2man/docbook2man-spec.pl &&\
-       perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' privoxy.1 ;\
-       perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" privoxy.1; \
-       perl -pi.bak -e "s/ö/\\\\[:o]/g" privoxy.1; \
-       perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' privoxy.1; \
-       perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' privoxy.1; \
-       perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' privoxy.1; \
-       $(DB) ../privoxy-man-page.sgml && $(MV) -f privoxy.1 ../../../privoxy.1
+       perl -pi.bak -e 's/ <URL:.*>//; s/\[ /\[/g' $(MAN_PAGE) ;\
+       perl -pi.bak -e "s/\[ /\[/g;s/á/\\\\['a]/g;s/é/\\\\['e]/g" $(MAN_PAGE); \
+       perl -pi.bak -e "s/ö/\\\\[:o]/g" $(MAN_PAGE); \
+       perl -pi.bak -e 's/([ {])-([a-z])/$$1\\-$$2/g' $(MAN_PAGE); \
+       perl -pi.bak -e 's/ --([a-z])/ \\-\\-$$1/g' $(MAN_PAGE); \
+       perl -pi.bak -e 's/\\fB--/\\fB\\-\\-/g' $(MAN_PAGE); \
+       $(DB) ../privoxy-man-page.sgml && $(MV) -f $(MAN_PAGE) ../../../$(MAN_PAGE)
 
 # For those with man2html ala RH7s.
 man2html:
        mkdir -p doc/webserver/man-page
-ifneq ($(MAN2HTML),false)
-       $(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
-       $(PERL) -pi.bak -e "s/\['a\]/\&aacute;/g;s/\['e\]/\&eacute;/g" tmp.html
-# Get rid of spurious \a from conversion. (How to do this with perl?)
-       $(SED) -e 's/\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*
-else
-       $(MAKE) groff2html
-endif
-
+       @if [ $(MAN2HTML) != "false" ]; then \
+               $(MAN2HTML) $(MAN_PAGE) |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; \
+               $(PERL) -pi.bak -e 's/(<A.*),(">)/$$1$$2/g' tmp.html; \
+               $(PERL) -pi.bak -e 's,\.">,">,g' tmp.html; \
+               $(PERL) -pi.bak -e "s/\['a\]/\&aacute;/g;s/\['e\]/\&eacute;/g" tmp.html; \
+               $(SED) -e 's/\a//g' tmp.html > doc/webserver/man-page/privoxy-man-page.html && $(RM) tmp.*; \
+       else \
+               $(MAKE) groff2html; \
+       fi;
 
 # Otherwise we get plain groff conversion.
 groff2html:
-       $(G2H_CMD) ./privoxy.1 | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
+       $(G2H_CMD) ./$(MAN_PAGE) | $(SED) -e 's@</head>@<link REL="STYLESHEET" TYPE="text/css" HREF="../p_doc.css"></head>@' > doc/webserver/man-page/privoxy-man-page.html
 
 
 # readme page and INSTALL file
@@ -545,19 +546,18 @@ dok-release:
      s/<!entity +p-status.*>/<!entity p-status "$(CODE_STATUS)">/' \
      doc/source/*sgml doc/source/*/*sgml
        $(RM) -r doc/source/*bak doc/source/*/*bak
-ifeq ($(CODE_STATUS),stable)
-       @$(ECHO) Setting docs to stable $(VERSION)
-       @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
-     s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
-     doc/source/*sgml doc/source/*/*sgml
-       $(RM) -r doc/source/*bak doc/source/*/*bak
-else
-       @$(ECHO) Setting docs to not stable $(VERSION)
-       @$(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/;\
-     s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
-     doc/source/*sgml doc/source/*/*sgml
-       $(RM) -r doc/source/*bak doc/source/*/*bak
-endif
+       @if [ $(CODE_STATUS) = "stable" ]; then \
+               $(ECHO) Setting docs to stable $(VERSION); \
+               $(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "INCLUDE">/;\
+                       s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "IGNORE">/' \
+               doc/source/*sgml doc/source/*/*sgml; \
+       else \
+               $(ECHO) Setting docs to not stable $(VERSION); \
+               $(PERL) -pi.bak -e 's/<!entity +% +p-stable.*>/<!entity % p-stable "IGNORE">/; \
+                       s/<!entity +% +p-not-stable.*>/<!entity % p-not-stable "INCLUDE">/' \
+               doc/source/*sgml doc/source/*/*sgml; \
+       fi;
+       $(RM) -r doc/source/*bak doc/source/*/*bak;
 
 # Create release announcement in text and html, with short and long versions.
 # This is a standalone target, and must be invoked directly.
@@ -609,33 +609,37 @@ config-file-alt:
 webserver: tidy
        @$(ECHO) -------------------------------------------------------
        @$(ECHO) You will need to "create" a SF shell first:
-       @$(ECHO)    ssh -t USER,PROJECT@shell.sourceforge.net create
+       @$(ECHO)    ssh -t SF-USER-ID,ijbswa@shell.sourceforge.net create
        @$(ECHO) Please make sure your documentation files are up to date.
-       @$(ECHO) Note that this command updates the home page and scp
+       @$(ECHO) Note that this command updates the home page and copy
        @$(ECHO) all stuff to the webserver, it will not remove obsolete documents.
-       @$(ECHO) You will also need to change the user-manual symlink manually.
+       @$(ECHO) Note that a botched upload can result in the documentation
+       @$(ECHO) on the website becoming unreachable! Also the CSS files
+       @$(ECHO) currently seem to end up at the wrong place.
        @$(ECHO) -------------------------------------------------------
 
+       @$(ECHO) Replacing the user-manual symlink
+       @$(SSH) shell.sourceforge.net "cd /home/groups/i/ij/ijbswa/htdocs && rm user-manual \
+        && mkdir -p $(VERSION)/user-manual && ln -s $(VERSION)/user-manual user-manual"
+
        @$(ECHO) Uploading html
        @cd doc/webserver; \
           upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
-          $(TAR) cf - $$upload | ssh shell.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp'
+          $(TAR) cf - $$upload | $(SSH) shell.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/; tar xvm 2>&1 | grep -v timestamp'
 
        @$(ECHO) Fixing permissions
-       @ssh shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
-       @ssh shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
-       @ssh shell.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null; true'
-
+       @$(SSH) shell.sourceforge.net 'chmod -R 775 /home/groups/i/ij/ijbswa/htdocs 2>/dev/null; true'
+       @$(SSH) shell.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/ -type f | xargs chmod 664 2>/dev/null; true'
 
 web-actions: tidy
        @$(ECHO) Uploading 
        @cd doc/webserver/actions; \
           upload=`find . -type f -a -not \( -path "*/CVS*" -o -path "*/results*" \)`; \
-          $(TAR) cf - $$upload | ssh ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm'
+          $(TAR) cf - $$upload | $(SSH) ijbswa.sourceforge.net 'cd /home/groups/i/ij/ijbswa/htdocs/actions; tar xvm'
 
        @$(ECHO) Fixing permissions
-       @ssh ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
-       @ssh ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null'
+       @$(SSH) ijbswa.sourceforge.net 'find /home/groups/i/ij/ijbswa/htdocs/actions/ -type f | xargs chmod 664 2>/dev/null'
+       @$(SSH) ijbswa.sourceforge.net 'chmod 666 /home/groups/i/ij/ijbswa/htdocs/actions/results/actions-feedback.txt 2>/dev/null'
 
 ## 
 dok-put:
@@ -645,7 +649,7 @@ dok-put:
                -czf $(DOC_FILE) ;\
                $(ECHO) "Uploading doc package ..." ;\
                scp $(DOC_FILE) ijbswa.sourceforge.net:/home/groups/i/ij/ijbswa/htdocs/docs/
-               @ssh ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true'
+               @$(SSH) ijbswa.sourceforge.net 'chmod 775 /home/groups/i/ij/ijbswa/htdocs/docs/*gz 2>/dev/null; true'
                $(RM) $(DOC_FILE)
 
 dok-get:
@@ -837,8 +841,8 @@ install: CONF_DEST LOG_DEST PID_DEST check_doc GROUP_T
                $(INSTALL) $(INSTALL_T) $(DOK_WEB)/p_doc.css $(DESTDIR)$$DOC/user-manual;\
        fi
        @# Not all platforms support gzipped man pages.
-       @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/privoxy.1
-       -$(INSTALL) $(INSTALL_T) privoxy.1  $(DESTDIR)$(MAN_DEST)/privoxy.1
+       @$(ECHO) Installing man page to $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)
+       -$(INSTALL) $(INSTALL_T) $(MAN_PAGE)  $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)
 
        @# Change the config file default directories according to the configured ones
        @$(ECHO) Rewriting config for this installation
@@ -986,7 +990,7 @@ uninstall: CONF_DEST LOG_DEST PID_DEST check_doc
 
        @# man page and docs
        @$(ECHO) Removing $(PROGRAM) docs
-       -$(RM) $(DESTDIR)$(MAN_DEST)/privoxy.1*
+       -$(RM) $(DESTDIR)$(MAN_DEST)/$(MAN_PAGE)*
        -$(RM) -r $(DESTDIR)$(DOC_DEST) || $(RM) -r $(DESTDIR)$(prefix)/doc/privoxy
 
        @# Log and pidfile