#! /bin/sh -e

set -e

if [ "$1" = "upgrade" ]; then
    # Check for old image and sound dirs, and remove if found
    if [ ! -L /usr/lib/GNUstep/Apps/WMMail.app/Anims ]; then
	rm -rf /usr/lib/GNUstep/Apps/WMMail.app/Anims
    fi
    if [ ! -L /usr/lib/GNUstep/Apps/WMMail.app/Sounds ]; then
	rm -rf /usr/lib/GNUstep/Apps/WMMail.app/Sounds
    fi
fi

# Now create symlinks for images and sounds.
# (all this to cope with a possibly overzealous interpretation of the FHS)
ln -sf ../../../../share/GNUstep/Apps/WMMail.app/Anims \
    /usr/lib/GNUstep/Apps/WMMail.app/Anims
ln -sf ../../../../share/GNUstep/Apps/WMMail.app/Sounds \
    /usr/lib/GNUstep/Apps/WMMail.app/Sounds

#DEBHELPER#
