Fremantle updates: easy-chroot 0.2.7, easy-deb-chroot 0.9.42
[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.orig /home/user/.xbindkeysrc
35 fi
36
37 if  [ -f "/home/user/.gimp-2.6/gimprc.orig" ] ; then
38   mv /home/user/.gimp-2.6/gimprc.orig /home/user/.gimp-2.6/gimprc
39 fi
40
41 if  [ -f "/home/user/.gimp-2.6/sessionrc.orig" ] ; then
42   mv /home/user/.gimp-2.6/sessionrc.orig /home/user/.gimp-2.6/sessionrc
43 fi
44
45 if  [ -f "/home/user/.config/lxde/config.orig" ] ; then
46   mv /home/user/.config/lxde/config.orig /home/user/.config/lxde/config
47 fi
48
49 if  [ -f "/home/user/.config/lxpanel/LXDE/config.orig" ] ; then
50   mv /home/user/.config/lxpanel/LXDE/config.orig /home/user/.config/lxpanel/LXDE/config
51 fi
52
53 if  [ -f "/home/user/.config/lxpanel/LXDE/panels/panel.orig" ] ; then
54   mv /home/user/.config/lxpanel/LXDE/panels/panel.orig /home/user/.config/lxpanel/LXDE/panels/panel
55 fi
56
57 if  [ -f "/home/user/.config/lxpanel/LXDE/panels/top.orig" ] ; then
58   rm /home/user/.config/lxpanel/LXDE/panels/top.orig
59 #   mv /home/user/.config/lxpanel/LXDE/panels/top.orig /home/user/.config/lxpanel/LXDE/panels/top
60 fi
61
62 # if  [ -f "/home/user/.config/gtk-2.0/gtkfilechooser.ini.orig" ] ; then
63 #  mv /home/user/.config/gtk-2.0/gtkfilechooser.ini.orig /home/user/.config/gtk-2.0/gtkfilechooser.ini
64 # fi
65
66 # Fix permissions; another kludge.
67
68 chown -R user:users /home/user/img-install
69 chown -R user:users /home/user/.chroot
70 chown -R user:users /home/user/.config
71 chown -R user:users /home/user/.gimp-2.6
72 chown user:users /home/user/.gtkrc-2.0
73
74 # chown -R user:users /home/user/apps
75 # chown -R user:users /home/user/.matchbox
76 # chown user:users /home/user/.Xmodmap-keymap
77 chown user:users /home/user/.xbindkeysrc
78
79 # yet another kludge; detect an upgrade
80
81 if [ "x$UPGRD" = "x" ] ; then
82    touch /home/user/.synchroot
83    chown -R user:users /home/user/.synchroot
84 fi
85
86 # icon kludges
87
88 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/abiword.png" ] ; then 
89    cp /usr/share/icons/hicolor/scalable/hildon/abiword-debian.png /usr/share/icons/hicolor/scalable/hildon/abiword.png
90 fi
91
92 if  [ ! -e "/usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png" ] ; then 
93    cp /usr/share/icons/hicolor/scalable/hildon/deblet-easydeb.png /usr/share/icons/hicolor/scalable/hildon/deblet.png
94 fi
95
96 # this takes a while; that's why it's at the end...
97 # gtk-update-icon-cache -f /usr/share/icons/hicolor
98
99 if [ "x$UPGRD" = "x" ] ; then
100 export MSG1=`printf "\
101 In order to use this package, you must download and\n\
102 install a very large image file. If you are unsure about\n\
103 how to do this, and / or you just want the current set of\n\
104 Debian applications (OpenOffice, GIMP & Firefox 3  w/ java),\n\
105 use the Deb Img Install in the menu.\n\
106 This program will download and install the image file to\n\
107 MyDocs or a microSD card. You will need at least 2.5 GB free\n\
108 there. After you download the image, you can move it elsewhere.\n\
109 After moving the file, you may need to edit the .chroot file \n\
110 as explained on talk.maemo.org.\n\
111 If you have run any Debian apps, be sure to issue\n\
112 sudo closechroot\n\
113 in the terminal (or just reboot) before moving the image file.\n"`
114
115 gxmessage -center -alignbuttons center -buttons OK:0 -geometry 690x380 -title "NOTICE" "$MSG1"
116
117 fi
118 exit 0