#!/bin/sh
# dpkg will not replace a directory with a symlink.
# FIXME: Remove during the squeeze+1 cycle.

set -e
set -u

APPDIR=/usr/lib/GNUstep/Applications

case "$1" in
    install | upgrade)
	# Assume that if Ink's Resources are not moved, a lending hand
	# is needed.
	if [ -d $APPDIR/Ink.app/Resources ] \
	    && [ ! -L $APPDIR/Ink.app/Resources ]; then
	    rm -rf $APPDIR/Ink.app/Resources $APPDIR/Calculator.app/Resources \
		$APPDIR/NSPanelTest.app/Resources
	fi
    ;;
    
    abort-upgrade)
    ;;

    *)
	echo "preinst called with unknown argument \`$1'" >&2
	exit 1
    ;;
esac

#DEBHELPER#

exit 0
