#!/bin/sh
## ----------------------------------------------------------------------
## debian/postinst : postinstallation script for maemo-wordpy
## ----------------------------------------------------------------------

## ----------------------------------------------------------------------
set -e

ACCOUNTS_FILE=/home/user/.maemowordpy/accounts.conf
OLD_SETTINGS=/home/user/.maemowordpy/blog.dat

if [ -f $OLD_SETTINGS ]
then 
  rm $OLD_SETTINGS
  echo "Deleting old configuration file."
fi

if [ -f $ACCOUNTS_FILE ]
then 
  maemo-confirm-text "Note :("  /usr/share/maemo-wordpy/accounts-note
  rm $ACCOUNTS_FILE
  echo "Deleting accounts.conf file"
fi


chown -R user:users /home/user/.maemowordpy
chmod +x /usr/bin/MaemoWordPy
echo "updated permiss"

gtk-update-icon-cache -f /usr/share/icons/hicolor


oldversion="$2"
if [ -z "$oldversion" ]; then
  maemo-select-menu-location maemo-wordpy.desktop
fi

maemo-confirm-text "MaemoWordPy release-notes" /usr/share/maemo-wordpy/NEWS

exit 0
