summaryrefslogtreecommitdiff
path: root/t/notrans.sh
blob: 80324820179cb30a270041a6c0a0d9ec5bc4ff37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#! /bin/sh
# Copyright (C) 2008-2014 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
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# 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/>.

# Check all notrans_, dist_, nodist_ prefix combinations for MANS
# primary and install-man dependencies.

. test-init.sh

cat >>configure.ac <<'END'
AC_OUTPUT
END

cat > Makefile.am << 'EOF'
man_MANS = foo.1 foo2.1
dist_man_MANS = bar.2 bar2.2
nodist_man_MANS = baz.3 baz2.3
notrans_man_MANS = x-foo.4 x-foo2.4
notrans_dist_man_MANS = x-bar.5 x-bar2.5
notrans_nodist_man_MANS = x-baz.6 x-baz2.6
man7_MANS = y-foo.man y-foo2.man
dist_man5_MANS = y-bar.man y-bar2.man
nodist_man4_MANS = y-baz.man y-baz2.man
notrans_man3_MANS = z-foo.man z-foo2.man
notrans_dist_man2_MANS = z-bar.man z-bar2.man
notrans_nodist_man1_MANS = z-baz.man z-baz2.man

# These two are ignored.
dist_notrans_man_MANS = nosuch.8
nodist_notrans_man9_MANS = nosuch.man

y-foo.man y-foo2.man:
	: >$@
y-bar.man y-bar2.man:
	: >$@
y-baz.man y-baz2.man:
	: >$@
z-foo.man z-foo2.man:
	: >$@
z-bar.man z-bar2.man:
	: >$@
z-baz.man z-baz2.man:
	: >$@

test-install: install
	test -f inst/man/man1/gnu-foo.1
	test -f inst/man/man1/gnu-foo2.1
	test -f inst/man/man2/gnu-bar.2
	test -f inst/man/man2/gnu-bar2.2
	test -f inst/man/man3/gnu-baz.3
	test -f inst/man/man3/gnu-baz2.3
	test -f inst/man/man4/x-foo.4
	test -f inst/man/man4/x-foo2.4
	test -f inst/man/man5/x-bar.5
	test -f inst/man/man5/x-bar2.5
	test -f inst/man/man6/x-baz.6
	test -f inst/man/man6/x-baz2.6
	test -f inst/man/man7/gnu-y-foo.7
	test -f inst/man/man7/gnu-y-foo2.7
	test -f inst/man/man5/gnu-y-bar.5
	test -f inst/man/man5/gnu-y-bar2.5
	test -f inst/man/man4/gnu-y-baz.4
	test -f inst/man/man4/gnu-y-baz2.4
	test -f inst/man/man3/z-foo.3
	test -f inst/man/man3/z-foo2.3
	test -f inst/man/man2/z-bar.2
	test -f inst/man/man2/z-bar2.2
	test -f inst/man/man1/z-baz.1
	test -f inst/man/man1/z-baz2.1
	test ! -d inst/man/man8
	test ! -d inst/man/man9
EOF

: > foo.1
: > foo2.1
: > bar.2
: > bar2.2
: > baz.3
: > baz2.3
: > x-foo.4
: > x-foo2.4
: > x-bar.5
: > x-bar2.5
: > x-baz.6
: > x-baz2.6

$ACLOCAL
$AUTOCONF
$AUTOMAKE

grep '^install-man1:' Makefile.in | grep '\$(man_MANS)'
grep '^install-man2:' Makefile.in | grep '\$(dist_man_MANS)'
grep '^install-man3:' Makefile.in | grep '\$(nodist_man_MANS)'
grep '^install-man4:' Makefile.in | grep '\$(notrans_man_MANS)'
grep '^install-man5:' Makefile.in | grep '\$(notrans_dist_man_MANS)'
grep '^install-man6:' Makefile.in | grep '\$(notrans_nodist_man_MANS)'
grep '^install-man8:' Makefile.in && exit 1
grep '^install-man9:' Makefile.in && exit 1

cwd=$(pwd) || fatal_ "getting current working directory"

./configure --program-prefix=gnu- --prefix "$cwd"/inst \
                                  --mandir "$cwd"/inst/man
$MAKE
$MAKE test-install
test $(find inst/man -type f -print | wc -l) -eq 24
$MAKE uninstall
test $(find inst/man -type f -print | wc -l) -eq 0

# Opportunistically test for installdirs.
rm -rf inst
$MAKE installdirs
test -d inst/man/man1
test -d inst/man/man2
test -d inst/man/man3
test -d inst/man/man4
test -d inst/man/man5
test -d inst/man/man6
test -d inst/man/man7
test -d inst/man/man8 && exit 1
test -d inst/man/man9 && exit 1

: