1 #!/bin/sh 2 # postinst script for APPLICATION_NAME 3 # 4 # see: dh_installdeb(1) 5 6 set -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 case "$1" in 21 configure) 22 echo Adding shortcut to the menu 23 SECONDARY_LAUNCHERS_INSTALL 24 xdg-desktop-menu install --novendor /opt/APPLICATION_FS_NAME/APPLICATION_LAUNCHER_FILENAME.desktop 25 FILE_ASSOCIATION_INSTALL 26 27 if [ "SERVICE_HINT" = "true" ]; then 28 echo Installing daemon 29 cp /opt/APPLICATION_FS_NAME/APPLICATION_PACKAGE.init /etc/init.d/APPLICATION_PACKAGE 30 31 if [ -x "/etc/init.d/APPLICATION_PACKAGE" ]; then 32 update-rc.d APPLICATION_PACKAGE defaults 33 34 if [ "START_ON_INSTALL" = "true" ]; then 35 if which invoke-rc.d >/dev/null 2>&1; then 36 invoke-rc.d APPLICATION_PACKAGE start 37 else 38 /etc/init.d/APPLICATION_PACKAGE start 39 fi 40 fi 41 fi 42 43 fi 44 ;; 45 46 abort-upgrade|abort-remove|abort-deconfigure) 47 ;; 48 49 *) 50 echo "postinst called with unknown argument \`$1'" >&2 51 exit 1 52 ;; 53 esac 54 55 # dh_installdeb will replace this with shell code automatically 56 # generated by other debhelper scripts. 57 58 #DEBHELPER# 59 60 exit 0