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