2
0

man6.sh 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #! /bin/sh
  2. # Copyright (C) 2010-2017 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 <http://www.gnu.org/licenses/>.
  16. # Ensure 'make distcheck' passes when help2man generates man pages,
  17. # even if the 'missing' script is involved.
  18. required=help2man
  19. . test-init.sh
  20. # Avoid a spurious failure due to a known FreeBSD make incompatibility.
  21. useless_vpath_rebuild \
  22. && skip_ "VPATH useless rebuild detected (see bug#7884)"
  23. cat > Makefile.am << 'END'
  24. dist_man_MANS = $(srcdir)/foobar.1 bazquux.1 zardoz.1
  25. dist_bin_SCRIPTS = foobar bazquux zardoz
  26. $(srcdir)/foobar.1:
  27. $(HELP2MAN) --output=$@ $(srcdir)/foobar
  28. bazquux.1:
  29. $(HELP2MAN) --output=$@ $(srcdir)/bazquux
  30. zardoz.1:
  31. $(HELP2MAN) --output=$(srcdir)/zardoz.1 $(srcdir)/zardoz
  32. END
  33. cat >> configure.ac <<'END'
  34. AM_MISSING_PROG([HELP2MAN], [help2man])
  35. AC_OUTPUT
  36. END
  37. cat > foobar <<'END'
  38. #! /bin/sh
  39. while test $# -gt 0; do
  40. case $1 in
  41. -h | --help) echo "usage: $0 [OPTIONS]..."; exit 0;;
  42. -v | --version) echo "$0 1.0"; exit 0;;
  43. esac
  44. shift
  45. done
  46. END
  47. cp foobar bazquux
  48. cp foobar zardoz
  49. chmod +x foobar bazquux zardoz
  50. $ACLOCAL
  51. $AUTOMAKE
  52. $AUTOCONF
  53. mkdir build
  54. cd build
  55. ../configure
  56. # Sanity check.
  57. grep '^HELP2MAN *=.*/missing help2man' Makefile
  58. $MAKE
  59. $FGREP foobar ../foobar.1
  60. $FGREP bazquux ./bazquux.1
  61. $FGREP zardoz ../zardoz.1
  62. $MAKE distdir
  63. $FGREP foobar $me-1.0/foobar.1
  64. $FGREP bazquux $me-1.0/bazquux.1
  65. $FGREP zardoz $me-1.0/zardoz.1
  66. $MAKE distcheck
  67. cd ..
  68. rm -f *.1 # Remove leftover generated manpages.
  69. ./configure
  70. # Sanity check.
  71. grep '^HELP2MAN *=.*/missing help2man' Makefile
  72. $MAKE
  73. $FGREP foobar foobar.1
  74. $FGREP bazquux bazquux.1
  75. $FGREP zardoz zardoz.1
  76. $MAKE distdir
  77. $FGREP foobar $me-1.0/foobar.1
  78. $FGREP bazquux $me-1.0/bazquux.1
  79. $FGREP zardoz $me-1.0/zardoz.1
  80. $MAKE distcheck
  81. :