#!/bin/sh

##########################################
# Run this script to put the XFCom and
# doc files in their correct locations.
# You will still need to follow the 
# instructions detailed in the release
# notes to finish the installation.
##########################################

if [ ! -e ./XFCom_i810 ]; then
  echo "Distribution is not complete, XFCom-i810 binary not found"
  exit 1;
fi

if [ ! -e ./README ]; then
  echo "Distribution is not complete, README not found"
  exit 1;
fi

if [ ! -e ./README.XFCOM ]; then
  echo "Distribution is not complete, README.XFCOM not found"
  exit 1;
fi

cp ./XFCom_i810 /usr/X11R6/bin/.
chown root.root /usr/X11R6/bin/XFCom_i810
chmod 755 /usr/X11R6/bin/XFCom_i810

mkdir -p /usr/doc/XFCom-i810-glibc2.1-1.0.0
chown root.root /usr/doc/XFCom-i810-glibc2.1-1.0.0
chmod 755 /usr/doc/XFCom-i810-glibc2.1-1.0.0

cp ./README /usr/doc/XFCom-i810-glibc2.1-1.0.0/.
chown root.root /usr/doc/XFCom-i810-glibc2.1-1.0.0/README
chmod 644 /usr/doc/XFCom-i810-glibc2.1-1.0.0/README

cp ./README.XFCOM /usr/doc/XFCom-i810-glibc2.1-1.0.0/.
chown root.root /usr/doc/XFCom-i810-glibc2.1-1.0.0/README.XFCOM
chmod 644 /usr/doc/XFCom-i810-glibc2.1-1.0.0/README.XFCOM

