delete trailing whitespace from control files
[debian/gzip] / build-aux / gendocs.sh
index 1d1e1e7099503901cd954c4af87ba1cb4bb397f7..91c058dc76d0b5b9c7a3b467e892c2abc9b8938c 100755 (executable)
@@ -2,9 +2,9 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2016-01-01.00
+scriptversion=2018-03-06.19
 
-# Copyright 2003-2016 Free Software Foundation, Inc.
+# Copyright 2003-2018 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ scriptversion=2016-01-01.00
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # Original author: Mohit Agarwal.
 # Send bug reports and any other correspondence to bug-gnulib@gnu.org.
@@ -25,8 +25,8 @@ scriptversion=2016-01-01.00
 # The latest version of this script, and the companion template, is
 # available from the Gnulib repository:
 #
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
+# https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
+# https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
 
 # TODO:
 # - image importing was only implemented for HTML generated by
@@ -37,8 +37,8 @@ scriptversion=2016-01-01.00
 prog=`basename "$0"`
 srcdir=`pwd`
 
-scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
-templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
+scripturl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
+templateurl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
 
 : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
 : ${MAKEINFO="makeinfo"}
@@ -52,9 +52,28 @@ templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_templ
 unset CDPATH
 unset use_texi2html
 
+MANUAL_TITLE=
+PACKAGE=
+EMAIL=webmasters@gnu.org  # please override with --email
+commonarg= # passed to all makeinfo/texi2html invcations.
+dirargs=   # passed to all tools (-I dir).
+dirs=      # -I directories.
+htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+default_htmlarg=true
+infoarg=--no-split
+generate_ascii=true
+generate_html=true
+generate_info=true
+generate_tex=true
+outdir=manual
+source_extra=
+split=node
+srcfile=
+texarg="-t @finalout"
+
 version="gendocs.sh $scriptversion
 
-Copyright 2016 Free Software Foundation, Inc.
+Copyright 2018 Free Software Foundation, Inc.
 There is NO warranty.  You may redistribute this software
 under the terms of the GNU General Public License.
 For more information about these matters, see the files named COPYING."
@@ -64,7 +83,7 @@ usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
 Generate output in various formats from PACKAGE.texinfo (or .texi or
 .txi) source.  See the GNU Maintainers document for a more extensive
 discussion:
-  http://www.gnu.org/prep/maintain_toc.html
+  https://www.gnu.org/prep/maintain_toc.html
 
 Options:
   --email ADR use ADR as contact in generated web pages; always give this.
@@ -74,7 +93,7 @@ Options:
   -I DIR       append DIR to the Texinfo search path.
   --common ARG pass ARG in all invocations.
   --html ARG   pass ARG to makeinfo or texi2html for HTML targets,
-                 instead of --css-ref=/software/gnulib/manual.css.
+                 instead of '$htmlarg'.
   --info ARG   pass ARG to makeinfo for Info, instead of --no-split.
   --no-ascii   skip generating the plain text output.
   --no-html    skip generating the html output.
@@ -137,24 +156,6 @@ SETLANG setting in the source.
 Email bug reports or enhancement requests to bug-gnulib@gnu.org.
 "
 
-MANUAL_TITLE=
-PACKAGE=
-EMAIL=webmasters@gnu.org  # please override with --email
-commonarg= # passed to all makeinfo/texi2html invcations.
-dirargs=   # passed to all tools (-I dir).
-dirs=      # -I directories.
-htmlarg=--css-ref=/software/gnulib/manual.css
-infoarg=--no-split
-generate_ascii=true
-generate_html=true
-generate_info=true
-generate_tex=true
-outdir=manual
-source_extra=
-split=node
-srcfile=
-texarg="-t @finalout"
-
 while test $# -gt 0; do
   case $1 in
     -s)          shift; srcfile=$1;;
@@ -163,7 +164,7 @@ while test $# -gt 0; do
     --common)    shift; commonarg=$1;;
     --docbook)   docbook=yes;;
     --email)     shift; EMAIL=$1;;
-    --html)      shift; htmlarg=$1;;
+    --html)      shift; default_htmlarg=false; htmlarg=$1;;
     --info)      shift; infoarg=$1;;
     --no-ascii)  generate_ascii=false;;
     --no-html)   generate_ascii=false;;
@@ -199,6 +200,11 @@ commonarg=" $dirargs $commonarg"
 # For most of the following, the base name is just $PACKAGE
 base=$PACKAGE
 
+if $default_htmlarg && test -n "$use_texi2html"; then
+  # The legacy texi2html doesn't support TOP_NODE_UP_URL
+  htmlarg="--css-ref=/software/gnulib/manual.css"
+fi
+
 if test -n "$srcfile"; then
   # but here, we use the basename of $srcfile
   base=`basename "$srcfile"`
@@ -497,7 +503,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
 echo "Done, see $outdir/ subdirectory for new files."
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-end: "$"