Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
projets:traduction_live_cd:inside_chroot.sh [Le 06/10/2010, 23:44] snip |
— (Version actuelle) | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | **→ [[projets:traduction_live_cd:script_francisation.sh|Script de francisation du live CD]]** | ||
- | <code bash> | ||
- | #!/bin/bash | ||
- | # Translation script for Ubuntu CDs | ||
- | # Copyright (C) 2010 Vincent-Xavier JUMEL | ||
- | |||
- | # This program is free software: you can redistribute it and/or modify | ||
- | # it under the terms of the GNU General Public License as published by | ||
- | # the Free Software Foundation, either version 3 of the License, or | ||
- | # (at your option) any later version. | ||
- | | ||
- | # This program is distributed in the hope that it will be useful, | ||
- | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
- | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
- | # GNU General Public License for more details. | ||
- | |||
- | # You should have received a copy of the GNU General Public License | ||
- | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
- | |||
- | # Updating repositories | ||
- | |||
- | apt-get update | ||
- | |||
- | # Removing unused packages | ||
- | LANG=C | ||
- | 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` | ||
- | |||
- | # Installing packages | ||
- | 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 | ||
- | LANG=fr_FR.UTF-8 | ||
- | |||
- | # Purging *.mo files | ||
- | # May be inmproved | ||
- | |||
- | # Creating localepurge configuration file | ||
- | |||
- | cat >> /etc/locale.nopurge << EOF | ||
- | #################################################### | ||
- | # This is the configuration file for localepurge(8). | ||
- | #################################################### | ||
- | |||
- | #################################################### | ||
- | # Uncommenting this string enables removal of localized | ||
- | # man pages based on the configuration information for | ||
- | # locale files defined below: | ||
- | |||
- | MANDELETE | ||
- | |||
- | #################################################### | ||
- | # Uncommenting this string causes localepurge to simply delete | ||
- | # locales which have newly appeared on the system without | ||
- | # bothering you about it: | ||
- | |||
- | DONTBOTHERNEWLOCALE | ||
- | |||
- | #################################################### | ||
- | # Uncommenting this string enables display of freed disk | ||
- | # space if localepurge has purged any superfluous data: | ||
- | |||
- | SHOWFREEDSPACE | ||
- | |||
- | ##################################################### | ||
- | # Commenting out this string enables faster but less | ||
- | # accurate calculation of freed disk space: | ||
- | |||
- | #QUICKNDIRTYCALC | ||
- | |||
- | ##################################################### | ||
- | # Commenting out this string disables verbose output: | ||
- | |||
- | #VERBOSE | ||
- | |||
- | ##################################################### | ||
- | # Following locales won't be deleted from this system | ||
- | # after package installations done with apt-get(8): | ||
- | |||
- | fr | ||
- | fr_FR | ||
- | fr_FR@euro | ||
- | fr_FR.UTF-8 | ||
- | |||
- | EOF | ||
- | |||
- | # Really purging locale | ||
- | apt-get -y install localepurge | ||
- | localepurge | ||
- | apt-get -y purge localepurge | ||
- | |||
- | apt-get -y upgrade | ||
- | |||
- | # Changing the name onto the CD | ||
- | sed -i "s/Live session user/Session CD/g" /etc/casper.conf | ||
- | sed -i "s/Live session user/Session CD/g" /usr/share/initramfs-tools/scripts/casper | ||
- | |||
- | ## Link edition on the desktop in casper | ||
- | sed -i 's/Desktop/Bureau/g;s/Examples/Exemples/g' /usr/share/initramfs-tools/scripts/casper-bottom/10adduser | ||
- | |||
- | # TTY localisation | ||
- | dpkg-reconfigure -phigh console-setup | ||
- | |||
- | 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 | ||
- | sed -i 's/and press ENTER to continue/et appuyez sur Entrée pour continuer/' /etc/init.d/casper | ||
- | 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 | ||
- | |||
- | # Todo : casped-md5sum translation | ||
- | |||
- | # Live CD doesn't accept UID greater than 500 | ||
- | |||
- | if [ -n `grep '^[^:]*:[^:]*:[1-9][0-9][0-9][0-9]:' /etc/passwd` ] ; then | ||
- | usermod -u 500 $login ; | ||
- | fi | ||
- | if [ -n `grep '^[^:]*:[^:]*:[12][0-9][0-9][0-9][0-9]:' /etc/passwd` ] ; then | ||
- | usermod -u 500 $login ; | ||
- | fi | ||
- | |||
- | VAR="`basename /boot/initrd.img-*-generic`" ; KV=${VAR/initrd.img-/} ; echo ${KV} | ||
- | |||
- | mkdir -p /tmp/init | ||
- | mkinitramfs -o /tmp/init/initrd.gz ${KV} | ||
- | |||
- | ## extrait | ||
- | cd /tmp/init | ||
- | gzip -dc initrd.gz | cpio -id | ||
- | rm *.gz | ||
- | |||
- | ## Compressing back the initrd in lzma format | ||
- | find . | cpio --quiet --dereference -o -H newc | lzma -7 > /initrd.lz | ||
- | cd / | ||
- | rm -R /tmp/init | ||
- | |||
- | |||
- | # Removing the old initrd and getting the new one in place | ||
- | rm /boot/initrd.img-${KV} | ||
- | |||
- | |||
- | |||
- | # Changing default link in Firefox | ||
- | sed -i 's%http://start.ubuntu.com/10.04/%http://start.ubuntu-fr.org/10.04/%' /usr/share/xul-ext/ubufox/components/aboutHome.js | ||
- | |||
- | ## And language in case | ||
- | sed -i 's/en-US/fr-FR/' /usr/share/xul-ext/ubufox/components/aboutHome.js | ||
- | sed -i 's/en-US/fr-FR/' /etc/firefox/pref/firefox.js | ||
- | echo 'user_pref("app.releaseNotesURL", "http://doc.ubuntu-fr.org/lucid");' >> /etc/firefox/pref/firefox.js | ||
- | echo 'pref("startup.homepage_override_url","file:///usr/share/ubuntu-artwork/home/locales/index-fr.html");' >> /etc/firefox/pref/firefox.js | ||
- | |||
- | 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-[0-9]*/defaults/profile/bookmarks.html | ||
- | #sed -i "s,wiki/FrontPage,," /usr/lib/firefox-[0-9]*/defaults/profile/bookmarks.html | ||
- | 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-[0-9]*/defaults/profile/bookmarks.html | ||
- | head -n 25 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html | ||
- | |||
- | # More link in Firefox | ||
- | cat >> /tmp/bookmarks.html <<EOF | ||
- | <DT><A HREF="http://doc.ubuntu-fr.org/" ICON="data:image/x-png;base64,iVBORw0KGgoAAAANSUhEUgAAAB8AAAAfCAYAAAAfrhY5AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1QsQFhoEBgWgsgAAB9BJREFUSMe1V3tQVNcZ/5372LvsLruwy8IuKlSQipbgg6gxoDYZHzU1EyFVtEPSt3TS5jFtYhNnTLUdk7TN5NHaxEhr7QSrTo1aGxuc+EpjCPjqgEYxssICK+zKsss+797X6R9e7MpEJZ3xzNy5d875vvM7j9/3+74L3IX2c5dhdusUy9YTpebNS6xcOQADAIK73da5hYe0e21xOst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Jc1SNeSVN65O0pCelxc4l1dCBkNK9Pyy3vP6TSbPyHYLrRqlECGMSWOu2Q/6PAAylkfrOpfO+T4I0TVS0iArP+8PKnveHlZMAstOq0gQArz8sTwNQnj5Ht19kALgBXNHj/MvX7c/kGaSmYcXXIWpBAB06sKBHhwwg8cquXmVGsXlGXvZ1afb6xfhvdveeTwtp3LGAHEMjOujoOZxTCkxLHp5jXyGr1La/OdjbNSD+B8BRABfTd343ft4E/YhLAeTqfyheAJcBhNIJdzfAiS7Tmfq1qABiOifUdMP/ArnpYR4n/RFLAAAAAElFTkSuQmCC">Documentation Ubuntu en français</A> | ||
- | <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+/v7AC0tLQDs7OwAhFEGAHZ2dgDOzs4AzbiYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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T09PT09PT09PT09PT09PTwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=">April, Promouvoir et défendre le logiciel libre</A> | ||
- | EOF | ||
- | tail -n 10 /etc/firefox/profile/bookmarks.html >> /tmp/bookmarks.html | ||
- | mv /tmp/bookmarks.html /etc/firefox/profile/bookmarks.html | ||
- | |||
- | ## This is specific to French localization, since we translated examples. | ||
- | rm -rf /usr/share/example-content/* | ||
- | wget -P /usr/share/example-content/ http://projets.ubuntu-fr.org/iso_fr/Exemples.tar.bz2 | ||
- | cd /usr/share/example-content/ | ||
- | tar -xf Exemples.tar.bz2 -C . | ||
- | rm Exemples.tar.bz2 | ||
- | mv Exemples/* . | ||
- | rmdir Exemples | ||
- | wget https://launchpad.net/ubuntu/lucid/+source/example-content/41/+files/example-content_41.tar.gz | ||
- | tar -xf example-content_41.tar.gz example-content-41/Ubuntu_Free_Culture_Showcase/ | ||
- | tar -xf example-content_41.tar.gz example-content-41/logos/ | ||
- | rm -rf Ubuntu\ Culture\ Libre\ exemples/* | ||
- | mv example-content-41/Ubuntu_Free_Culture_Showcase/* Ubuntu\ Culture\ Libre\ exemples/ | ||
- | mv example-content-41/logos/* logos | ||
- | rm example-content_41.tar.gz | ||
- | rm -rf example-content-41 | ||
- | wget -P /usr/share/example-content/Ubuntu\ Culture\ Libre\ exemples/ http://projets.ubuntu-fr.org/iso_fr/UbuntuIsHumanity.srt http://projets.ubuntu-fr.org/iso_fr/UbuntuIsHumanity.txt | ||
- | chown -R 999:999 * | ||
- | |||
- | cd / | ||
- | |||
- | # French radios in ryhtmnbox | ||
- | wget -O /usr/lib/rhythmbox/plugins/iradio/iradio-initial.pls http://projets.ubuntu-fr.org/iso_fr/iradio-initial.pls | ||
- | |||
- | # This is specific too, since simplecommeubuntu is a french book | ||
- | # First trying to install it from the repository | ||
- | apt-get install simplecommeubuntu | ||
- | # if it fails, getting it from the author. | ||
- | if [ ! $? -eq "0" ]; then | ||
- | wget http://people.canonical.com/~didrocks/simplecommeubuntu_10.04_all.deb | ||
- | dpkg -i simplecommeubuntu*deb | ||
- | rm simplecommeubuntu*deb | ||
- | fi | ||
- | apt-get -y install simplecommeubuntu | ||
- | # in any case, we want a direct link on the desktop | ||
- | mkdir /etc/skel/Bureau/ | ||
- | cat > /etc/skel/Bureau/scu-10.04.desktop <<EOF | ||
- | #!/usr/bin/env xdg-open | ||
- | [Desktop Entry] | ||
- | Name=Simple Comme Ubuntu 10.04 | ||
- | Comment=Livre libre décrivant l'utilisation d'Ubuntu | ||
- | Icon=scu-3d | ||
- | Type=Link | ||
- | MimeType=application/x-pdf | ||
- | URL=file:///usr/share/doc/simplecommeubuntu/scu-10.04LTS.pdf.gz | ||
- | EOF | ||
- | wget -O /usr/share/pixmaps/scu-3d.png http://people.canonical.com/~didrocks/ubuntu10_04.png | ||
- | |||
- | # cleanning | ||
- | apt-get -y install deborphan | ||
- | apt-get -y purge fastjar | ||
- | apt-get -y purge deborphan | ||
- | # Getting out the chroot environment | ||
- | apt-get -y autoremove --purge | ||
- | sed -i -r -e 's/(deb .* .*iverse)/# \1/' /etc/apt/sources.list | ||
- | apt-get -y update | ||
- | apt-get -y clean | ||
- | rm -rf /tmp/* | ||
- | rm -rf /var/tmp/* | ||
- | cp /dev/null /etc/resolv.conf | ||
- | cp /dev/null /etc/hosts | ||
- | |||
- | rm /root/fr.sh | ||
- | </code> |