3 # Copy our sources and configuration, but change the installation
4 # prefix so that we can test with a completely independent
7 # Get full pathnames that we'll need. Assumes that this script is
8 # located in the nmh test subdirectory.
11 srcdir=`dirname $testdir`
12 builddir=$testdir/testbuild
13 installdir=$testdir/testinstall
16 [ -d $builddir ] || mkdir -p $builddir
19 #### Expedient way to copy the sources and configuration.
20 if rsync -h >/dev/null 2>&1; then
21 rsync -a $srcdir/ --exclude .git --exclude test --exclude .deps \
22 --exclude '*.gz' --exclude '*.*o' .
24 (cd $srcdir && tar cf - \
25 `find . -name .git -prune -o -name test -prune -o -name .deps -prune -o \
26 \( ! -type d ! -name '*.gz' ! -name '*.*o' -print \)`) | \
30 #### Set up new configuration.
31 #### Put it in a file so we don't have to mess with shell quoting. It
32 #### would get tricky with configure options that can contain embedded
33 #### spaces, such as --enable-masquerade and --with-smtpservers.
34 reconfig=reconfig-for-test
35 echo 'set '/bin/sh' './configure' \' > $reconfig
36 #### Configure allows multiple --prefix but ignores all but the last.
37 #### So add the one we want to use. This is easier than trying to change
38 #### an existing --prefix, esp. if it has quoted characters.
39 echo $(./config.status --config) \'--prefix="$installdir"\' >> $reconfig
40 echo 'exec "$@"' >> $reconfig
42 echo configuring the test installation in "$installdir" . . .
43 /bin/sh $reconfig > /dev/null
45 echo building the test installation . . .
46 make install > /dev/null