Ticket #282: postinst

File postinst, 2.0 KB (added by Gerritv, 12 years ago)

debian/postinst

Line 
1#!/bin/sh
2# postinst script for navit
3#
4# see: dh_installdeb(1)
5
6set -e
7
8# summary of how this script can be called:
9#        * <postinst> `configure' <most-recently-configured-version>
10#        * <old-postinst> `abort-upgrade' <new version>
11#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
12#          <new-version>
13#        * <postinst> `abort-remove'
14#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
15#          <failed-install-package> <version> `removing'
16#          <conflicting-package> <version>
17# for details, see http://www.debian.org/doc/debian-policy/ or
18# the debian-policy package
19
20
21case "$1" in
22    configure)
23    # The clock might be wrong and we know that we need to update the icon
24    # cache so we just force it.
25
26    gtk-update-icon-cache -f /usr/share/icons/hicolor
27    # Now that the icon cache is uptodate, we move the .desktop file into
28    # place.  Doing this only now prevents the Task navigator from
29    # reconstructing the menu before the icon is available.  This trick is
30    # not really necessary when using maemo-select-menu-location (as we do
31    # below), since maemo-select-menu-location will trigger the
32    # reconstructing of the Taks navigator menu as well.
33
34    if [ -f /usr/share/applications/navit.desktop ]
35    then
36        mv /usr/share/applications/navit.desktop /usr/share/applications/hildon/navit.desktop
37    fi
38    if [ -f /usr/share/applications/org.navit-project.Navit.service ]
39    then
40        mv /usr/share/applications/org.navit-project.Navit.service /usr/share/dbus-1/services/org.navit-project.Navit.service
41    fi
42
43    # Now we are ready to let the user move the entry around, but only if
44    # this is a new install
45
46    oldversion="$2"
47    if [ -z "$oldversion" ]; then
48        if [ -e /usr/bin/maemo-select-menu-location ]; then
49         maemo-select-menu-location navit.desktop
50        fi
51    fi
52
53
54    ;;
55
56    abort-upgrade|abort-remove|abort-deconfigure)
57    ;;
58
59    *)
60        echo "postinst called with unknown argument \`$1'" >&2
61        exit 1
62    ;;
63esac
64exit 0