#! /bin/sh

# Mark Gordon Feb 02

# Updated very basic install script.
# This is a reasonably universal binary, statically linked,
# independent of package management systems.  RPM's and
# .deb's will follow in short order.
VERSION=povray-3.5
if [ ! -d /usr/local/share ]
then mkdir /usr/local/share
fi
cp -r . /usr/local/share/$VERSION
if [ ! -d /usr/local/man ]
then mkdir /usr/local/man
fi
if [ ! -d /usr/local/man/man1 ]
then mkdir /usr/local/man/man1
fi
mv -f /usr/local/share/$VERSION/povray.1 /usr/local/man/man1
mv -f /usr/local/share/$VERSION/povray /usr/local/bin 
# copy configuration files only if they don't already exist.
if [ ! -f /usr/local/etc/povray.ini ]
then mv -f /usr/local/share/$VERSION/povray.ini /usr/local/etc
fi
if [ ! -f /usr/local/etc/povray.conf ]
then mv -f /usr/local/share/$VERSION/povray.conf /usr/local/etc
fi
if [ ! -d /usr/local/share/doc ]
then mkdir /usr/local/share/doc
fi
rm -rf /usr/local/share/doc/povray-3.[45].*
mv  /usr/local/share/$VERSION/$VERSION* /usr/local/share/doc
