#! /bin/bash
MOUNTPATH=./

echo "Installing Lism"

chmod 777 ./Doc/*
chmod 777 ./afm/*


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 755 /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"


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
