Contenu | Rechercher | Menus

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/>.
 
V_NUM=$1  # 10.04, 10.10...
V_NAME=$2 # lucid, maverick...
ARCH=$3   # i386, amd64...
 
# 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 locale
wget -O /etc/locale.nopurge http://projets.ubuntu-fr.org/iso_fr/locale.nopurge
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? Yes, necessary to put SCU on the desktop (live mode)
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
#   make
#
# NB: the encoding must be UTF-8 (or ASCII)
#
# File already compiled for lucid: http://projets.ubuntu-fr.org/iso_fr/casper_lucid_i386_casper-md5check
#   md5sum: fb5b86ab5d99e519af0c5f7563afb614
#   version: casper-1.236
#   arch: i386
#   encoding: UTF8
#
# File already compiled for lucid: http://projets.ubuntu-fr.org/iso_fr/casper_lucid_amd64_casper-md5check
#   md5sum: 5863ea335b461f9cfa61f81bd8b0476c
#   version: casper-1.236
#   arch: amd64
#   encoding: UTF8
#
# File already compiled for maverick: http://projets.ubuntu-fr.org/iso_fr/casper_maverick_i386_casper-md5check
#   md5sum: faeca662e5b80cc78ed4baf5d3f86c2c
#   version: casper-1.248
#   arch: i386
#   encoding: UTF8
#
# File already compiled for maverick: http://projets.ubuntu-fr.org/iso_fr/casper_maverick_amd64_casper-md5check
#   md5sum: f77bf1d57dac3de556b8fdf7ad4ccb26
#   version: casper-1.248
#   arch: amd64
#   encoding: UTF8
#
wget http://projets.ubuntu-fr.org/iso_fr/casper_${V_NAME}_${ARCH}_casper-md5check -O /usr/lib/casper/casper-md5check
chmod +x /usr/lib/casper/casper-md5check
 
 
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 'user_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
 
 
# Examples
rm -rf /usr/share/example-content/*
wget http://projets.ubuntu-fr.org/iso_fr/exemples-${V_NAME}.tar.gz
tar -xzf exemples-${V_NAME}.tar.gz
mv exemples-${V_NAME}/* /usr/share/example-content/
rm -rf exemples-${V_NAME}*
chown -R 999:999 /usr/share/example-content/*
 
# French radios in rhythmnbox
wget -O /usr/lib/rhythmbox/plugins/iradio/iradio-initial.pls http://projets.ubuntu-fr.org/iso_fr/radio.pls
 
#
# Simple comme Ubuntu
# This is specific too, since simplecommeubuntu is a french book
#
 
mkdir /etc/skel/Bureau/
wget -O /usr/share/pixmaps/scu-3d.png http://people.canonical.com/~didrocks/ubuntu10_04.png
wget -O /etc/skel/Bureau/scu-${V_NUM}.desktop http://projets.ubuntu-fr.org/iso_fr/scu-${V_NUM}.desktop
if [ $V_NUM == "10.04" ]; then
  apt-get -y install simplecommeubuntu
elif [ $V_NUM == "10.10" ]; then
  wget http://people.canonical.com/~didrocks/simplecommeubuntu_10.10_all.deb
  dpkg -i simplecommeubuntu*deb
  rm simplecommeubuntu*deb
fi
 
 
# 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


Le contenu de ce wiki est sous licence : CC BY-SA v3.0