tests: remove remaining exec bits ('maint' branch)
[platform/upstream/automake.git] / t / installdir.sh
1 #! /bin/sh
2 # Copyright (C) 2001-2013 Free Software Foundation, Inc.
3 #
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.
8 #
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.
13 #
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/>.
16
17 # Test for PR 203.
18 # See also automake bug#11030.
19 #
20 # == Original Report for PR/203 ==
21 # Some standard targets are missing '-local' hooks.  For instance,
22 # installdirs is missing this.  Ideally this would be an automatic
23 # feature of any exported target.
24
25 . test-init.sh
26
27 echo AC_OUTPUT >> configure.ac
28
29 cat > Makefile.am << 'END'
30 foodir = $(datadir)/$(distdir)
31 installdirs-local:
32         $(MKDIR_P) $(DESTDIR)$(foodir)
33 install-data-hook: installdirs-local
34 END
35
36 $ACLOCAL
37 $AUTOMAKE
38
39 test $(grep -c installdirs-local Makefile.in) -eq 4
40
41 cwd=$(pwd) || fatal_ "getting current working directory"
42
43 $AUTOCONF
44 ./configure --prefix="$cwd/inst"
45
46 $MAKE installdirs
47 test -d inst/share/$me-1.0
48 rm -rf inst
49
50 $MAKE install
51 test -d inst/share/$me-1.0
52 rm -rf inst
53
54 ./configure --prefix=/foo
55
56 $MAKE installdirs DESTDIR="$cwd/dest"
57 test -d dest/foo/share/$me-1.0
58 rm -rf dest
59
60 $MAKE install DESTDIR="$cwd/dest"
61 test -d dest/foo/share/$me-1.0
62 rm -rf dest
63
64 :