2 # Copyright (C) 2008-2012 Free Software Foundation, Inc.
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)
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.
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/>.
17 # Ensure 'make dist' fails when help2man replacement man pages are created.
19 # The assumption here is the following: if the developer uses help2man to
20 # generate man pages from --help output, then these man pages may not be
21 # stored in VCS. However, they should be distributed, so that the end user
22 # that receives the tarball doesn't have to install help2man. If they are
23 # not distributed, then the developer should make help2man a prerequisite
24 # to building the package from a tarball, e.g., with a configure check for
25 # help2man that errors out if it is unavailable. In both cases it is
26 # sufficient to check only distributed man pages.
28 # Idea of this whole shenanigan is to allow somebody to check out sources from
29 # a VCS and build and install them without needing help2man installed. The
30 # installed man pages will be bogus in this case. Typically, this happens
31 # when developers ask users to try out a fix from VCS; the developers themselves
32 # will usually have help2man installed (or should install it).
36 cat > Makefile.am
<< 'END'
37 dist_man_MANS
= $
(srcdir
)/foo
.1 bar
.1
38 dist_bin_SCRIPTS
= foo bar
40 $
(HELP2MAN
) --output=$@ $
(srcdir
)/foo
42 $
(HELP2MAN
) --output=$
(srcdir
)/bar
.1 $
(srcdir
)/bar
45 cat >>configure.ac
<<'END'
46 AM_MISSING_PROG([HELP2MAN], [help2man])
52 while test $# -gt 0; do
54 -h | --help) echo "usage: $0 [OPTIONS]..."; exit 0;;
55 -v | --version) echo "$0 1.0"; exit 0;;
64 cat > bin
/help2man
<<'END'
66 # Fake help2man script that lets 'missing' think it is not installed.
70 PATH
=$
(pwd)/bin
$PATH_SEPARATOR$PATH
74 grep ' man pages contain.*missing help2man.* replacement text' stderr \
75 && grep 'install help2man' stderr \
76 && grep 'regenerate the man pages' stderr \
86 $MAKE dist
2>stderr
&& { cat stderr
>&2; exit 1; }
89 $MAKE distcheck
2>stderr
&& { cat stderr
>&2; exit 1; }
98 $MAKE dist
2>stderr
&& { cat stderr
>&2; exit 1; }
101 $MAKE distcheck
2>stderr
&& { cat stderr
>&2; exit 1; }