"Fossies" - the Fresh Open Source Software Archive

Member "automake-1.16.3/t/man6.sh" (19 Nov 2020, 2529 Bytes) of package /linux/misc/automake-1.16.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "man6.sh": 1.16.2_vs_1.16.3.

    1 #! /bin/sh
    2 # Copyright (C) 2010-2020 Free Software Foundation, Inc.
    3 #
    4 # This program is free software; you can redistribute it and/or modify
    5 # it under the terms of the GNU General Public License as published by
    6 # the Free Software Foundation; either version 2, or (at your option)
    7 # any later version.
    8 #
    9 # This program is distributed in the hope that it will be useful,
   10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   12 # GNU General Public License for more details.
   13 #
   14 # You should have received a copy of the GNU General Public License
   15 # along with this program.  If not, see <https://www.gnu.org/licenses/>.
   16 
   17 # Ensure 'make distcheck' passes when help2man generates man pages,
   18 # even if the 'missing' script is involved.
   19 
   20 required=help2man
   21 . test-init.sh
   22 
   23 # Avoid a spurious failure due to a known FreeBSD make incompatibility.
   24 useless_vpath_rebuild \
   25   && skip_ "VPATH useless rebuild detected (see bug#7884)"
   26 
   27 cat > Makefile.am << 'END'
   28 dist_man_MANS = $(srcdir)/foobar.1 bazquux.1 zardoz.1
   29 dist_bin_SCRIPTS = foobar bazquux zardoz
   30 $(srcdir)/foobar.1:
   31     $(HELP2MAN) --output=$@ $(srcdir)/foobar
   32 bazquux.1:
   33     $(HELP2MAN) --output=$@ $(srcdir)/bazquux
   34 zardoz.1:
   35     $(HELP2MAN) --output=$(srcdir)/zardoz.1 $(srcdir)/zardoz
   36 END
   37 
   38 cat >> configure.ac <<'END'
   39 AM_MISSING_PROG([HELP2MAN], [help2man])
   40 AC_OUTPUT
   41 END
   42 
   43 cat > foobar <<'END'
   44 #! /bin/sh
   45 while test $# -gt 0; do
   46   case $1 in
   47     -h | --help) echo "usage: $0 [OPTIONS]..."; exit 0;;
   48     -v | --version) echo "$0 1.0"; exit 0;;
   49   esac
   50   shift
   51 done
   52 END
   53 
   54 cp foobar bazquux
   55 cp foobar zardoz
   56 
   57 chmod +x foobar bazquux zardoz
   58 
   59 $ACLOCAL
   60 $AUTOMAKE
   61 $AUTOCONF
   62 
   63 mkdir build
   64 cd build
   65 
   66 ../configure
   67 # Sanity check. The line we're matching looks like this:
   68 #   HELP2MAN = ${SHELL} '/am/checkout/t/man6.dir/missing' help2man
   69 # so let's not try to match the exact intervening quote.
   70 grep '^HELP2MAN *=.*/missing.* help2man' Makefile
   71 
   72 $MAKE
   73 $FGREP foobar ../foobar.1
   74 $FGREP bazquux ./bazquux.1
   75 $FGREP zardoz ../zardoz.1
   76 
   77 $MAKE distdir
   78 $FGREP foobar  $me-1.0/foobar.1
   79 $FGREP bazquux $me-1.0/bazquux.1
   80 $FGREP zardoz  $me-1.0/zardoz.1
   81 
   82 $MAKE distcheck
   83 
   84 cd ..
   85 rm -f *.1 # Remove leftover generated manpages.
   86 
   87 ./configure
   88 # Sanity check again, same as above.
   89 grep '^HELP2MAN *=.*/missing.* help2man' Makefile
   90 
   91 $MAKE
   92 $FGREP foobar  foobar.1
   93 $FGREP bazquux bazquux.1
   94 $FGREP zardoz  zardoz.1
   95 
   96 $MAKE distdir
   97 $FGREP foobar  $me-1.0/foobar.1
   98 $FGREP bazquux $me-1.0/bazquux.1
   99 $FGREP zardoz  $me-1.0/zardoz.1
  100 
  101 $MAKE distcheck
  102 
  103 :