Added SILC Thread Queue API
[silc.git] / apps / autodist / tests / autodist2.test
1 #!/bin/sh
2
3 AUTODIST=../../autodist
4
5 rm -rf test
6 mkdir test
7
8 cd test || exit 1
9
10 chmod +x $AUTODIST || exit 1
11
12 cat << EOF > configure.ad
13 AD_INIT
14 #ifdef _DIST_TEST
15 AC_CANONICAL_BUILD
16 AM_INIT_AUTOMAKE
17 AC_PREREQ(2.52)
18 AC_CONFIG_HEADERS(config.h)
19 AD_INCLUDE_CONFIGURE
20 AC_CONFIG_FILES(
21 Makefile
22 )
23 AC_OUTPUT
24 echo configure.ad ok
25 #else !_DIST_TEST
26 echo "ERROR"
27 exit 1
28 #endif _DIST_TEST
29 EOF
30
31 cat << EOF > Makefile.ad
32 SUBDIRS=        \\
33 #ifndef _DIST_TEST
34         nodef   \\
35 #endif _DIST_TEST
36         .       \\
37
38 EOF
39
40 rm -rf distdir subdir
41 mkdir -p subdir || exit 1
42
43 cat << EOF > subdir/configure.ad
44 # subdir/configure.ad fragment
45 #ifndef _DIST_NODEF
46 #ifdef _DIST_TEST
47 echo "_DIST_NODEF ok"
48 #endif _DIST_TEST
49 #endif _DIST_NODEF
50 EOF
51
52 $AUTODIST -i || exit 1
53 if test '!' -d distdir; then
54   echo "error: distdir/ does no exist"
55   exit 1
56 fi 
57
58 cp -p ../../default distdir || exit 1
59 cp -p ../../autodist.conf distdir || exit 1
60
61 cat << EOF > distdir/test
62 name Test Distribution
63 package test-distro
64 bug-report test-dist@test.org
65 define _DIST_TEST
66 EOF
67
68 touch README NEWS AUTHORS ChangeLog
69
70 echo "inherit test" >> distdir/default
71
72 $AUTODIST || exit 1
73 $AUTODIST test 1.0 || exit 1
74
75 ./configure || exit 1
76 make || exit 1
77 echo make ok
78
79 $AUTODIST -m || exit 1
80
81 if test '!' -f test-distro-1.0.tar.gz; then
82   echo "error: makedist failed"
83   exit 1
84 fi
85
86 echo test ok
87
88 # Cleanup
89 rm -rf subdir distdir
90