#! /bin/sh

# Basic script for installing a Geomorph user
# Should be executed under the user account
# Should be executed before the first launch of Geomorph,
# otherwise Geomorph will try to execute the parts
# automatically if the directory or the RC file are not found

VERSION=0.63

if [ -d $HOME/.geomorph ]
then
	/usr/local/share/geomorph/$VERSION/install-step1-dir
	exit
fi

/usr/local/share/geomorph/$VERSION/install-step1-dir
/usr/local/share/geomorph/$VERSION/install-step2-rcfile
/usr/local/share/geomorph/$VERSION/install-step3-menu
/usr/local/share/geomorph/$VERSION/install-step4-desktop

# Check Pov-Ray

if [ ! `which povray` ]
then
	echo "********** WARNING **********"
	echo "A 'povray' executable was not found."
	echo "POV-Ray was not installed, or the executable has another name."
	echo "If you want to render the Geomorph scenes with the provided scripts,"
	echo "please be sure that the package is installed globally"
	echo "and for you as a user."
fi


if [ ! -d $HOME/.povray ]
then
	echo "No .povray directory was found in your home directory."	
	echo "After installing POV-Ray, if rendering scenes from Geomorph"
	echo "does not work, try to add your "$HOME" directory in the"
	echo "[Permitted Paths] section of the povray.conf file."
	echo "povray.conf can be created by using the install script"
	echo "from the original POV-Ray package, with the option user."
fi

