#!/bin/sh

if [ $(id -u) !=  "0" ]; then
	echo "You need to be root to uninstall this program (try \"sudo $0\")."
	echo "Vous devez etre root pour desinstaller ce programme (essayez \"sudo $0\")."
	exit 1
fi

set -e

echo Removing main executable...
rm -f					/usr/local/bin/slimevolley

echo Removing menu shortcuts...
rm -f					/usr/share/applications/slimevolley.desktop
rm -f					/usr/local/share/pixmaps/slimevolley_64.xpm
rm -f					/usr/local/share/pixmaps/slimevolley.xpm

echo Removing global data...
rm -f					/usr/local/share/games/slimevolley/icone.png

echo Removing slimes...
rm -rf /usr/local/share/games/slimevolley/slimes

for theme in classic default mushrooms; do
	echo Removing $theme theme...
	rm -rf				/usr/local/share/games/slimevolley/themes/$theme
done

rmdir --ignore-fail-on-non-empty	/usr/local/share/games/slimevolley/themes
rmdir --ignore-fail-on-non-empty	/usr/local/share/games/slimevolley

echo Removing locale data...
for lang in fr it; do
	rm -f			/usr/local/share/locale/$lang/LC_MESSAGES/slimevolley.mo
done

echo Removing documentation...
rm -f				/usr/local/share/man/man6/slimevolley.6
rm -f				/usr/local/share/man/fr/man6/slimevolley.6

echo Slime Volley was successfully uninstalled.