#!/bin/sh

if [ "$T3XDIR" = "" ]; then
	echo
	echo 'The T3XDIR environment variable has to be defined'
	echo 'in order to install TIDE.'
	echo
	exit 1
fi

txcm -i config
txcm -i editor
txcm -i filebox
txcm -i filesrv
txcm -i form
txcm -i menu
txcm -i prompt
txcm -i pstruct
txcm -i vedit

if [ ! -d $T3XDIR/classes/2 ]; then
	mkdir $T3XDIR/classes/2
	chown bin:bin $T3XDIR/classes/2
	chmod 0755 $T3XDIR/classes/2
fi

for cls in $(ls *.cls); do
	cp xclasses/$cls $T3XDIR/classes/2
	grep "^$cls" $T3XDIR/classes/CLASSNDX >>$T3XDIR/classes/2/CLASSNDX
done

exit 0
