2 # Copyright (C) 2006-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 # Test to ensure 'distdir' fixes the mode of files and directories
18 # copied into '$(distdir)', even with sub-packages.
22 cat >Makefile.am
<<'END'
24 test-distdir-is-readable:
25 bad_dirs=`find $(distdir) -type d ! -perm -755 -print`; \
26 if test -n "$$bad_dirs"; then \
27 echo "directories not permissive: $$bad_dirs" >&2; \
30 bad_files=`find $(distdir) ! -type d ! -perm -444 -print`; \
31 if test -n "$$bad_files"; then \
32 echo "file not permissive: $$bad_files" >&2; \
37 cat >>configure.ac
<<'END'
38 AC_CONFIG_SUBDIRS([subpkg])
42 mkdir subpkg subpkg
/dir
43 echo foobar
>subpkg
/foobar
44 echo baz
> subpkg
/dir
/baz
46 chmod go-rwx subpkg
/foobar subpkg
/dir
/baz subpkg
/dir
48 cat >subpkg
/Makefile.am
<<'END'
49 EXTRA_DIST = foobar dir
52 cat >subpkg
/configure.ac
<<'END'
53 AC_INIT([subpkg], [1.0])
55 AC_CONFIG_FILES([Makefile])
71 $MAKE test-distdir-is-readable