diff options
Diffstat (limited to 'support/SQLTeX/install')
-rwxr-xr-x | support/SQLTeX/install | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/support/SQLTeX/install b/support/SQLTeX/install new file mode 100755 index 0000000000..8361a3f215 --- /dev/null +++ b/support/SQLTeX/install @@ -0,0 +1,69 @@ +#!/bin/sh + +SRCF="SQLTeX.pl" +TMPF="SQLTeX.tmp" +SQLT="SQLTeX" +RFIL="SQLTeX_r.dat" +CFIL="SQLTeX.cfg" +TAB="\011" + +PI=`which perl` || PI="" + +## Is Perl installed ? +if test -z "$PI" +then + echo "Perl is either not installed on this system, or not included in your path" + echo "Please check and correct this error - you need Perl to use SQLTeX" + exit +fi + +## Does the source file exist ? +if ! test -f $SRCF +then + echo "Error - the file $SRCF does not exist in the current directory" + exit +fi + +## Where should SQLTeX be installed ? +CUSR=`whoami` +if test $CUSR = "root" +then + DDIR="/usr/local/bin" +else + DDIR=`pwd` +fi +while test -z "$IDIR" +do + echo -n "Where should SQLTeX be installed [$DDIR] ? " + read IDIR + if test -z "$IDIR" + then + IDIR="$DDIR" + fi + if ! test -d $IDIR + then + echo "$IDIR does not exist or is not a directory" + IDIR="" + fi +done + +echo "#!$PI -w" > $TMPF +echo "" >> $TMPF +cat $SRCF >> $TMPF +chmod +x $TMPF +mv $TMPF $IDIR/$SQLT + +## Replacement file +if ! test -e $IDIR/$RFIL +then + mv $RFIL $IDIR/$RFIL +fi + +## Configuration file +if ! test -e $IDIR/$CFIL +then + mv $CFIL $IDIR/$CFIL +fi + +echo "Installation complete---type $SQLT -h for help" + |