]> git.decadent.org.uk Git - ion3.git/blob - debian/ion3.postinst
bfa57184775cb7d74d6259625a2df124b06d8a18
[ion3.git] / debian / ion3.postinst
1 #!/bin/sh
2 set -e
3 . /usr/share/debconf/confmodule
4
5 UPSTREAM_VERSION=
6 DEBIAN_VERSION=
7
8 if [ "$1" = configure ] \
9     && dpkg --compare-versions "$2" lt "$DEBIAN_VERSION"; then
10     # Installing for the first time or upgrading.
11     # To comply with the Ion trademark licence terms, we must ensure
12     # that this version is up-to-date or that the user acknowledges
13     # it is not.  I freely admit that this is a horrible abuse of
14     # debconf, but it seems slightly less unpleasant than maintaining
15     # a renamed version. - benh
16     uscan_output=$(uscan 2>&1 --no-conf --report-status \
17                    --package ion3 --upstream-version "$UPSTREAM_VERSION" \
18                    --watchfile /usr/share/ion3/debian/watch)
19     case "$uscan_output" in
20         *"up to date"*)
21             question=''
22             ;;
23         *"Newer version"*)
24             question=ion3/acknowledge-outdated
25             ;;
26         *)
27             question=ion3/acknowledge-maybe-outdated
28             ;;
29     esac
30     if [ -n "$question" ]; then
31         db_fset $question seen false
32         db_subst $question version $UPSTREAM_VERSION
33         db_input high $question || true
34         db_go || true
35         db_get $question
36         if [ "$RET" != true ]; then
37             db_input high ion3/did-not-acknowledge-outdated || true
38             db_go || true
39             exit 1
40         fi
41     fi
42 fi
43
44 if [ -h /etc/X11/ion3/draw.lua ]; then
45     rm -f /etc/X11/ion3/draw.lua
46 fi
47
48 ln -s look_clean.lua /etc/X11/ion3/draw.lua
49
50 update-alternatives --install /usr/bin/ion ion /usr/bin/ion3 29 \
51     --slave /usr/share/man/man1/ion.1.gz ion.1.gz \
52     /usr/share/man/man1/ion3.1.gz
53
54 update-alternatives --install \
55     /usr/bin/x-window-manager x-window-manager /usr/bin/ion3 49 \
56     --slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz \
57     /usr/share/man/man1/ion3.1.gz
58
59 update-alternatives --install \
60     /usr/bin/x-window-manager x-window-manager /usr/bin/pwm3 48 \
61     --slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz \
62     /usr/share/man/man1/pwm3.1.gz
63
64 # i18n menu method
65 inst=/etc/menu-methods/ion3-i18n
66 if [ -f $inst ]; then
67     chmod a+x $inst
68 fi
69
70 # Initialise extra configuration file list if missing
71 [ -f /etc/X11/ion3/cfg_debian_ext.lua ] || >/etc/X11/ion3/cfg_debian_ext.lua
72
73 #DEBHELPER#
74
75 # Remove the old now-renamed generated Debian menu
76 rm -f /var/lib/ion3/debian-menus.lua