Add debianisation code and automatic build script
[wmaker-crm.git] / debian / wmaker.postrm
blob85ac7e173f163391bbb65dba6ffcf3af65a45524
1 #!/bin/sh
3 set -e
5 inst="/etc/menu-methods/wmaker /etc/menu-methods/wmappearance"
6 asclock="/usr/X11R6/bin/asclock"
7 asclock_diversion="/usr/X11R6/bin/asclock.afterstep"
8 asclock_man="/usr/X11R6/man/man1/asclock.1x.gz"
9 asclock_man_diversion="/usr/X11R6/man/man1/asclock.afterstep.1x.gz"
10 old_asclock_man_diversion="/usr/X11R6/man/man1/asclock.1x.afterstep.gz"
12 case "$1" in
13 remove)
14 for file in $inst ; do
15 if [ -f $file ] ; then
16 chmod a-x $file
17 fi
18 done
19 ;;
20 purge)
21 if [ -x /usr/sbin/register-window-manager ]; then
22 register-window-manager --remove wmaker
23 fi
25 if [ -x /usr/bin/update-menus ] ; then
26 update-menus
27 rm -f /etc/X11/WindowMaker/menu.hook /etc/X11/WindowMaker/plmenu.hook
28 fi
30 # Hmmm...
31 rmdir -p /etc/GNUstep/Defaults /etc/X11/WindowMaker || true
32 ;;
33 upgrade|abort-install|disappear)
34 # nothing to do
35 ;;
36 failed-upgrade)
37 # this is an upgrade, and it has failed. What can fail?
38 exit 1
39 ;;
40 abort-upgrade)
41 # preinst failed, leave things like they were
42 if dpkg --compare-versions $2 eq 0.6.3-1 ; then
43 # reinstall the removed diversions
44 dpkg-divert --quiet --rename --package wmaker \
45 --divert $asclock_man_diversion --remove $asclock_man
46 dpkg-divert --quiet --rename --package wmaker \
47 --divert $old_asclock_man_diversion --add $asclock_man
48 dpkg-divert --quiet --rename --package wmaker \
49 --divert $asclock_diversion --add $asclock
50 fi
51 ;;
52 *)
53 echo "postrm called with unknown argument \`$1'" >&2
54 exit 1
55 ;;
56 esac
58 #DEBHELPER#
60 exit 0