~vincentxavier/isocustomization/trunk

3 by Vincent-Xavier JUMEL
Splitting the scripts in different parts for readability
1
#!/bin/sh
2
# Translation script for Ubuntu CDs
3
# Copyright (C) 2010  Vincent-Xavier JUMEL
4
 
5
# This program is free software: you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation, either version 3 of the License, or
8
# (at your option) any later version.
9
  
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
# GNU General Public License for more details.
14
   
15
# You should have received a copy of the GNU General Public License
16
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
17
18
19
# Updating repositories
20
21
apt-get update
22
 
23
# Removing unused packages
24
LANG=C
25
apt-get -y purge `dpkg -l | awk '{print $2}' | egrep "^language-pack-|^language-pack-gnome-|^language-support-|^aspell|^myspell-|^hunspell-|^wamerican$|^wbritish$|^openoffice.org-help-|^openoffice.org-hyphenation-|^openoffice.org-thesaurus-|^gimp-help-|^evolution-documentation-" | xargs`
26
 
27
# Installing packages
28
apt-get -y install language-pack-fr language-pack-fr-base language-support-fr language-support-writing-fr language-pack-gnome-fr language-pack-gnome-fr-base openoffice.org-hyphenation-fr openoffice.org-help-fr openoffice.org-l10n-fr wfrench manpages-fr
29
LANG=fr_FR.UTF-8
30
 
31
# Purging *.mo files
32
# May be inmproved
33
 
34
# Creating localepurge configuration file
35
 
36
cat >> /etc/locale.nopurge << EOF
37
####################################################
38
# This is the configuration file for localepurge(8).
39
####################################################
40
 
41
####################################################
42
# Uncommenting this string enables removal of localized 
43
# man pages based on the configuration information for
44
# locale files defined below:
45
 
46
MANDELETE
47
 
48
####################################################
49
# Uncommenting this string causes localepurge to simply delete
50
# locales which have newly appeared on the system without
51
# bothering you about it:
52
 
53
DONTBOTHERNEWLOCALE
54
 
55
####################################################
56
# Uncommenting this string enables display of freed disk
57
# space if localepurge has purged any superfluous data:
58
 
59
SHOWFREEDSPACE
60
 
61
#####################################################
62
# Commenting out this string enables faster but less
63
# accurate calculation of freed disk space:
64
 
65
#QUICKNDIRTYCALC
66
 
67
#####################################################
68
# Commenting out this string disables verbose output:
69
 
70
#VERBOSE
71
 
72
#####################################################
73
# Following locales won't be deleted from this system
74
# after package installations done with apt-get(8):
75
 
76
fr
77
fr_FR
78
fr_FR@euro
79
fr_FR.UTF-8
80
 
81
EOF
82
 
83
# Really purging locale
84
apt-get -y install localepurge
85
localepurge
86
apt-get -y purge localepurge
87
88
apt-get -y upgrade
89
90
# Changing the name onto the CD
91
sed -i "s/Live session user/Session CD/g" /etc/casper.conf
92
sed -i "s/Live session user/Session CD/g" /usr/share/initramfs-tools/scripts/casper
93
 
94
##  Link edition on the desktop in casper
95
sed -i 's/Desktop/Bureau/g;s/Examples/Exemples/g' /usr/share/initramfs-tools/scripts/casper-bottom/10adduser
96
 
97
# TTY localisation 
98
dpkg-reconfigure -phigh console-setup
99
 
100
sed -i 's/Please remove the disc, close the tray (if any)/Retirez le disque, refermez le tiroir (si nécessaire)'/ /etc/init.d/casper
101
sed -i 's/and press ENTER to continue/et appuyez sur Entrée pour continuer/' /etc/init.d/casper
102
sed -i 's/Please remove the disc and close the tray (if any) then press ENTER: /Retirez le disque, refermez le tiroir (si nécessaire) \net appuyez sur Entrée pour continuer/' /etc/init.d/casper
103
 
104
# Todo : casped-md5sum translation
105
 
106
# Live CD doesn't accept UID greater than 500
107
 
108
if [ -n `grep '^[^:]*:[^:]*:[1-9][0-9][0-9][0-9]:' /etc/passwd` ] ; then 
109
    usermod -u 500 $login ; 
110
fi
111
if [ -n `grep '^[^:]*:[^:]*:[12][0-9][0-9][0-9][0-9]:' /etc/passwd` ] ; then 
112
    usermod -u 500 $login ; 
113
fi
114
 
115
VAR="`basename /boot/initrd.img-*-generic`" ; KV=${VAR/initrd.img-/} ; echo ${KV}
116
 
117
mkdir -p /tmp/init
118
mkinitramfs -o /tmp/init/initrd.gz ${KV}
119
 
120
## extrait
121
cd /tmp/init
122
gzip -dc initrd.gz | cpio -id
123
rm *.gz
124
 
125
## Compressing back the initrd in lzma format
126
find . | cpio --quiet --dereference -o -H newc | lzma -7 > /initrd.lz
127
cd /
128
rm -R /tmp/init
129
 
130
 
131
# Removing the old initrd and getting the new one in place
132
rm /boot/initrd.img-${KV}
133
 
134
135
136
# Changing default link in Firefox
137
sed -i 's%http://start.ubuntu.com/10.04/%http://start.ubuntu-fr.org/10.04/%' /usr/share/xul-ext/ubufox/components/aboutHome.js
138
139
## And language in case
140
sed -i 's/en-US/fr-FR/' /usr/share/xul-ext/ubufox/components/aboutHome.js
141
sed -i 's/en-US/fr-FR/' /etc/firefox/pref/firefox.js
142
echo 'user_pref("app.releaseNotesURL", "http://doc.ubuntu-fr.org/lucid");' >> /etc/firefox/pref/firefox.js
143
echo 'pref("startup.homepage_override_url","file:///usr/share/ubuntu-artwork/home/locales/index-fr.html");' >> /etc/firefox/pref/firefox.js
144
sed -i "s/en-US/fr/;s/Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar/Ajoutez des favoris dans ce dossier pour les voir dans la barres des favoris/;s/Ubuntu and Free Software links/Liens sur Ubuntu et le logiciel libre/;s/Information and resources about Ubuntu, Debian and Free Software in general/Informations sur Ubuntu, Debian et le logiciel libre en général/;s,http://www.ubuntulinux.org/,http://ubuntu-fr.org/,;s/>Ubuntu</>Le site de l'association Ubuntu-fr</;s,http://www.ubuntulinux.org/wiki/FrontPage,http://doc.ubuntu-fr.org/,;s/Ubuntu Wiki/Documentation/;s/community-edited website/collaboratif/;s/Make a Support Request to the Ubuntu Community/Posez une question à la communauté Ubuntu \(en anglais\)/;s/Ubuntu is based on Debian/Ubuntu est basée sur Debian/" /usr/lib/firefox-3.6.3/defaults/profile/bookmarks.html
145
#sed -i "s,wiki/FrontPage,," /usr/lib/firefox-3.6.3/defaults/profile/bookmarks.html
146
sed -i "s/Help and Tutorials/Aide et tutoriels/;s/Customize Firefox/Personnaliser Firefox/;s/Get Involved/Impliquez vous/;s/About Us/À propos de nous/" /usr/lib/firefox-3.6.3/defaults/profile/bookmarks.html
147
head -n 25 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html
148
149
# More link in Firefox
150
cat >> /tmp/bookmarks.html <<EOF
151
<DT><A HREF="http://doc.ubuntu-fr.org/" ICON="data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAfCAYAAAAfrhY5AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QsQFhoEBgWgsgAAB9BJREFUSMe1V3tQVNcZ/5372LvsLruwy8IuKlSQipbgg6gxoDYZHzU1EyFVtEPSt3TS5jFtYhNnTLUdk7TN5NHaxEhr7QSrTo1aGxuc+EpjCPjqgEYxssICK+zKsss+797X6R9e7MpEJZ3xzNy5d875vvM7j9/3+74L3IX2c5dhdusUy9YTpebNS6xcOQADAIK73da5hYe0e21xOstG6SwbTVZYg0tt3DIAltEL4L7s5H9c4WBUjRaX5xsqOYZ8lRDYVA3JDr98/tl/BN97ziU8RQhMI/ZGhthX2/k1HwwrnwPwAkj9X+Bba3PmfP8+yxaGkHJCwKSPTXHxvZs+DHcmNerIGnXCPMF4AIUAAungzFhA335yUmFpvsA0no4FKMVXRgMDgMVAnHkWtmpLQGqhlGoj/ZJG1Z1Dch+ADABsug97J+CNjxXW/uzRcQc9A1LX7uZQl5EjXFWRMJcQcvP9sYQrsLPOtc2RvwclGnFwTG5XSkuu7Uud3RdWWgG0A7gKQBoT+C/rCh58sa5gFyEks8hlnLrzeODT1m6xs7rcPN9hZu2j7YsdXF5ZvuB8tzt1eJMn2bI9KF/MHW+ILyszkZPe1FEAYQDqiP0t6f/ANNvEQy+VHeM5phAAKKV0Y2PPto2NPW/VlJuqinP4RR9fERVfWElkm1jm3gKDs3aGueiBkowCjgGJpWiQELBmA5NNQZUVfwl8Z29boklfAL0t+IWGinemFJjWpPeFYkq46PFT3w7HlT4ABQAc+jHKAASehb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Qqr2A/gJIDwSDFBdX0eiV/tuT9deadpU9kcq4mzXV856Jv7fBcGI4rrMQdvLTWymQmNtoiUDtlZYnTxzMxJArOy1MasJITcpOuUgr7oE9vCKjwA+gAkbpdYGACuH3wjr37LUyXrOJZw57ri4QXPtu/hRPVoy1TL2iKBmU4BCooUCHiiqyWloEFFEy+JWhQAKTEylu2D8pVf9IkHARwD0Hoj1G4BrgEY+nOTf7fTxk/41eOFdZt29pwNxZTL6/OFGRMN5B595QQEN3Gj4Zp06bcDqXavpF0DILp5Yrwm02EAbbpCRu+YUnOsHBmMKGYAk++fal3afCGSLBYY32dlls0CQxxf5LM7KPV8z5c6sqGuYGL9N93TCYHW8MFA0/rt3h1JSbukVzLJO1YyiZSG6kqH3NGbjPdeS/UBuFrn4N2LbNxijhDTaPukRpV6r9j86ENu44a6wkUZApsh8EzGfaWZUyNJtaf5QqRZ37U2pjKqozeJ6kqH1NGbHAYweDKuXvlDIPVJc1SNeSVN65O0pCelxc4l1dCBkNK9Pyy3vP6TSbPyHYLrRqlECGMSWOu2Q/6PAAylkfrOpfO+T4I0TVS0iArP+8PKnveHlZMAstOq0gQArz8sTwNQnj5Ht19kALgBXNHj/MvX7c/kGaSmYcXXIWpBAB06sKBHhwwg8cquXmVGsXlGXvZ1afb6xfhvdveeTwtp3LGAHEMjOujoOZxTCkxLHp5jXyGr1La/OdjbNSD+B8BRABfTd343ft4E/YhLAeTqfyheAJcBhNIJdzfAiS7Tmfq1qABiOifUdMP/ArnpYR4n/RFLAAAAAElFTkSuQmCC">Documentation Ubuntu en français</A>
152
<DT><A HREF="http://www.april.org/" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAA+fn5AIVTCQDy7OQAHBwcAK6urgDz7ucAeUIAAHtFAABjY2MAjV4UAPv69wDh1cMAnZ2dAPX19QDm28sAf39/AMKpggCfdzkACQkJAPr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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT09PT09PT09PT09PT09PTyJAY09PT09PTw5XRShPT08NAF0jT09PT08NAFQ7D09PATQAHk9PT09PJAAvTwwzT09bAEMhVSlNJQBDI08UNzFPDgQAAAAAAAAAQU9PT1wRT08lAFAFFTUAKypPT09OEk9PYCY+Mk9HAA1PT08ZCixPT09AAEVWOEY8T09PHEQnT09PLiBfEABRT09PGgIHGE9PT08JABNYDk9PZGFKNkJPT09PSFMAUk8fSS0IPR1PT09PT08wTBdPOlkHPzlPT09PT09PWmJPTwMWG0tPT09PT09PTyNeT08LBk9PT09PT09PT09PT09PT09PT09PTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=">April, Promouvoir et défendre le logiciel libre</A>
153
EOF
154
tail -n 10 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html
155
mv /tmp/bookmarks.html /etc/firefox/profile/bookmarks.html
156
157
## This is specific to French localization, since we translated examples.
158
rm -rf /usr/share/example-content/*
159
wget --no-check-certificate -P /usr/share/example-content/ https://kinouchoulittleangel.homelinux.org/Exemples.tar.bz2 
160
cd /usr/share/example-content/
161
tar -xf Exemples.tar.bz2 -C .
162
rm Exemples.tar.bz2
163
mv Exemples/* .
164
rmdir Exemples
165
wget https://launchpad.net/ubuntu/lucid/+source/example-content/41/+files/example-content_41.tar.gz
166
tar -xf example-content_41.tar.gz example-content-41/Ubuntu_Free_Culture_Showcase/ 
167
tar -xf example-content_41.tar.gz example-content-41/logos/
168
rm -rf Ubuntu\ Culture\ Libre\ exemples/*
169
mv example-content-41/Ubuntu_Free_Culture_Showcase/*  Ubuntu\ Culture\ Libre\ exemples/
170
mv example-content-41/logos/* logos
171
rm example-content_41.tar.gz 
172
rm -rf example-content-41
173
wget --no-check-certificate -P /usr/share/example-content/Ubuntu\ Culture\ Libre\ exemples/ http://thetys-retz.net/~endymion/UbuntuIsHumanity.srt http://thetys-retz.net/~endymion/UbuntuIsHumanity.txt
174
mv LiveCD_francais_remerciements.txt Ubuntu_Édition_Francophone_remerciements.txt
175
chown -R 999:999 *
176
177
cd /
178
179
# French radios in ryhtmnbox
180
wget -O /usr/lib/rhythmbox/plugins/iradio/iradio-initial.pls --no-check-certificate http://thetys-retz.net/~endymion/iradio-initial.pls 
181
182
# This is specific too, since simpecommeubuntu is a french book
183
# First trying to install it from the repository 
184
apt-get install simplecommeubuntu
185
# if it fails, getting it from the author.
186
if [ ! 130 -eq "0" ]; then 
187
        wget http://people.canonical.com/~didrocks/simplecommeubuntu_10.04_all.deb
188
        dpkg -i simplecommeubuntu*deb
189
        rm simplecommeubuntu*deb
190
fi
191
apt-get -y install simplecommeubuntu
192
# in any case, we want a direct link on the desktop
193
mkdir /etc/skel/Bureau/
194
cat > /etc/skel/Bureau/scu-10.04.desktop <<EOF
195
#!/usr/bin/env xdg-open
196
[Desktop Entry]
197
Name=Simple Comme Ubuntu 10.04
198
Comment=Livre libre décrivant l'utilisation d'Ubuntu
199
Icon=scu-3d
200
Type=Link
201
MimeType=application/x-pdf
202
URL=file:///usr/share/doc/simplecommeubuntu/scu-10.04LTS.pdf.gz
203
EOF
204
wget -O /usr/share/pixmaps/scu-3d.png http://people.canonical.com/~didrocks/ubuntu10_04.png
205
206
# cleanning
207
apt-get install deborphan
208
apt-get -y purge  fastjar
209
apt-get -y purge deborphan
210
# Getting out the chroot environment
211
apt-get -y autoremove --purge
212
sed -i -r -e 's/(deb .* .*iverse)/# \1/' /etc/apt/sources.list
213
apt-get -y update
214
apt-get -y clean
215
rm -rf /tmp/*
216
rm -rf /var/tmp/*
217
cp /dev/null /etc/resolv.conf
218
cp /dev/null /etc/hosts
219
220
rm /root/fr.sh
221