]> git.decadent.org.uk Git - ion3.git/blob - debian/ion3.postinst
9ec35675f488db5d7d7ceccd0ce3cd83c53adcf7
[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                     || true)"
20     case "$uscan_output" in
21         *"up to date"*)
22             question=''
23             ;;
24         *"Newer version"*)
25             question=ion3/acknowledge-outdated
26             ;;
27         *)
28             question=ion3/acknowledge-maybe-outdated
29             ;;
30     esac
31     if [ -n "$question" ]; then
32         db_fset $question seen false
33         db_subst $question version $UPSTREAM_VERSION
34         db_input high $question || true
35         db_go || true
36         db_get $question
37         if [ "$RET" != true ]; then
38             db_input high ion3/did-not-acknowledge-outdated || true
39             db_go || true
40             exit 1
41         fi
42     fi
43 fi
44
45 if [ -h /etc/X11/ion3/draw.lua ]; then
46     rm -f /etc/X11/ion3/draw.lua
47 fi
48
49 ln -s look_clean.lua /etc/X11/ion3/draw.lua
50
51 update-alternatives --install /usr/bin/ion ion /usr/bin/ion3 29 \
52     --slave /usr/share/man/man1/ion.1.gz ion.1.gz \
53     /usr/share/man/man1/ion3.1.gz
54
55 update-alternatives --install \
56     /usr/bin/x-window-manager x-window-manager /usr/bin/ion3 49 \
57     --slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz \
58     /usr/share/man/man1/ion3.1.gz
59
60 update-alternatives --install \
61     /usr/bin/x-window-manager x-window-manager /usr/bin/pwm3 48 \
62     --slave /usr/share/man/man1/x-window-manager.1.gz x-window-manager.1.gz \
63     /usr/share/man/man1/pwm3.1.gz
64
65 # i18n menu method
66 inst=/etc/menu-methods/ion3-i18n
67 if [ -f $inst ]; then
68     chmod a+x $inst
69 fi
70
71 # Initialise extra configuration file list if missing
72 [ -f /etc/X11/ion3/cfg_debian_ext.lua ] || >/etc/X11/ion3/cfg_debian_ext.lua
73
74 #DEBHELPER#
75
76 # Remove the old now-renamed generated Debian menu
77 rm -f /var/lib/ion3/debian-menus.lua