echo "Making system directories"
if test ! -d /usr/lib/tycho ; then mkdir /usr/lib/tycho ; fi
if test ! -d /usr/lib/colorsets ; then mkdir /usr/lib/colorsets ; fi
if test ! -d /usr/spool/flash ; then mkdir /usr/spool/flash ; fi
if test ! -d /usr/spool/flash-msgs ; then mkdir /usr/spool/flash-msgs ; fi
if test ! -d /usr/spool/party ; then mkdir /usr/spool/party ; fi
if test ! -d /usr/lib/scheck ; then mkdir /usr/lib/scheck ; chmod 700 /usr/lib/scheck ; fi
if test ! -d /usr/lib/user-setup ; then mkdir /usr/lib/user-setup ; fi
if test ! -d /usr/spool/usage ; then mkdir /usr/spool/usage ; fi
chgrp daemon /usr/spool/party
chmod 770 /usr/spool/party

echo "Installing shared libs"
cp -af $2/lib/* /usr/lib/tycho
rm -r $2/lib

echo "Installing user bins"
cp -af $2/bin/* /usr/bin
rm -r $2/bin

echo "Installing sys bins"
cp -af $2/sbin/* /usr/sbin
rm -r $2/sbin

echo "Installing scheck"
cp -af $2/scheck/* /usr/lib/scheck
rm -r $2/scheck

echo "Installing user setup"
cp -af $2/setup/* /usr/lib/user-setup
rm -r $2/setup
