2
0

distcheck-override-infodir.sh 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #! /bin/sh
  2. # Copyright (C) 2011-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. # Check that we can override ${infodir} while having distcheck still
  17. # working. Related to automake bug#9579.
  18. required='makeinfo tex texi2dvi install-info'
  19. . test-init.sh
  20. cat >> configure.ac << 'END'
  21. AC_OUTPUT
  22. END
  23. cat > Makefile.am << 'END'
  24. infodir = ${prefix}/blah/blah/foobar
  25. info_TEXINFOS = main.texi
  26. ## Sanity check.
  27. installcheck-local:
  28. if test x$${infodir+set} != xset; then \
  29. ls -l "$(DESTDIR)$(prefix)/blah/blah/foobar/" || exit 1; \
  30. test -f "$(DESTDIR)$(prefix)/blah/blah/foobar/dir" || exit 1; \
  31. else \
  32. ls -l "$(DESTDIR)$$infodir/" || exit 1; \
  33. test -f "$(DESTDIR)$$infodir/dir" || exit 1; \
  34. fi
  35. END
  36. # Protect with leading " # " to avoid spurious maintainer-check failures.
  37. sed 's/^ *# *//' > main.texi << 'END'
  38. # \input texinfo
  39. # @setfilename main.info
  40. # @settitle main
  41. #
  42. # @c Explicit calls to @dircategory and @direntry required to ensure that
  43. # @c a 'dir' file will be created also by older versions of 'install-info'
  44. # @c (e.g., the one coming with Texinfo 4.8).
  45. #
  46. # @dircategory Software development
  47. # @direntry
  48. # * Automake: (automake). Making GNU standards-compliant Makefiles
  49. # @end direntry
  50. #
  51. # @dircategory Individual utilities
  52. # @direntry
  53. # * aclocal-invocation: (automake)aclocal Invocation. Generating aclocal.m4
  54. # * automake-invocation: (automake)automake Invocation. Generating Makefile.in
  55. # @end direntry
  56. #
  57. # @node Top
  58. # Hello walls.
  59. # @bye
  60. END
  61. $ACLOCAL
  62. $AUTOMAKE -a
  63. $AUTOCONF
  64. ./configure
  65. $MAKE
  66. $MAKE distcheck
  67. run_make infodir="$(pwd)/_info" distcheck
  68. test -f _info/dir || exit 99 # Sanity check.
  69. :