#! /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/*
#chmod 777 /usr/local/Klib/dic/*
#chmod 777 /usr/local/Klib/spell/*
#chmod 777 /usr/local/Klib/spell/dic/*


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"

#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/*



$1

$MKFONTDIR  

xset fp+ /usr/share/fonts/LISMttf

xset fp rehash

echo "Lism Installation complete"


exit 0
