Fremantle versions pushed to Extras
[easy-deb-chroot] / fremantle / easy-deb-chroot / control / postinst
1 #!/bin/sh
2
3 closechroot
4
5 # set -e
6
7 CHROOT=/.debian
8 TSTFILE=/usr/bin/hilda
9
10 if [ ! -d "$CHROOT" ] ; then
11     mkdir /.debian
12 # else
13 #    if [ -f "$CHROOT$TSTFILE" ] || [ ! "x`/sbin/debian echo hello | grep hello`" = "x" ] ; then
14 #       closechroot
15 #       export YESCHROOT='yes'
16 #    fi
17 fi
18
19 # I sincerely apologise for the following ugly kludge that
20 # restores all previous settings.
21
22 if  [ -f "/home/user/.chroot.orig" ] ; then
23   cp /home/user/.chroot.orig /home/user/.chroot
24   export UPGRD="upgrade"
25 fi
26
27 # if  [ -f "/home/user/.Xmodmap-keymap.orig" ] ; then
28 #   mv /home/user/.Xmodmap-keymap.orig /home/user/.Xmodmap-keymap
29 #   export UPGRD="upgrade"
30 # fi
31
32 if  [ -f "/home/user/.xbindkeysrc.orig" ] ; then
33 #  rm /home/user/.xbindkeysrc.orig
34   mv /home/user/.xbindkeysrc /home/user/.xbindkeysrc.dist
35   mv /home/user/.xbindkeysrc.orig /home/user/.xbindkeysrc
36 fi
37
38 if  [ -f "/home/user/.gimp-2.6/gimprc.orig" ] ; then
39   mv /home/user/.gimp-2.6/gimprc.orig /home/user/.gimp-2.6/gimprc
40 fi
41
42 if  [ -f "/home/user/.gimp-2.6/sessionrc.orig" ] ; then
43   mv /home/user/.gimp-2.6/sessionrc.orig /home/user/.gimp-2.6/sessionrc
44 fi
45
46 if  [ -f "/home/user/.config/lxde/config.orig" ] ; then
47   mv /home/user/.config/lxde/config.orig /home/user/.config/lxde/config
48 fi
49
50 if  [ -f "/home/user/.config/lxpanel/LXDE/config.orig" ] ; then
51   mv /home/user/.config/lxpanel/LXDE/config.orig /home/user/.config/lxpanel/LXDE/config
52 fi
53
54 if  [ -f "/home/user/.config/lxpanel/LXDE/panels/panel.orig" ] ; then
55   mv /home/user/.config/lxpanel/LXDE/panels/panel.orig /home/user/.config/lxpanel/LXDE/panels/panel
56 fi
57
58 if  [ -f "/home/user/.config/lxpanel/LXDE/panels/top.orig" ] ; then
59   rm /home/user/.config/lxpanel/LXDE/panels/top.orig
60 #   mv /home/user/.config/lxpanel/LXDE/panels/top.orig /home/user/.config/lxpanel/LXDE/panels/top
61 fi
62
63 # if  [ -f "/home/user/.config/gtk-2.0/gtkfilechooser.ini.orig" ] ; then
64 #  mv /home/user/.config/gtk-2.0/gtkfilechooser.ini.orig /home/user/.config/gtk-2.0/gtkfilechooser.ini
65 # fi
66
67 # Fix permissions; another kludge.
68
69 chown -R user:users /home/user/img-install
70 chown -R user:users /home/user/.chroot
71 chown -R user:users /home/user/.config
72 chown -R user:users /home/user/.gimp-2.6
73 chown user:users /home/user/.gtkrc-2.0
74
75 # chown -R user:users /home/user/apps
76 # chown -R user:users /home/user/.matchbox
77 # chown user:users /home/user/.Xmodmap-keymap
78 chown user:users /home/user/.xbindkeysrc
79
80 # yet another kludge; detect an upgrade
81
82 if [ "x$UPGRD" = "x" ] ; then
83    touch /home/user/.synchroot
84    chown -R user:users /home/user/.synchroot
85 fi
86
87 # icon kludges
88
89 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/abiword.png" ] ; then 
90    cp /usr/share/icons/hicolor/scalable/hildon/abiword-debian.png /usr/share/icons/hicolor/scalable/hildon/abiword.png
91 fi
92
93 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png" ] ; then 
94    cp /usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png /usr/share/icons/hicolor/scalable/hildon/deblet.png
95 fi
96
97 # this takes a while; that's why it's at the end...
98 # gtk-update-icon-cache -f /usr/share/icons/hicolor
99
100 if [ "x$UPGRD" = "x" ] ; then
101 export MSG1=`printf "\
102 In order to use this package, you must download and\n\
103 install a very large image file. If you are unsure about\n\
104 how to do this, and / or you just want the current set of\n\
105 Debian applications (OpenOffice, GIMP & Firefox 3  w/ java),\n\
106 use the Deb Img Install in the menu.\n\
107 This program will download and install the image file to\n\
108 MyDocs or a microSD card. You will need at least 2.5 GB free\n\
109 there. After you download the image, you can move it elsewhere.\n\
110 After moving the file, you may need to edit the .chroot file \n\
111 as explained on talk.maemo.org.\n\
112 If you have run any Debian apps, be sure to issue\n\
113 sudo closechroot\n\
114 in the terminal (or just reboot) before moving the image file.\n"`
115
116 gxmessage -center -alignbuttons center -buttons OK:0 -geometry 690x380 -title "NOTICE" "$MSG1"
117
118 fi
119 exit 0