#!/bin/sh

# Decompress tar
tar xzvf centos-5-64.tgz
cd centos-5-64

# Backup xorg.conf
cp -f /etc/X11/xorg.conf /etc/X11/xorg.conf.old

# Copy binaries 
cp -f ./LinearAp /usr/local/bin/
cp -f ./TouchPanelKit /usr/local/bin/
cp -f ./*.so /usr/lib64/xorg/modules/input/

# Copy pictures and multi-language files
mkdir -p /usr/share/images/
cp -f ./TouchM/*.bmp /usr/share/images/
cp -fr ./TouchM/lang/* /usr/share/locale/
cp -fr ./Calibration/lang/* /usr/share/locale/

# Modify xorg.conf
Xorg -configure :1
cp ~/xorg.conf.new ./xorg.conf
./chgxorg
cp ./xorg.conf /etc/X11/xorg.conf

echo "Setup completed, please restart system to enable touch panel."

