2 # Copyright (C) 2011-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 # Check against automake bug#9579: distcheck does not always detect
18 # incomplete uninstall as advertised.
22 cat >> configure.ac << 'END'
26 # NOTE: the use of 'dir' as the name of the data file installed by hand
27 # is deliberate, and enhances coverage -- see definition and comments of
28 # lib/am/distdir.am:$(am__distuninstallcheck_listfiles).
30 cat > Makefile.am << 'END'
34 $(MKDIR_P) '$(DESTDIR)$(datadir)'
35 cp '$(srcdir)/dir' '$(DESTDIR)$(datadir)/dir'
45 ./configure --prefix="`pwd`/inst"
50 test -f inst/share/foo
51 test -f inst/share/dir
52 # We expect the uninstall target of our Makefile to be definitely broken.
54 test -f inst/share/dir
57 $MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
60 $FGREP 'ERROR: files left after uninstall:' output
61 grep '/share/dir *$' output
63 # A few trickier corner cases.
65 cat > Makefile.am << 'END'
69 $(MKDIR_P) '$(DESTDIR)$(prefix)/mu/share/info'
70 cp '$(srcdir)/dir' '$(DESTDIR)$(prefix)/mu/share/info'
71 $(MKDIR_P) '$(DESTDIR)$(infodir)/more'
72 cp '$(srcdir)/dir' '$(DESTDIR)$(infodir)/more'
76 ./config.status Makefile
78 # Sanity checks, again.
81 test -f inst/mu/share/info/dir
82 test -f inst/share/info/more/dir
83 # We expect the uninstall target of our Makefile to be definitely broken.
85 test -f inst/mu/share/info/dir
86 test -f inst/share/info/more/dir
89 $MAKE distcheck >output 2>&1 && { cat output; Exit 1; }
92 $FGREP 'ERROR: files left after uninstall:' output
93 grep '/mu/share/info/dir *$' output
94 grep '/share/info/more/dir *$' output