~vincentxavier/isocustomization/iso-localization

« back to all changes in this revision

Viewing changes to script_francisation.sh

  • Committer: Vincent-Xavier JUMEL
  • Date: 2010-06-13 16:39:49 UTC
  • Revision ID: endymion@hyperion-20100613163949-kgc65a3tvqc2npml
Modified main script to copy inside_chroot.sh to /root/fr.sh

/root/fr.sh should be renamed to a more specific name. I should find a 
good method to pass variable (such as $LANG)

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
sudo mount -t sysfs none ${WD}/edit/sys
117
117
sudo mount -t devpts none ${WD}/edit/dev/pts
118
118
 
119
 
cat > ${WD}/tmp/fr.sh << EOF1
120
 
 
121
 
#!/bin/sh
122
 
# Updating repositories
123
 
 
124
 
apt-get update
125
 
 
126
 
# Removing unused packages
127
 
LANG=C
128
 
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\`
129
 
 
130
 
# Installing packages
131
 
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
132
 
LANG=fr_FR.UTF-8
133
 
 
134
 
# Purging *.mo files
135
 
# May be inmproved
136
 
 
137
 
# Creating localepurge configuration file
138
 
 
139
 
cat >> /etc/locale.nopurge << EOF
140
 
####################################################
141
 
# This is the configuration file for localepurge(8).
142
 
####################################################
143
 
 
144
 
####################################################
145
 
# Uncommenting this string enables removal of localized 
146
 
# man pages based on the configuration information for
147
 
# locale files defined below:
148
 
 
149
 
MANDELETE
150
 
 
151
 
####################################################
152
 
# Uncommenting this string causes localepurge to simply delete
153
 
# locales which have newly appeared on the system without
154
 
# bothering you about it:
155
 
 
156
 
DONTBOTHERNEWLOCALE
157
 
 
158
 
####################################################
159
 
# Uncommenting this string enables display of freed disk
160
 
# space if localepurge has purged any superfluous data:
161
 
 
162
 
SHOWFREEDSPACE
163
 
 
164
 
#####################################################
165
 
# Commenting out this string enables faster but less
166
 
# accurate calculation of freed disk space:
167
 
 
168
 
#QUICKNDIRTYCALC
169
 
 
170
 
#####################################################
171
 
# Commenting out this string disables verbose output:
172
 
 
173
 
#VERBOSE
174
 
 
175
 
#####################################################
176
 
# Following locales won't be deleted from this system
177
 
# after package installations done with apt-get(8):
178
 
 
179
 
fr
180
 
fr_FR
181
 
fr_FR@euro
182
 
fr_FR.UTF-8
183
 
 
184
 
EOF
185
 
 
186
 
# Really purging locale
187
 
apt-get -y install localepurge
188
 
localepurge
189
 
apt-get -y purge localepurge
190
 
 
191
 
apt-get -y upgrade
192
 
 
193
 
# Changing the name onto the CD
194
 
sed -i "s/Live session user/Session CD/g" /etc/casper.conf
195
 
sed -i "s/Live session user/Session CD/g" /usr/share/initramfs-tools/scripts/casper
196
 
 
197
 
##  Link edition on the desktop in casper
198
 
sed -i 's/Desktop/Bureau/g;s/Examples/Exemples/g' /usr/share/initramfs-tools/scripts/casper-bottom/10adduser
199
 
 
200
 
# TTY localisation 
201
 
dpkg-reconfigure -phigh console-setup
202
 
 
203
 
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
204
 
sed -i 's/and press ENTER to continue/et appuyez sur Entrée pour continuer/' /etc/init.d/casper
205
 
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
206
 
 
207
 
# Todo : casped-md5sum translation
208
 
 
209
 
# Live CD doesn't accept UID greater than 500
210
 
 
211
 
if [ -n \`grep '^[^:]*:[^:]*:[1-9][0-9][0-9][0-9]:' /etc/passwd\` ] ; then 
212
 
    usermod -u 500 \$login ; 
213
 
fi
214
 
if [ -n \`grep '^[^:]*:[^:]*:[12][0-9][0-9][0-9][0-9]:' /etc/passwd\` ] ; then 
215
 
    usermod -u 500 \$login ; 
216
 
fi
217
 
 
218
 
VAR="\`basename /boot/initrd.img-*-generic\`" ; KV=\${VAR/initrd.img-/} ; echo \${KV}
219
 
 
220
 
mkdir -p /tmp/init
221
 
mkinitramfs -o /tmp/init/initrd.gz \${KV}
222
 
 
223
 
## extrait
224
 
cd /tmp/init
225
 
gzip -dc initrd.gz | cpio -id
226
 
rm *.gz
227
 
 
228
 
## Compressing back the initrd in lzma format
229
 
find . | cpio --quiet --dereference -o -H newc | lzma -7 > /initrd.lz
230
 
cd /
231
 
rm -R /tmp/init
232
 
 
233
 
 
234
 
# Removing the old initrd and getting the new one in place
235
 
rm /boot/initrd.img-\${KV}
236
 
 
237
 
 
238
 
 
239
 
# Changing default link in Firefox
240
 
sed -i 's%http://start.ubuntu.com/10.04/%http://start.ubuntu-fr.org/10.04/%' /usr/share/xul-ext/ubufox/components/aboutHome.js
241
 
 
242
 
## And language in case
243
 
sed -i 's/en-US/fr-FR/' /usr/share/xul-ext/ubufox/components/aboutHome.js
244
 
sed -i 's/en-US/fr-FR/' /etc/firefox/pref/firefox.js
245
 
echo 'user_pref("app.releaseNotesURL", "http://doc.ubuntu-fr.org/lucid");' >> /etc/firefox/pref/firefox.js
246
 
echo 'pref("startup.homepage_override_url","file:///usr/share/ubuntu-artwork/home/locales/index-fr.html");' >> /etc/firefox/pref/firefox.js
247
 
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
248
 
#sed -i "s,wiki/FrontPage,," /usr/lib/firefox-3.6.3/defaults/profile/bookmarks.html
249
 
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
250
 
head -n 25 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html
251
 
 
252
 
# More link in Firefox
253
 
cat >> /tmp/bookmarks.html <<EOF
254
 
<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/uzRcQc9A1LX7uZQl5EjXFWRMJcQcvP9sYQrsLPOtc2RvwclGnFwT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dMP/ArnpYR4n/RFLAAAAAElFTkSuQmCC">Documentation Ubuntu en français</A>
255
 
<DT><A HREF="http://www.april.org/" ICON="data:image/x-icon;base64,AAABAAEAEBAAAAAAAABoBQAAFgAAACgAAAAQAAAAIAAAAAEACAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAA+fn5AIVTCQDy7OQAHBwcAK6urgDz7ucAeUIAAHtFAABjY2MAjV4UAPv69wDh1cMAnZ2dAPX19QDm28sAf39/AMKpggCfdzkACQkJAPr49QCqqqoAkGIaAOTk5ADIsY0A/Pr4ANzOtwC7n3YAybOQAOrh1ADExMQA+vj2AAUFBQC1tbUApqamAP7+/gAwMDAAiIiIABISEgClf0UA8/LvALOzswD8/PwALi4uAJpwLgB+SQAA3NzcAL6+vgBXV1cA9O/oAPj4+ADh1MEAKioqAIKCggCacC8AqodRAAwMDADp4NEA8u3mAPr38wD29vYAiloTABkZGQCcczgAfn5+ALi4uAD59/QAQkJCAHlBAACLi4sAJCQkAHx8fADU1NQAsI9dAHtEAAD7+fcABgYGALa2tgCkfkMA////AEBAQACYmJgAenp6AAQEBABCQkMAtLS0AO7u7gCHh4cAICAgAINQAADBwcEAo6OjAKiETAA8PDwA+/v7AC0tLQDs7OwAhFEGAHZ2dgDOzs4AzbiYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAT09PT09PT09PT09PT09PTyJAY09PT09PTw5XRShPT08NAF0jT09PT08NAFQ7D09PATQAHk9PT09PJAAvTwwzT09bAEMhVSlNJQBDI08UNzFPDgQAAAAAAAAAQU9PT1wRT08lAFAFFTUAKypPT09OEk9PYCY+Mk9HAA1PT08ZCixPT09AAEVWOEY8T09PHEQnT09PLiBfEABRT09PGgIHGE9PT08JABNYDk9PZGFKNkJPT09PSFMAUk8fSS0IPR1PT09PT08wTBdPOlkHPzlPT09PT09PWmJPTwMWG0tPT09PT09PTyNeT08LBk9PT09PT09PT09PT09PT09PT09PTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=">April, Promouvoir et défendre le logiciel libre</A>
256
 
EOF
257
 
tail -n 10 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html
258
 
mv /tmp/bookmarks.html /etc/firefox/profile/bookmarks.html
259
 
 
260
 
## This is specific to French localization, since we translated examples.
261
 
rm -rf /usr/share/example-content/*
262
 
wget --no-check-certificate -P /usr/share/example-content/ https://kinouchoulittleangel.homelinux.org/Exemples.tar.bz2 
263
 
cd /usr/share/example-content/
264
 
tar -xf Exemples.tar.bz2 -C .
265
 
rm Exemples.tar.bz2
266
 
mv Exemples/* .
267
 
rmdir Exemples
268
 
wget https://launchpad.net/ubuntu/lucid/+source/example-content/41/+files/example-content_41.tar.gz
269
 
tar -xf example-content_41.tar.gz example-content-41/Ubuntu_Free_Culture_Showcase/ 
270
 
tar -xf example-content_41.tar.gz example-content-41/logos/
271
 
rm -rf Ubuntu\ Culture\ Libre\ exemples/*
272
 
mv example-content-41/Ubuntu_Free_Culture_Showcase/*  Ubuntu\ Culture\ Libre\ exemples/
273
 
mv example-content-41/logos/* logos
274
 
rm example-content_41.tar.gz 
275
 
rm -rf example-content-41
276
 
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
277
 
mv LiveCD_francais_remerciements.txt Ubuntu_Édition_Francophone_remerciements.txt
278
 
chown -R 999:999 *
279
 
 
280
 
cd /
281
 
 
282
 
# French radios in ryhtmnbox
283
 
wget -O /usr/lib/rhythmbox/plugins/iradio/iradio-initial.pls --no-check-certificate http://thetys-retz.net/~endymion/iradio-initial.pls 
284
 
 
285
 
# This is specific too, since simpecommeubuntu is a french book
286
 
# First trying to install it from the repository 
287
 
apt-get install simplecommeubuntu
288
 
# if it fails, getting it from the author.
289
 
if [ ! $? -eq "0" ]; then 
290
 
        wget http://people.canonical.com/~didrocks/simplecommeubuntu_10.04_all.deb
291
 
        dpkg -i simplecommeubuntu*deb
292
 
        rm simplecommeubuntu*deb
293
 
fi
294
 
apt-get -y install simplecommeubuntu
295
 
# in any case, we want a direct link on the desktop
296
 
mkdir /etc/skel/Bureau/
297
 
cat > /etc/skel/Bureau/scu-10.04.desktop <<EOF
298
 
#!/usr/bin/env xdg-open
299
 
[Desktop Entry]
300
 
Name=Simple Comme Ubuntu 10.04
301
 
Comment=Livre libre décrivant l'utilisation d'Ubuntu
302
 
Icon=scu-3d
303
 
Type=Link
304
 
MimeType=application/x-pdf
305
 
URL=file:///usr/share/doc/simplecommeubuntu/scu-10.04LTS.pdf.gz
306
 
EOF
307
 
wget -O /usr/share/pixmaps/scu-3d.png http://people.canonical.com/~didrocks/ubuntu10_04.png
308
 
 
309
 
# cleanning
310
 
apt-get install deborphan
311
 
apt-get -y purge `deborphan` fastjar
312
 
apt-get -y purge deborphan
313
 
# Getting out the chroot environment
314
 
apt-get -y autoremove --purge
315
 
sed -i -r -e 's/(deb .* .*iverse)/# \1/' /etc/apt/sources.list
316
 
apt-get -y update
317
 
apt-get -y clean
318
 
rm -rf /tmp/*
319
 
rm -rf /var/tmp/*
320
 
cp /dev/null /etc/resolv.conf
321
 
cp /dev/null /etc/hosts
322
 
 
323
 
rm /root/fr.sh
324
 
 
325
 
EOF1
326
 
 
327
 
sudo mv ${WD}/tmp/fr.sh ${WD}/edit/root/fr.sh
328
 
sudo chmod 755 ${WD}/edit/root/fr.sh
 
119
sudo cp ./inside_chroot.sh ${WD}/root/fr.sh
329
120
 
330
121
sudo chroot ${WD}/edit /bin/bash /root/fr.sh
331
122