#! /bin/sh

#
# Simple script to install the S3 Savage server and tools.
#

if [ ! -e /usr/X11R6/bin/XF86Setup ]; then
  echo You must have XFree86 installed.
  exit
fi

if [ $EUID != "0" ]; then
  echo You must be root to install the server and tools.
  exit
fi

install -s -m 755 -o 0 -g 0 XF86_SVGA /usr/X11R6/bin/XF86_SVGA
install -s -m 4755 -o 0 -g 0 s3switch /usr/X11R6/bin/s3switch
install -m 444 -o 0 -g 0 s3switch.1x /usr/X11R6/man/man1/s3switch.1x

rm -f /usr/X11R6/bin/X
ln -s /usr/X11R6/bin/XF86_SVGA /usr/X11R6/bin/X
rm -f /etc/X11/X
ln -s /usr/X11R6/bin/XF86_SVGA /etc/X11/X

echo Installation complete.
