doc: update Vala documentation
[automake.git] / t / java-uninstall.sh
blob8eed3b5ef9ac5d8b993a650ce0d6db1e0ed66b90
1 #! /bin/sh
2 # Copyright (C) 1998-2024 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 # Check uninstallation of Java class files.
19 required=javac
20 . test-init.sh
22 cat >> configure.ac << 'END'
23 AC_OUTPUT
24 END
26 cat > Makefile.am << 'END'
27 javadir = $(prefix)/java
28 java_JAVA = Foo.java
29 nobase_java_JAVA = Foo2.java
30 nobase_dist_java_JAVA = Bar.java
31 nodist_java_JAVA = Baz.java
33 # Java files are not distributed by default, so we distribute
34 # one "by hand" ...
35 EXTRA_DIST = Foo.java
36 # ... and make the other one generated.
37 Foo2.java:
38 rm -f $@ $@-t
39 echo 'class bClass {}' > $@-t
40 chmod a-w $@-t && mv -f $@-t $@
42 # Explicitly declared as 'nodist_', so generate it.
43 Baz.java:
44 rm -f $@ $@-t
45 echo 'class Baz {}' > $@-t
46 echo 'class Baz2 {}' >> $@-t
47 chmod a-w $@-t && mv -f $@-t $@
49 DISTCLEANFILES = Baz.java Foo2.java
51 # Tell GNU make not to parallelize, since the tests can result in, for example:
52 # /usr/bin/install: cannot create regular file '/u/karl/gnu/src/akarl/t/java-uninstall.dir/java-uninstall-1.0/_inst/java/Baz.class': File exists
53 # No evident way to debug or reliably reproduce.
54 .NOTPARALLEL:
55 END
57 echo 'class aClass {}' > Foo.java
58 echo 'class Zardoz {}' > Bar.java
60 $ACLOCAL
61 $AUTOCONF
62 $AUTOMAKE
64 ./configure --prefix="$(pwd)"/_inst
65 javadir=_inst/java
67 check_uninstallation()
69 test ! -e $javadir/aClass.class
70 test ! -e $javadir/bClass.class
71 test ! -e $javadir/Zardoz.class
72 test ! -e $javadir/Baz.class
73 test ! -e $javadir/Baz2.class
74 test -f $javadir/Foo.class
75 test -f $javadir/Bar.class
76 test -f $javadir/xClass.class
79 $MAKE
80 ls -l
81 $MAKE install
82 : > $javadir/Foo.class
83 : > $javadir/Bar.class
84 : > $javadir/xClass.class
85 ls -l $javadir
86 $MAKE uninstall
87 ls -l $javadir
88 check_uninstallation
90 # FIXME: "make uninstall" should continue to work also after "make clean",
91 # but currently this doesn't happen. See automake bug#8540.
92 $MAKE install
93 ls -l $javadir
94 $MAKE clean
95 ls -l
96 $MAKE uninstall
97 ls -l $javadir
98 #check_uninstallation
100 $MAKE distcheck