#! /bin/bash
MOUNTPATH=./

echo "Installing Lism"


if [  -e /usr/local/Klib ]
then 
        cp -r $MOUNTPATH/Klib/* /usr/local/Klib/
else
        echo "Installing Klib"
	mkdir /usr/local/Klib
	cp -r $MOUNTPATH/Klib/* /usr/local/Klib/
fi


echo $2 > /usr/local/Klib/Info

chmod 777 /usr/local/Klib/*


MKFONTDIR=/usr/X11R6/bin/mkfontdir


echo "Installing Fonts"

if [  -e /usr/share/fonts/LISMttf/ ]
then 
	cp $MOUNTPATH/LISMttf/* /usr/share/fonts/LISMttf/
else
	mkdir /usr/share/fonts/LISMttf
	cp $MOUNTPATH/LISMttf/*  /usr/share/fonts/LISMttf
fi

echo "Registering Fonts"
#used for debian
#defoma-font -v register-all CDAC-Lism-FontRegister-File


echo "Installing Components"

#cp Fontmap /LISM
#cp lism /LISM


cd /usr/share/fonts/LISMttf

chmod 755 /usr/share/fonts/LISMttf/*



cd /usr/share/fonts/LISMttf
$1 > fonts.scale
$MKFONTDIR 
/usr/sbin/chkfontpath  --add /usr/share/fonts/LISMttf
/etc/init.d/xfs restart

cd -
exit
