Trying to upload all related projects
[easy-deb-chroot] / fremantle / easy-deb-chroot / control / postinst
1 #!/bin/sh
2
3 set -e
4
5 CHROOT=/debian
6 TSTFILE=/usr/bin/hilda
7 if [ ! -d "$CHROOT" ] ; then
8     mkdir /debian
9 # else
10 #    if [ -f "$CHROOT$TSTFILE" ] || [ ! "x`/sbin/debian echo hello | grep hello`" = "x" ] ; then
11 #       closechroot
12 #       export YESCHROOT='yes'
13 #    fi
14 fi
15
16 # if this is an N810, copy the correct keymap into place.
17
18 export MODEL=`cat /proc/cpuinfo | grep Hardware | cut -d " " -f 3`
19 if [ "$MODEL" = "RX-44" ] ; then
20   cp /home/user/.Xmodmap-keymap-n810 /home/user/.Xmodmap-keymap
21 fi
22
23 # I sincerely apologise for the following ugly kludge that
24 # restores all previous settings.
25
26 if  [ -f "/home/user/.chroot.orig" ] ; then
27   cp /home/user/.chroot.orig /home/user/.chroot
28 fi
29
30 if  [ -f "/home/user/.Xmodmap-keymap.orig" ] ; then
31   mv /home/user/.Xmodmap-keymap.orig /home/user/.Xmodmap-keymap
32   export UPGRD="upgrade"
33 fi
34
35 if  [ -f "/home/user/.xbindkeysrc.scm.orig" ] ; then
36   mv /home/user/.xbindkeysrc.scm.orig /home/user/.xbindkeysrc.scm
37 fi
38
39 if  [ -f "/home/user/.gimp-2.4/gimprc.orig" ] ; then
40   mv /home/user/.gimp-2.4/gimprc.orig /home/user/.gimp-2.4/gimprc
41 fi
42
43 if  [ -f "/home/user/.gimp-2.4/sessionrc.orig" ] ; then
44   mv /home/user/.gimp-2.4/sessionrc.orig /home/user/.gimp-2.4/sessionrc
45 fi
46
47 if  [ -f "/home/user/.config/lxde/config.orig" ] ; then
48   mv /home/user/.config/lxde/config.orig /home/user/.config/lxde/config
49 fi
50
51 if  [ -f "/home/user/.config/lxpanel/LXDE/config.orig" ] ; then
52   mv /home/user/.config/lxpanel/LXDE/config.orig /home/user/.config/lxpanel/LXDE/config
53 fi
54
55 if  [ -f "/home/user/.config/lxpanel/LXDE/panels/panel.orig" ] ; then
56   mv /home/user/.config/lxpanel/LXDE/panels/panel.orig /home/user/.config/lxpanel/LXDE/panels/panel
57 fi
58
59 if  [ -f "/home/user/.config/gtk-2.0/gtkfilechooser.ini.orig" ] ; then
60   mv /home/user/.config/gtk-2.0/gtkfilechooser.ini.orig /home/user/.config/gtk-2.0/gtkfilechooser.ini
61 fi
62
63 # Fix permissions; another kludge.
64
65 chown -R user:users /home/user/img-install
66 chown -R user:users /home/user/.chroot
67 chown -R user:users /home/user/.config
68 chown -R user:users /home/user/apps
69 chown -R user:users /home/user/.matchbox
70 chown -R user:users /home/user/.gimp-2.4
71 chown user:users /home/user/.Xmodmap-keymap
72 chown user:users /home/user/.Xmodmap-keymap-n800
73 chown user:users /home/user/.Xmodmap-keymap-n810
74 chown user:users /home/user/.powerlaunch
75 chown user:users /home/user/.xbindkeysrc.scm
76
77 # yet another kludge; detect an upgrade
78
79 if [ "x$UPGRD" = "x" ] ; then
80    touch /home/user/.synchroot
81    chown -R user:users /home/user/.synchroot
82 fi
83
84 # icon kludges
85
86 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/abiword.png" ] ; then 
87    cp /usr/share/icons/hicolor/scalable/hildon/abiword-debian.png /usr/share/icons/hicolor/scalable/hildon/abiword.png
88 fi
89
90 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png" ] ; then 
91    cp /usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png /usr/share/icons/hicolor/scalable/hildon/deblet.png
92 fi
93
94 # this takes a while; that's why it's at the end...
95 gtk-update-icon-cache -f /usr/share/icons/hicolor
96
97 if [ "x$UPGRD" = "x" ] ; then
98    maemo-select-menu-location ooo.desktop  tana_fi_utilities
99    maemo-select-menu-location gimp.desktop  tana_fi_utilities
100    maemo-select-menu-location iceweasel.desktop tana_fi_internet
101    maemo-select-menu-location epiphany.desktop tana_fi_internet
102    maemo-select-menu-location lxde.desktop tana_fi_utilities
103    maemo-select-menu-location gnome-alsamixer.desktop tana_fi_settings
104    maemo-select-menu-location debchroot.desktop tana_fi_utilities
105    maemo-select-menu-location synaptic.desktop tana_fi_settings
106    maemo-select-menu-location xbindkeys.desktop tana_fi_settings
107 fi
108
109 if [ "x$UPGRD" != "x" ] ; then
110   export MSG1=`printf "\
111 This update points to the new qole.org domain and the updated\n\
112 image file that has the NEW, UPDATED Debian Stable release.\n\n\
113 If you want a fully updated Debian (with OpenOffice.org 3.0,\n\
114 Gimp 2.6, and the Epiphany browser), make sure you \n\
115 close your chroot, delete the current image if you need \n\
116 the space, then use the installer to download \n\
117 the new image file. \n\n\
118 Note: You don't need to replace your current image file."`
119 else
120 export MSG1=`printf "\
121 In order to use this package, you must download and\n\
122 install a very large image file. If you are unsure about\n\
123 how to do this, and / or you just want the current set of\n\
124 Debian applications (OpenOffice, GIMP & Firefox 3  w/ java),\n\
125 use the Debian Image Installer in the Extras menu.\n\
126 This program will download and install the image file to\n\
127 one of your SD cards. You will need at least 1.5 GB free on that\n\
128 card. After you download the image, you can move it elsewhere.\n\
129 After moving the file, you may need to edit the .chroot file \n\
130 as explained on ITt.\n\
131 If you have run any Debian apps, be sure to issue\n\
132 sudo closechroot\n\
133 in the terminal (or just reboot) before moving the image file.\n"`
134 fi
135 gxmessage -center -alignbuttons center -buttons OK:0 -geometry 690x380 -title "NOTICE" "$MSG1"
136
137 exit 0