Add debianisation code and automatic build script
[wmaker-crm.git] / debian / wmaker.postinst
blob76b9c305f50a42f9e1443162008ffa11b6437120
1 #! /bin/sh -e
2 #
3 # Window Maker postinst.
4 #
5 # Marcelo Magallon <mmagallo@debian.org>
7 inst="/etc/menu-methods/wmaker /etc/menu-methods/wmappearance"
8 x_wm_link=/etc/alternatives/x-window-manager
9 x_wm_man_link=/usr/share/man/man1/x-window-manager.1.gz
11 case "$1" in
12 configure)
13 update-alternatives --install /usr/bin/x-window-manager \
14 x-window-manager /usr/bin/wmaker 50 \
15 --slave /usr/share/man/man1/x-window-manager.1.gz \
16 x-window-manager.1.gz /usr/share/man/man1/wmaker.1x.gz
18 if readlink ${x_wm_link} | grep wmaker > /dev/null ; then
19 ln -sf /usr/bin/wmaker ${x_wm_link}
20 ln -sf /usr/share/man/man1/wmaker.1x.gz ${x_wm_man_link}
21 fi
23 for file in $inst ; do
24 if [ -f $file ] ; then
25 chmod a+x $file
26 fi
27 done
29 if [ -x /usr/bin/update-menus -a -x /usr/bin/install-menu ] ; then
30 update-menus
31 fi
32 ;;
34 abort-upgrade|abort-deconfigure|abort-remove)
35 # how did we got here? Force a non-zero exit code
36 exit 1
37 ;;
39 *)
40 echo "postinst called with unkown argument: \$1" >&2
41 ;;
42 esac
44 #DEBHELPER#
46 exit 0