#!/bin/bash
# GMM (C) 2017 Stephane Charette <stephanecharette@gmail.com>
# $Id: postrm 2327 2017-08-15 21:29:41Z stephane $


echo "Postrm: $@"


if [ "$1" = upgrade ]; then
	# nothing (yet!) to do in postrm for upgrades
	true
fi


if [ "$1" = remove -o "$1" = abort-install -o "$1" = disappear ]; then

	if [ -x "$(which xdg-icon-resource)" ]; then
		xdg-icon-resource uninstall --context apps --mode system --size 256 GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 128 GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 64  GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 48  GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 32  GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 22  GMM-Logo
		xdg-icon-resource uninstall --context apps --mode system --size 16  GMM-Logo
	fi

	if [ -x "$(which xdg-desktop-icon)" ]; then
		xdg-desktop-icon uninstall ccoderun-gmm.desktop
	fi

	if [ -x "$(which xdg-desktop-menu)" ]; then
		xdg-desktop-menu uninstall --mode system ccoderun-gmm.desktop
	fi

	rm -f /var/log/gmm.log*
fi


exit 0
