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