notrans.sh 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. #! /bin/sh
  2. # Copyright (C) 2008-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 all notrans_, dist_, nodist_ prefix combinations for MANS
  17. # primary and install-man dependencies.
  18. . test-init.sh
  19. cat >>configure.ac <<'END'
  20. AC_OUTPUT
  21. END
  22. cat > Makefile.am << 'EOF'
  23. man_MANS = foo.1 foo2.1
  24. dist_man_MANS = bar.2 bar2.2
  25. nodist_man_MANS = baz.3 baz2.3
  26. notrans_man_MANS = x-foo.4 x-foo2.4
  27. notrans_dist_man_MANS = x-bar.5 x-bar2.5
  28. notrans_nodist_man_MANS = x-baz.6 x-baz2.6
  29. man7_MANS = y-foo.man y-foo2.man
  30. dist_man5_MANS = y-bar.man y-bar2.man
  31. nodist_man4_MANS = y-baz.man y-baz2.man
  32. notrans_man3_MANS = z-foo.man z-foo2.man
  33. notrans_dist_man2_MANS = z-bar.man z-bar2.man
  34. notrans_nodist_man1_MANS = z-baz.man z-baz2.man
  35. # These two are ignored.
  36. dist_notrans_man_MANS = nosuch.8
  37. nodist_notrans_man9_MANS = nosuch.man
  38. y-foo.man y-foo2.man:
  39. : >$@
  40. y-bar.man y-bar2.man:
  41. : >$@
  42. y-baz.man y-baz2.man:
  43. : >$@
  44. z-foo.man z-foo2.man:
  45. : >$@
  46. z-bar.man z-bar2.man:
  47. : >$@
  48. z-baz.man z-baz2.man:
  49. : >$@
  50. test-install: install
  51. test -f inst/man/man1/gnu-foo.1
  52. test -f inst/man/man1/gnu-foo2.1
  53. test -f inst/man/man2/gnu-bar.2
  54. test -f inst/man/man2/gnu-bar2.2
  55. test -f inst/man/man3/gnu-baz.3
  56. test -f inst/man/man3/gnu-baz2.3
  57. test -f inst/man/man4/x-foo.4
  58. test -f inst/man/man4/x-foo2.4
  59. test -f inst/man/man5/x-bar.5
  60. test -f inst/man/man5/x-bar2.5
  61. test -f inst/man/man6/x-baz.6
  62. test -f inst/man/man6/x-baz2.6
  63. test -f inst/man/man7/gnu-y-foo.7
  64. test -f inst/man/man7/gnu-y-foo2.7
  65. test -f inst/man/man5/gnu-y-bar.5
  66. test -f inst/man/man5/gnu-y-bar2.5
  67. test -f inst/man/man4/gnu-y-baz.4
  68. test -f inst/man/man4/gnu-y-baz2.4
  69. test -f inst/man/man3/z-foo.3
  70. test -f inst/man/man3/z-foo2.3
  71. test -f inst/man/man2/z-bar.2
  72. test -f inst/man/man2/z-bar2.2
  73. test -f inst/man/man1/z-baz.1
  74. test -f inst/man/man1/z-baz2.1
  75. test ! -d inst/man/man8
  76. test ! -d inst/man/man9
  77. EOF
  78. : > foo.1
  79. : > foo2.1
  80. : > bar.2
  81. : > bar2.2
  82. : > baz.3
  83. : > baz2.3
  84. : > x-foo.4
  85. : > x-foo2.4
  86. : > x-bar.5
  87. : > x-bar2.5
  88. : > x-baz.6
  89. : > x-baz2.6
  90. $ACLOCAL
  91. $AUTOCONF
  92. $AUTOMAKE
  93. grep '^install-man1:' Makefile.in | grep '\$(man_MANS)'
  94. grep '^install-man2:' Makefile.in | grep '\$(dist_man_MANS)'
  95. grep '^install-man3:' Makefile.in | grep '\$(nodist_man_MANS)'
  96. grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
  97. grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
  98. grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
  99. grep '^install-man8:' Makefile.in && exit 1
  100. grep '^install-man9:' Makefile.in && exit 1
  101. cwd=$(pwd) || fatal_ "getting current working directory"
  102. ./configure --program-prefix=gnu- --prefix "$cwd"/inst \
  103. --mandir "$cwd"/inst/man
  104. $MAKE
  105. $MAKE test-install
  106. test $(find inst/man -type f -print | wc -l) -eq 24
  107. $MAKE uninstall
  108. test $(find inst/man -type f -print | wc -l) -eq 0
  109. # Opportunistically test for installdirs.
  110. rm -rf inst
  111. $MAKE installdirs
  112. test -d inst/man/man1
  113. test -d inst/man/man2
  114. test -d inst/man/man3
  115. test -d inst/man/man4
  116. test -d inst/man/man5
  117. test -d inst/man/man6
  118. test -d inst/man/man7
  119. test -d inst/man/man8 && exit 1
  120. test -d inst/man/man9 && exit 1
  121. :