Ceci est une ancienne révision du document !
→ Script de francisation du live CD
#!/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/>. # TODO: SCU 10.04 → SCU 10.10 V_NUM=$1 # 10.04, 10.10... V_NAME=$2 # lucid, maverick... # 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` # We don't want any preconfigure sed -ir 's,^[^//](.*),// \1,' /etc/apt/apt.conf.d/70debconf # 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 gnome-user-guide-fr openoffice.org-thesaurus-fr LANG=fr_FR.UTF-8 # Purging *.mo files # May be inmproved # Purging locale apt-get -y install localepurge wget -O /etc/locale.nopurge http://projets.ubuntu-fr.org/iso_fr/locale.nopurge localepurge apt-get -y purge localepurge rm -f /etc/locale.nopurge 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 # @@@ Is this necessary? 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 # Translation of casper-md5check (checking...) # # How to make the translation: # apt-get install dpkg-dev libplymouth-dev # apt-get source casper # cd casper*/casper-md5check # wget http://projets.ubuntu-fr.org/iso_fr/casper-md5check.c.patch # patch -p0 < casper-md5check.c.patch # # iconv -t ISO_8859-1 casper-md5check.c # make # # File already compiled for lucid: http://projets.ubuntu-fr.org/iso_fr/casper-md5check # md5sum: 92c540d17f244fb3ee62dc2ee969568b # version: casper-1.236 # arch: i386 # encoding: ISO_8859-1 /!\ Not correct! /!\ # # File already compiled for maverick: http://projets.ubuntu-fr.org/iso_fr/casper_1.248_i386_utf8_casper-md5check # md5sum: faeca662e5b80cc78ed4baf5d3f86c2c # version: casper-1.248 # arch: i386 # encoding: UTF8 # wget http://projets.ubuntu-fr.org/iso_fr/casper-md5check -O /usr/lib/casper/casper-md5check wget http://projets.ubuntu-fr.org/iso_fr/casper_1.248_i386_utf8_casper-md5check -O /usr/lib/casper/casper-md5check chmod +x /usr/lib/casper/casper-md5check # Live CD doesn't accept UID greater than 500 # @@@ What's this? 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} # # Firefox # # Search plugins rm -f /usr/share/xul-ext/ubufox/searchplugins/ask.xml # Delete very-english ask.com if exists rm -rf /usr/lib/firefox-addons/searchplugins/fr wget http://projets.ubuntu-fr.org/iso_fr/searchplugins.tgz tar xzf searchplugins.tgz -C /usr/lib/firefox-addons/searchplugins/ rm searchplugins.tgz # Changing default link in Firefox sed -i 's%http://start.ubuntu.com/%http://start.ubuntu-fr.org/%' /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/'${V_NAME}'");' >> /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 # Bookmarks in Firefox wget http://projets.ubuntu-fr.org/iso_fr/bookmarks.html -O /etc/firefox/profile/bookmarks.html ## This is specific to French localization, since we translated examples. rm -rf /usr/share/example-content/* wget http://projets.ubuntu-fr.org/iso_fr/exemples.tar.gz tar -xzvf exemples.tar.gz -C /usr/share/example-content/ rm exemples.tar.gz wget https://launchpad.net/ubuntu/${V_NAME}/+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 /usr/share/example-content/* # French radios in ryhtmnbox wget -O /usr/lib/rhythmbox/plugins/iradio/iradio-initial.pls http://projets.ubuntu-fr.org/iso_fr/iradio-initial.pls # # Simple comme Ubuntu # This is specific too, since simplecommeubuntu is a french book # if [ $V_NUM == "10.04" ]; then # First trying to install it from the repository apt-get -y 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 # 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 elif [ $V_NUM == "10.10" ]; then wget http://people.canonical.com/~didrocks/simplecommeubuntu_10.10_all.deb dpkg -i simplecommeubuntu*deb rm simplecommeubuntu*deb mkdir /etc/skel/Bureau/ cat > /etc/skel/Bureau/scu-10.10.desktop <<EOF #!/usr/bin/env xdg-open [Desktop Entry] Name=Simple Comme Ubuntu 10.10 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.10(.10?).pdf.gz EOF wget -O /usr/share/pixmaps/scu-3d.png http://people.canonical.com/~didrocks/ubuntu10_04.png fi # cleanning # @@@ What's this? ## 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 -f /var/log/apt/* ; rm -f /var/log/dpkg.log rm -rf /tmp/* rm -rf /var/tmp/* cp /dev/null /etc/resolv.conf cp /dev/null /etc/hosts rm /root/fr.sh