Merge branch 'minor'
[automake.git] / t / subpkg4.sh
blobcb76e5281d796dc46a58221e3365b4656efc7cd5
1 #! /bin/sh
2 # Copyright (C) 2006-2017 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)
7 # any later version.
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 <https://www.gnu.org/licenses/>.
17 # Test to ensure 'distdir' fixes the mode of files and directories
18 # copied into '$(distdir)', even with sub-packages.
20 . test-init.sh
22 cat >Makefile.am <<'END'
23 SUBDIRS = subpkg
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; \
28 exit 1; \
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; \
33 exit 1; \
35 END
37 cat >>configure.ac <<'END'
38 AC_CONFIG_SUBDIRS([subpkg])
39 AC_OUTPUT
40 END
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
50 END
52 cat >subpkg/configure.ac <<'END'
53 AC_INIT([subpkg], [1.0])
54 AM_INIT_AUTOMAKE
55 AC_CONFIG_FILES([Makefile])
56 AC_OUTPUT
57 END
59 $ACLOCAL
60 $AUTOMAKE
61 $AUTOCONF
63 cd subpkg
64 $ACLOCAL
65 $AUTOMAKE
66 $AUTOCONF
67 cd ..
69 ./configure
70 $MAKE distdir
71 $MAKE test-distdir-is-readable