#!/bin/sh
echo ''
echo ''
echo '*****************************************************'
echo 'gtkpool install by Jacques Fortier'
echo '*****************************************************'
echo 'If you wish, gtkpool can be installed to the directory /usr/local/gtkpool'
echo 'and sym-links can be make from /usr/local/bin and /usr/local/lib.'
echo 'Otherwise, you can specify another directory, or, gtkpool will be installed'
echo 'to /usr/local/bin and its files will be installed to /usr/local/lib/gtkpool'
echo '(the defaults).'
echo ''
echo 'Do you wish to install gtkpool in'
echo -n '/usr/local/gtkpool? [y/n DEFAULT=n]: '
read value overflow
if [ $value = 'y' ]
then
	echo ''
	echo 'Installing to /usr/local/gtkpool'
	install -d /usr/local/gtkpool/{bin,lib}
	instdir="/usr/local/gtkpool/"
	libdir="/usr/local/gtkpool/lib"
	bindir="/usr/local/gtkpool/bin"
	symlinks="y"
else
	echo ''
	echo 'Would you like to install to another directory?'
	echo -n 'If not, the defaults will be used: [y/n DEFAULT=n]'
	read value2 overflow2
	if [ $value2 = 'y' ]
	then
		echo ''
		echo -n 'Where would you like to have gtkpool installed: '
		read instdir
		install -d $instdir{'/bin','/lib'}
		libdir="$instdir/lib"
		bindir="$instdir/bin"
		symlinks="y"
	else
		libdir="/usr/local/lib/gtkpool"
		bindir="/usr/local/bin"
		install -d $libdir
		symlinks="n"
	fi
fi
echo ""
echo "Installing the gtkpool binary to $bindir:"
install gtkpool $bindir
echo "Installing the gtkpool files to $libdir:"
install pixmaps/* $libdir
if [ $symlinks = 'y' ]
then
	echo "Making sym-links: "
	ln -s "$bindir/gtkpool" /usr/local/bin/gtkpool
	ln -s "$libdir" "/usr/local/lib/gtkpool"
fi
echo "Install completed.  Type gtkpool to run."
