checkin of 0.3.0
[pspp-builds.git] / sysdeps / borlandc5.0 / mk-bc5-dist
1 #! /bin/sh -e
2
3 # This script makes a source distribution for compilation under
4 # Borland C++ 5.0.  It also produces a .iwz file for use with
5 # InstallShield Express.
6
7 if test "$1" = ""; then
8   echo "usage: $0 \'DOS-path-to-PSPP-source\' \'DOS-path-to-Borland-C++-5.0-root\'"
9 fi
10
11 test -f src/q2c.c || (echo "Not in PSPP source directory" && exit 1)
12
13 make distdir
14
15 DOSROOT="$1"
16 VERSION=`sed -ne 's/^.*\[//;s/].*$//;/^[0-9]*\.[0-9]*\.[0-9]*$/p' < configure.in`
17 BC5ROOT=`pwd`/pspp-$VERSION-bc5
18 DISTROOT=`pwd`
19
20 rm -rf $BC5ROOT
21 cp -r pspp-$VERSION $BC5ROOT
22 rm -f $DISTROOT/manualfiles.tmp
23 rm -f $DISTROOT/testsfiles.tmp
24
25 cd $BC5ROOT/doc
26 texi2html -number -monolithic FAQ.texi
27
28 mkdir $BC5ROOT/manual
29 cd $BC5ROOT/manual
30 texi2html -menu -number -split_node ../doc/pspp.texi
31 cp pspp_toc.html index.html
32
33 n_manual=0
34 for d in *; do
35   n_manual=`expr $n_manual + 1`
36   echo "Group5File$n_manual=${DOSROOT}\\MANUAL\\$d" >> $DISTROOT/manualfiles.tmp
37 done
38
39 cd $BC5ROOT/tests
40 n_tests=0
41 for d in *; do
42   n_tests=`expr $n_tests + 1`
43   echo "Group3File$n_tests=${DOSROOT}\\TESTS\\$d" >> $DISTROOT/testsfiles.tmp
44 done
45
46 SEDDOSROOT=`echo "$1" | sed 's/\\\\/\\\\\\\\/'`
47 echo "s%@BASEDIR@%$SEDDOSROOT%g" > $DISTROOT/bc5.sed
48 SEDBC5BASEDIR=`echo "$2" | sed 's/\\\\/\\\\\\\\/'`
49 echo "s%@BC5BASEDIR@%$SEDBC5BASEDIR%g" >> $DISTROOT/bc5.sed
50 echo "s%@MANUALCOUNT@%$n_manual%g" >> $DISTROOT/bc5.sed
51 echo "s%@TESTSCOUNT@%$n_tests%g" >> $DISTROOT/bc5.sed
52
53 IN=$BC5ROOT/sysdeps/borlandc5.0/pspp.iwz.in
54 OUT=$BC5ROOT/pspp.iwz
55 sed -n -f $DISTROOT/bc5.sed -e '1,/^Group3Dir/p' < $IN > $OUT
56 cat $DISTROOT/testsfiles.tmp >> $OUT
57 sed -n -f $DISTROOT/bc5.sed -e '/^Group4Size/,/^Group5Dir/p' < $IN >> $OUT
58 cat $DISTROOT/manualfiles.tmp < $IN >> $OUT
59 sed -n -f $DISTROOT/bc5.sed -e '/^Group5Size/,$p' < $IN >> $OUT
60
61 cp $BC5ROOT/sysdeps/borlandc5.0/pspp.ide $BC5ROOT/pspp.ide
62 cp $BC5ROOT/pref.h.orig $BC5ROOT/sysdeps/borlandc5.0/pref.h
63
64 rm $DISTROOT/manualfiles.tmp
65 rm $DISTROOT/testsfiles.tmp
66 rm $DISTROOT/bc5.sed
67
68 find $BC5ROOT -type f | xargs perl $DISTROOT/sysdeps/borlandc5.0/unix2dos.pl
69 find $BC5ROOT -name \*.bak | xargs rm -f