#!/usr/bin/perl -w

#########################################################################################
#
# Script d'installation des programmes tiers pour XCFA:
#    Debian          : apt-get ou aptitude
#    Mandriva        : urpmi ou rpm (de preference urpmi)
#    Fedora          : yum ou rpm (de preference Yum)
#    OpenSuse        : zypper
#    Slackware       : slackpkg et installpkg
#    Frugalware      : pacman-g2
#
#########################################################################################
#
#     Script cree par:
#       -b52       http://www.xcfa.tuxfamily.org/
#       -leonux    http://ubunteros.tuxfamily.org/
#       -Guilmout
#
#########################################################################################
#
# Licence GPL 3
#
# GNU General Public License
#
# 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 2 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, write to the Free Software
# OLD ADRESS:
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# NEW ADRESS:
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#########################################################################################


use strict;			# Toutes les variables doivent etre declarees
use warnings;		# Verification de la syntaxe
use File::Copy;		# Utilisation de la fonction copy
use Switch;			# Utilisation des switch --> paquet perl-switch


my $VERSION = '5.0.0';
my $PACKAGE = 'xcfa_install_all.pl';


#########################################################################################
# CONSTANTES POUR LA TABLE DES APPLICATIONS EXTERNES
#########################################################################################

use constant {
	PACKAGEDEBIAN_64	=> 0,	# Nom du PacKage DEBIAN 64 bits		my $LePaquet
	PACKAGEDEBIAN_32	=> 1,	# Nom du PacKage DEBIAN 32 bits		my $LePaquet
	PACKAGERPM_64		=> 2,	# Nom du PacKage RPM 64 bits		my $LePaquet
	PACKAGERPM_32		=> 3,	# Nom du PacKage RPM 32 bits		my $LePaquet
	PACKAGERPMZYPPER_64	=> 4,	# Nom du PacKage RPMZYPPER 64 bits	my $LePaquet
	PACKAGERPMZYPPER_32	=> 5,	# Nom du PacKage RPMZYPPER 32 bits	my $LePaquet
	PACKAGEYUM_64		=> 6,	# Nom du PacKage PACKAGEYUM_64 bits	my $LePaquet
	PACKAGEYUM_32		=> 7,	# Nom du PacKage PACKAGEYUM_32 bits	my $LePaquet
	PACKAGETGZ_64		=> 8,	# Nom du PacKage TGZ 64 bits		my $LePaquet
	PACKAGETGZ_32		=> 9,	# Nom du PacKage TGZ 32 bits		my $LePaquet
	PACKAGE_FPM_64		=> 10,	# Nom du PacKage FPM 64 bits		my $LePaquet
	PACKAGE_FPM_32		=> 11,	# Nom du PacKage FPM 32 bits		my $LePaquet
	NAME1				=> 12,	# Nom un
	NAME2				=> 13,	# Nom deux
	NAME3				=> 14,	# Nom trois
	FOUND				=> 15,	# Found=o, NOT Found=N PUIS Installation=I
	DEPOTDEBIAN_64		=> 16,	# Depot Personnel DEB 64 bits		my $ClefDepot
	DEPOTDEBIAN_32		=> 17,	# Depot Personnel DEB 32 bits		my $ClefDepot
	DEPOTRPM_64			=> 18,	# Depot Personnel RPM 64 bits		my $ClefDepot
	DEPOTRPM_32			=> 19,	# Depot Personnel RPM 32 bits		my $ClefDepot
	DEPOTRPMZYPPER_64	=> 20,	# Depot Personnel RPM_ZYPPER 64 bits	my $ClefDepot
	DEPOTRPMZYPPER_32	=> 21,	# Depot Personnel DEB_ZYPPER 32 bits	my $ClefDepot
	DEPOTYUM_64			=> 22,	# Depot Personnel RPM_YUM 64 bits	my $ClefDepot
	DEPOTYUM_32			=> 23,	# Depot Personnel DEB_YUM 32 bits	my $ClefDepot
	DEPOTTGZ_64			=> 24,	# Depot Personnel TGZ 64 bits		my $ClefDepot
	DEPOTTGZ_32			=> 25,	# Depot Personnel TGZ 32 bits		my $ClefDepot
	DEPOT_FPM_64		=> 26,	# Depot Personnel FPM 64 bits		my $ClefDepot
	DEPOT_FPM_32		=> 27,	# Depot Personnel FPM 32 bits		my $ClefDepot
	DESCRIPTION			=> 28	# Description du package
};


#########################################################################################
# INDICES
#########################################################################################
my $LePaquet = '';
my $ClefDepot = '';


#########################################################################################
# 30 PAQUETS
#########################################################################################
# libnotify-bin++
# aacplusenc++
# mp3gain++
# vorbisgain++
# mpc123 / mppdec++
# mppenc++
# mac++
# shorten++
# checkmp3 / mp3_check / mp3check++
# normalize-audio / normalize++
# mplayer++
# faac++
# faad / faad2++
# sox et libsox-fmt-all++
# vorbis-tools++
# lame++
# flac++
# wavpack++
# lsdvd++
# cdparanoia++
# shntool++
# icedax / cdda2wav++


my @tableau = (
["libnotify-bin",										# PACKAGEDEBIAN_64
"libnotify-bin",										# PACKAGEDEBIAN_32
"libnotify",											# PACKAGERPM_64
"libnotify",											# PACKAGERPM_32
"libnotify-bin",										# PACKAGERPMZYPPER_64
"libnotify-bin",										# PACKAGERPMZYPPER_32
"libnotify-bin",										# PACKAGEYUM_64
"libnotify-bin",										# PACKAGEYUM_32
"libnotify-bin",										# PACKAGETGZ_64
"libnotify-bin",										# PACKAGETGZ_32
"libnotify-bin",										# PACKAGE_FPM_64
"libnotify-bin",										# PACKAGE_FPM_32
"notify-send",											# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"libnotify-0.4.4-i686-4as.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"A program to send desktop notifications"],				# DESCRIPTION

["aacplusenc",											# PACKAGEDEBIAN_64
"aacplusenc",											# PACKAGEDEBIAN_32
"aacplusenc",											# PACKAGERPM_64
"aacplusenc",											# PACKAGERPM_32
"aacplusenc",											# PACKAGERPMZYPPER_64
"aacplusenc",											# PACKAGERPMZYPPER_32
"aacplusenc",											# PACKAGEYUM_64
"aacplusenc",											# PACKAGEYUM_32
"aacplusenc",											# PACKAGETGZ_64
"aacplusenc",											# PACKAGETGZ_32
"aacplusenc",											# PACKAGE_FPM_64
"aacplusenc",											# PACKAGE_FPM_32
"aacplusenc",											# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"aacplusenc_0.17.3_amd64.deb",							# DEPOTDEBIAN_64
"aacplusenc_0.17.3_i386.deb",							# DEPOTDEBIAN_32
"aacplusenc-0.17.3_amd64.rpm",							# DEPOTRPM_64
"aacplusenc-0.17.3_i386.rpm",							# DEPOTRPM_32
"aacplusenc-0.17.3_amd64.rpm",							# DEPOTRPMZYPPER_64
"aacplusenc-0.17.3_i386.rpm",							# DEPOTRPMZYPPER_32
"aacplusenc-0.17.3_amd64.rpm",							# DEPOTYUM_64
"aacplusenc-0.17.3_i386.rpm",							# DEPOTYUM_32
"aacplusenc-0.17.3_amd64.tgz",							# DEPOTTGZ_64
"aacplusenc-0.17.3_i386.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"AAC+ encoder"],										# DESCRIPTION

["mp3gain",												# PACKAGEDEBIAN_64
"mp3gain",												# PACKAGEDEBIAN_32
"mp3gain",												# PACKAGERPM_64
"mp3gain",												# PACKAGERPM_32
"mp3gain",												# PACKAGERPMZYPPER_64
"mp3gain",												# PACKAGERPMZYPPER_32
"mp3gain",												# PACKAGEYUM_64
"mp3gain",												# PACKAGEYUM_32
"mp3gain",												# PACKAGETGZ_64
"mp3gain",												# PACKAGETGZ_32
"mp3gain",												# PACKAGE_FPM_64
"mp3gain",												# PACKAGE_FPM_32
"mp3gain",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"mp3gain-1.4.6-8.amd64.rpm",							# DEPOTRPM_64
"mp3gain-1.4.6-8.i386.rpm",								# DEPOTRPM_32
"mp3gain-1.4.6-8.amd64.rpm",							# DEPOTRPMZYPPER_64
"mp3gain-1.4.6-8.i386.rpm",								# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"mp3gain-1.4.6-i486-48.1.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Normaliseur de fichier mp3"],							# DESCRIPTION

["cd-discid",											# PACKAGEDEBIAN_64
"cd-discid",											# PACKAGEDEBIAN_32
"cd-discid",											# PACKAGERPM_64
"cd-discid",											# PACKAGERPM_32
"cd-discid",											# PACKAGERPMZYPPER_64
"cd-discid",											# PACKAGERPMZYPPER_32
"cd-discid",											# PACKAGEYUM_64
"cd-discid",											# PACKAGEYUM_32
"cd-discid",											# PACKAGETGZ_64
"cd-discid",											# PACKAGETGZ_32
"cd-discid",											# PACKAGE_FPM_64
"cd-discid",											# PACKAGE_FPM_32
"cd-discid",											# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"",														# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"read CD and get CDDB discid information"],				# DESCRIPTION

["vorbisgain",											# PACKAGEDEBIAN_64
"vorbisgain",											# PACKAGEDEBIAN_32
"vorbisgain",											# PACKAGERPM_64
"vorbisgain",											# PACKAGERPM_32
"vorbisgain",											# PACKAGERPMZYPPER_64
"vorbisgain",											# PACKAGERPMZYPPER_32
"vorbisgain",											# PACKAGEYUM_64
"vorbisgain",											# PACKAGEYUM_32
"vorbisgain",											# PACKAGETGZ_64
"vorbisgain",											# PACKAGETGZ_32
"vorbisgain",											# PACKAGE_FPM_64
"vorbisgain",											# PACKAGE_FPM_32
"vorbisgain",											# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"vorbisgain-0.36-4.amd64.rpm",							# DEPOTRPM_64
"vorbisgain-0.34-2.1.i586.rpm",							# DEPOTRPM_32
"vorbisgain-0.36-4.amd64.rpm",							# DEPOTRPMZYPPER_64
"vorbisgain-0.34-2.1.i586.rpm",							# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"vorbisgain-0.36-i486-48.1.tgz",						# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Normaliseur de fichier ogg"],							# DESCRIPTION

["musepack-tools",										# PACKAGEDEBIAN_64
"musepack-tools",										# PACKAGEDEBIAN_32
"mpc123",												# PACKAGERPM_64
"mpc123",												# PACKAGERPM_32
"mpc123",												# PACKAGERPMZYPPER_64
"mpc123",												# PACKAGERPMZYPPER_32
"mpc123",												# PACKAGEYUM_64
"mpc123",												# PACKAGEYUM_32
"mpc123",												# PACKAGETGZ_64
"mpc123",												# PACKAGETGZ_32
"mpc123",												# PACKAGE_FPM_64
"mpc123",												# PACKAGE_FPM_32
"mppdec",												# NAME1
"mpc123",												# NAME2
"mpcdec",												# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"musepack-decoder_7.1.95z67-2_i386.deb",				# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"musepack-decoder-7.1.95z67-3.i386.rpm",				# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"musepack-decoder-7.1.95z67-3.i386.rpm",				# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"musepack-decoder-7.1.95z67-3.i386.rpm",				# DEPOTYUM_32
"",														# DEPOTTGZ_64
"musepack-decoder-7.1.95z67_i386.tgz",					# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"MPC Decodeur [ mpcdec ]"],								# DESCRIPTION

["musepack-tools",										# PACKAGEDEBIAN_64
"musepack-tools",										# PACKAGEDEBIAN_32
"mppenc",												# PACKAGERPM_64
"mppenc",												# PACKAGERPM_32
"mppenc",												# PACKAGERPMZYPPER_64
"mppenc",												# PACKAGERPMZYPPER_32
"mppenc",												# PACKAGEYUM_64
"mppenc",												# PACKAGEYUM_32
"mppenc",												# PACKAGETGZ_64
"mppenc",												# PACKAGETGZ_32
"mppenc",												# PACKAGE_FPM_64
"mppenc",												# PACKAGE_FPM_32
"mppenc",												# NAME1
"mpcenc",												# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"mppenc-1.16-5.amd64.rpm",								# DEPOTRPM_64
"mppenc-1.16-5.i386.rpm",								# DEPOTRPM_32
"mppenc-1.16-5.amd64.rpm",								# DEPOTRPMZYPPER_64
"mppenc-1.16-5.i386.rpm",								# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"mppenc-1.16_amd64.tgz",								# DEPOTTGZ_64
"mppenc-1.16-i486-1as.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"MPC Encodeur [ mpcenc ]"],								# DESCRIPTION

["monkeys-audio",										# PACKAGEDEBIAN_64
"monkeys-audio",										# PACKAGEDEBIAN_32
"mac",													# PACKAGERPM_64
"mac",													# PACKAGERPM_32
"mac",													# PACKAGERPMZYPPER_64
"mac",													# PACKAGERPMZYPPER_32
"mac",													# PACKAGEYUM_64
"mac",													# PACKAGEYUM_32
"mac",													# PACKAGETGZ_64
"mac",													# PACKAGETGZ_32
"mac",													# PACKAGE_FPM_64
"mac",													# PACKAGE_FPM_32
"mac",													# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"mac-3.99-5.amd64.rpm",									# DEPOTRPM_64
"mac-3.99-5.i386.rpm",									# DEPOTRPM_32
"mac-3.99-5.amd64.rpm",									# DEPOTRPMZYPPER_64
"mac-3.99-5.i386.rpm",									# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"mac-3.99_amd64.tgz",									# DEPOTTGZ_64
"mac-3.99_u4_b5-i486-2sy.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Monkey's Audio [ mac ]"],								# DESCRIPTION

["shorten",												# PACKAGEDEBIAN_64
"shorten",												# PACKAGEDEBIAN_32
"shorten",												# PACKAGERPM_64
"shorten",												# PACKAGERPM_32
"shorten",												# PACKAGERPMZYPPER_64
"shorten",												# PACKAGERPMZYPPER_32
"shorten",												# PACKAGEYUM_64
"shorten",												# PACKAGEYUM_32
"shorten",												# PACKAGETGZ_64
"shorten",												# PACKAGETGZ_32
"shorten",												# PACKAGE_FPM_64
"shorten",												# PACKAGE_FPM_32
"shorten",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"shorten_3.6.1-1_amd64.deb",							# DEPOTDEBIAN_64
"shorten_3.6.0-1_i386.deb",								# DEPOTDEBIAN_32
"shorten-3.6.1-2.amd64.rpm",							# DEPOTRPM_64
"shorten-3.6.0-2.i386.rpm",								# DEPOTRPM_32
"shorten-3.6.1-2.amd64.rpm",							# DEPOTRPMZYPPER_64
"shorten-3.6.0-2.i386.rpm",								# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"shorten-3.6.1_amd64.tgz",								# DEPOTTGZ_64
"shorten-3.6.1-i486-2as.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Forte compression au format wave"],					# DESCRIPTION

["normalize-audio",										# PACKAGEDEBIAN_64
"normalize-audio",										# PACKAGEDEBIAN_32
"normalize",											# PACKAGERPM_64
"normalize",											# PACKAGERPM_32
"normalize",											# PACKAGERPMZYPPER_64
"normalize",											# PACKAGERPMZYPPER_32
"normalize",											# PACKAGEYUM_64
"normalize",											# PACKAGEYUM_32
"normalize",											# PACKAGETGZ_64
"normalize",											# PACKAGETGZ_32
"normalize",											# PACKAGE_FPM_64
"normalize",											# PACKAGE_FPM_32
"normalize-audio",										# NAME1
"normalize",											# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"normalize-0.7.7-0.pm.4.x86_64.rpm",					# DEPOTRPMZYPPER_64
"normalize-0.7.7-0.pm.4.i586.rpm",						# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"normalize-0.7.6-i486-1.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Normaliseur de fichier wav"],							# DESCRIPTION

["checkmp3",											# PACKAGEDEBIAN_64
"checkmp3",												# PACKAGEDEBIAN_32
"mp3_check",											# PACKAGERPM_64
"mp3_check",											# PACKAGERPM_32
"mp3_check",											# PACKAGERPMZYPPER_64
"mp3_check",											# PACKAGERPMZYPPER_32
"checkmp3",												# PACKAGEYUM_64
"checkmp3",												# PACKAGEYUM_32
"checkmp3",												# PACKAGETGZ_64
"checkmp3",												# PACKAGETGZ_32
"checkmp3",												# PACKAGE_FPM_64
"checkmp3",												# PACKAGE_FPM_32
"mp3check",												# NAME1
"checkmp3",												# NAME2
"mp3_check",											# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"mp3_check-1.98-i486-48.1.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Cherche des renseignements sur les formats mp3"],		# DESCRIPTION

["mplayer",												# PACKAGEDEBIAN_64
"mplayer",												# PACKAGEDEBIAN_32
"mplayer",												# PACKAGERPM_64
"mplayer",												# PACKAGERPM_32
"mplayer",												# PACKAGERPMZYPPER_64
"mplayer",												# PACKAGERPMZYPPER_32
"mplayer",												# PACKAGEYUM_64
"mplayer",												# PACKAGEYUM_32
"mplayer",												# PACKAGETGZ_64
"mplayer",												# PACKAGETGZ_32
"mplayer",												# PACKAGE_FPM_64
"mplayer",												# PACKAGE_FPM_32
"mplayer",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"mplayer-20081210-i686-1.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Lecteur et extracteur"],								# DESCRIPTION

["faac",												# PACKAGEDEBIAN_64
"faac",													# PACKAGEDEBIAN_32
"faac",													# PACKAGERPM_64
"faac",													# PACKAGERPM_32
"faac",													# PACKAGERPMZYPPER_64
"faac",													# PACKAGERPMZYPPER_32
"faac",													# PACKAGEYUM_64
"faac",													# PACKAGEYUM_32
"faac",													# PACKAGETGZ_64
"faac",													# PACKAGETGZ_32
"faac",													# PACKAGE_FPM_64
"faac",													# PACKAGE_FPM_32
"faac",													# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"faac-1.26-i486-1.tgz",									# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Audio Codeur freeware"],								# DESCRIPTION

["faad",												# PACKAGEDEBIAN_64
"faad",													# PACKAGEDEBIAN_32
"faad2",												# PACKAGERPM_64
"faad2",												# PACKAGERPM_32
"faad2",												# PACKAGERPMZYPPER_64
"faad2",												# PACKAGERPMZYPPER_32
"faad2",												# PACKAGEYUM_64
"faad2",												# PACKAGEYUM_32
"faad",													# PACKAGETGZ_64
"faad2",												# PACKAGETGZ_32
"faad",													# PACKAGE_FPM_64
"faad",													# PACKAGE_FPM_32
"faad",													# NAME1
"faad2",												# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"faad2-2.6.1-i486-2sl.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"MPEG-4 AAC decodeur"],									# DESCRIPTION

["sox",													# PACKAGEDEBIAN_64
"sox",													# PACKAGEDEBIAN_32
"sox",													# PACKAGERPM_64
"sox",													# PACKAGERPM_32
"sox",													# PACKAGERPMZYPPER_64
"sox",													# PACKAGERPMZYPPER_32
"sox",													# PACKAGEYUM_64
"sox",													# PACKAGEYUM_32
"sox",													# PACKAGETGZ_64
"sox",													# PACKAGETGZ_32
"sox",													# PACKAGE_FPM_64
"sox",													# PACKAGE_FPM_32
"sox",													# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"sox-14.1.0-i486-1.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Transformation universelle de fichiers son"],			# DESCRIPTION

["vorbis-tools",										# PACKAGEDEBIAN_64
"vorbis-tools",											# PACKAGEDEBIAN_32
"vorbis-tools",											# PACKAGERPM_64
"vorbis-tools",											# PACKAGERPM_32
"vorbis-tools",											# PACKAGERPMZYPPER_64
"vorbis-tools",											# PACKAGERPMZYPPER_32
"vorbis-tools",											# PACKAGEYUM_64
"vorbis-tools",											# PACKAGEYUM_32
"vorbis-tools",											# PACKAGETGZ_64
"vorbis-tools",											# PACKAGETGZ_32
"vorbis-tools",											# PACKAGE_FPM_64
"vorbis-tools",											# PACKAGE_FPM_32
"oggenc",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"vorbis-tools-1.2.0-i486-1.tgz",						# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"[Vorbis-tools] Conversion wav : ogg"],					# DESCRIPTION

["lame",												# PACKAGEDEBIAN_64
"lame",													# PACKAGEDEBIAN_32
"lame",													# PACKAGERPM_64
"lame",													# PACKAGERPM_32
"lame",													# PACKAGERPMZYPPER_64
"lame",													# PACKAGERPMZYPPER_32
"lame",													# PACKAGEYUM_64
"lame",													# PACKAGEYUM_32
"lame",													# PACKAGETGZ_64
"lame",													# PACKAGETGZ_32
"lame",													# PACKAGE_FPM_64
"lame",													# PACKAGE_FPM_32
"lame",													# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"lame-3.98.2-i486-2sl.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Conversion wav : mp3"],								# DESCRIPTION

["flac",												# PACKAGEDEBIAN_64
"flac",													# PACKAGEDEBIAN_32
"flac",													# PACKAGERPM_64
"flac",													# PACKAGERPM_32
"flac",													# PACKAGERPMZYPPER_64
"flac",													# PACKAGERPMZYPPER_32
"flac",													# PACKAGEYUM_64
"flac",													# PACKAGEYUM_32
"flac",													# PACKAGETGZ_64
"flac",													# PACKAGETGZ_32
"flac",													# PACKAGE_FPM_64
"flac",													# PACKAGE_FPM_32
"flac",													# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"flac-1.2.1-i486-2.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Conversion wav : flac"],								# DESCRIPTION

["wavpack",												# PACKAGEDEBIAN_64
"wavpack",												# PACKAGEDEBIAN_32
"wavpack",												# PACKAGERPM_64
"wavpack",												# PACKAGERPM_32
"wavpack",												# PACKAGERPMZYPPER_64
"wavpack",												# PACKAGERPMZYPPER_32
"wavpack",												# PACKAGEYUM_64
"wavpack",												# PACKAGEYUM_32
"wavpack",												# PACKAGETGZ_64
"wavpack",												# PACKAGETGZ_32
"wavpack",												# PACKAGE_FPM_64
"wavpack",												# PACKAGE_FPM_32
"wavpack",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"wavpack-4.41.0-i486-1.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"[wavpack] WAVPACK  Hybrid Lossless Audio Compressor"],		# DESCRIPTION

["lsdvd",												# PACKAGEDEBIAN_64
"lsdvd",												# PACKAGEDEBIAN_32
"lsdvd",												# PACKAGERPM_64
"lsdvd",												# PACKAGERPM_32
"lsdvd",												# PACKAGERPMZYPPER_64
"lsdvd",												# PACKAGERPMZYPPER_32
"lsdvd",												# PACKAGEYUM_64
"lsdvd",												# PACKAGEYUM_32
"lsdvd",												# PACKAGETGZ_64
"lsdvd",												# PACKAGETGZ_32
"lsdvd",												# PACKAGE_FPM_64
"lsdvd",												# PACKAGE_FPM_32
"lsdvd",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"lsdvd-0.16-i486-2sl.tgz",								# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Cherche les informations d'un dvd"],					# DESCRIPTION

["cdparanoia",											# PACKAGEDEBIAN_64
"cdparanoia",											# PACKAGEDEBIAN_32
"cdparanoia",											# PACKAGERPM_64
"cdparanoia",											# PACKAGERPM_32
"cdparanoia",											# PACKAGERPMZYPPER_64
"cdparanoia",											# PACKAGERPMZYPPER_32
"cdparanoia",											# PACKAGEYUM_64
"cdparanoia",											# PACKAGEYUM_32
"cdparanoia",											# PACKAGETGZ_64
"cdparanoia",											# PACKAGETGZ_32
"cdparanoia",											# PACKAGE_FPM_64
"cdparanoia",											# PACKAGE_FPM_32
"cdparanoia",											# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"cdparanoia-III_10.2-i486-1.tgz",						# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Extracteur cd audio"],									# DESCRIPTION

["shntool",												# PACKAGEDEBIAN_64
"shntool",												# PACKAGEDEBIAN_32
"shntool",												# PACKAGERPM_64
"shntool",												# PACKAGERPM_32
"shntool",												# PACKAGERPMZYPPER_64
"shntool",												# PACKAGERPMZYPPER_32
"shntool",												# PACKAGEYUM_64
"shntool",												# PACKAGEYUM_32
"shntool",												# PACKAGETGZ_64
"shntool",												# PACKAGETGZ_32
"shntool",												# PACKAGE_FPM_64
"shntool",												# PACKAGE_FPM_32
"shntool",												# NAME1
"",														# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"shntool-3.0.7-1_amd64.rpm",							# DEPOTRPM_64
"shntool-3.0.7-1_i386.rpm",								# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"shntool-3.0.8-i486-2bj.tgz",							# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Decoupage de fichiers sans decodage"],					# DESCRIPTION

["icedax",												# PACKAGEDEBIAN_64
"icedax",												# PACKAGEDEBIAN_32
"icedax",												# PACKAGERPM_64
"icedax",												# PACKAGERPM_32
"icedax",												# PACKAGERPMZYPPER_64
"icedax",												# PACKAGERPMZYPPER_32
"icedax",												# PACKAGEYUM_64
"icedax",												# PACKAGEYUM_32
"icedax",												# PACKAGETGZ_64
"icedax",												# PACKAGETGZ_32
"icedax",												# PACKAGE_FPM_64
"icedax",												# PACKAGE_FPM_32
"icedax",												# NAME1
"cdda2wav",												# NAME2
"",														# NAME3
"",														# FOUND
"",														# DEPOTDEBIAN_64
"",														# DEPOTDEBIAN_32
"",														# DEPOTRPM_64
"",														# DEPOTRPM_32
"",														# DEPOTRPMZYPPER_64
"",														# DEPOTRPMZYPPER_32
"",														# DEPOTYUM_64
"",														# DEPOTYUM_32
"",														# DEPOTTGZ_64
"icedax-1.1.9.tgz",										# DEPOTTGZ_32
"",														# DEPOT_FPM_64
"",														# DEPOT_FPM_32
"Extracteur cd audio"]									# DESCRIPTION

);


#########################################################################################
# RAFFRAICHIR LA CONSOLE
#########################################################################################
system('clear');


#########################################################################################
# DETECTION SI MODE ADMINISTRATEUR
#########################################################################################
my $ModeAdministrateur = ($> != 0) ? "FALSE" : "TRUE";


#########################################################################################
# MODE DEBUG
#########################################################################################
my $ModeDebug = "FALSE";


#########################################################################################
# PRESENTAION DE LA BESTIOLLE
#########################################################################################
print " ______________________________________________________________________
|                                                                      |
|          $PACKAGE                    $VERSION                |
|______________________________________________________________________|
|                                                                      |
|  Script d\'installation des programmes tiers necessaires pour XCFA    |
|                                                                      |
|     Script cree par:                                                 |
|     -b52         http://www.xcfa.tuxfamily.org/                      |
|     -leonux      http://ubunteros.tuxfamily.org/                     |
|     -Guillaume                                                       |
|     Licence GPL 2                                                    |
|______________________________________________________________________|
|                                                                      |","\n";

#########################################################################################
# ROOT ?
#########################################################################################

if ($ModeAdministrateur =~ "TRUE") {
	print "|      VOUS ETES ADMINISTRATEUR : ET L'INSTALLATION S'EFFECTUERA       |\n";
	print "|      Pour une simulation, connectez vous en simple utilisateur       |\n";

} else {
	print "|   VOUS N'ETES PAS ADMINISTRATEUR : UNE SIMULATION SERA EFFECTUEE     |\n";
	print "|   Pour une installation, connectez vous en administrateur            |\n";
}
print "|______________________________________________________________________|\n\n";


#########################################################################################
# RECHERCHE DU TYPE DE CPU
#########################################################################################
my $TypeCpuIsAmd64 = (`uname -m` =~ "x86_64") ? "TRUE" : "FALSE";
print 'Type de CPU ............. : ',`uname -m` ;


#########################################################################################
# PATHNAME DE DOWNLOAD
#########################################################################################
my $path_download;


#########################################################################################
# DEFINITION PATHNAME / SUPPRESSION DOSSIER / CREATION DOSSIER DES TELECHARGEMENTS
#########################################################################################
if ($ModeAdministrateur =~ "TRUE") {
	$path_download = "/tmp/REP_DOWNLOAD_XCFA_ROOT";
} else {
	$path_download = "/tmp/REP_DOWNLOAD_XCFA_USER";
}
if (-d $path_download) {
	system ("rm -rf $path_download");
}
mkdir ($path_download);


#########################################################################################
# VARIABLES
#########################################################################################
my $apt_install = '';		# Contiendra la ligne magique pour l'installation
my $TypePaquet = '';		# DEB ou RPM ou TGZ ou FPM


#########################################################################################
# AFFICHAGE D'UN ENTETE
#########################################################################################
sub affiche_entete
{
	print "\n";
	print "+=============================================================================\n";
	print "|  $_[0]\n";
	print "+=============================================================================\n";
}


#########################################################################################
# SI LE FICHIER CONTENU DANS '$_[0]' EST PRESENT RENVOIE 'TRUE' SINON RENVOIE 'FALSE'
#########################################################################################
sub le_fichier_est_present
{
	if (-f "/sbin/$_[0]") {
		return 'TRUE';
	}
	elsif (-f "/usr/bin/$_[0]") {
		return 'TRUE';
	}
	elsif (-f "/usr/local/bin/$_[0]") {
		return 'TRUE';
	}
	elsif (-f "/usr/sbin/$_[0]") {
		return 'TRUE';
	}
	return 'FALSE';
}


#########################################################################################
# LE TITRE PARLE DE LUI MEME  hein !  ;)
#########################################################################################
sub Choix_des_paquets_pour_installation
{
	my $question;
	my $fichier;
	my $str;
	my $i;
	my $tmp;

	affiche_entete ("C H O I X   D E S   A P P L I C A T I O N S   A   I N S T A L L E R  ...");

	#########################################################################################
	# BOUCLE SUR UNE DEMANDE D INSTALLAION DES FICHIERS ABSENTS
	#########################################################################################
	for ($i=0; $i<@tableau; $i++) {

		#########################################################################################
		# PAR DEFAUT SUR FALSE
		#########################################################################################
		$tableau[$i][ FOUND ] = 'N';

		#########################################################################################
		# TEST LA PRESENCE DES FICHIERS
		#########################################################################################
		$fichier = '';
		if (&le_fichier_est_present($tableau[$i][ NAME1 ]) =~ 'TRUE') {
			$tableau[$i][ FOUND ] = 'o';
			$fichier = $tableau[$i][ NAME1 ];
		} elsif (length($tableau[$i][ NAME2 ]) > 0 && &le_fichier_est_present($tableau[$i][ NAME2 ]) =~ 'TRUE') {
			$tableau[$i][ FOUND ] = 'o';
			$fichier = $tableau[$i][ NAME2 ];
		} elsif (length($tableau[$i][ NAME3 ]) > 0 && le_fichier_est_present($tableau[$i][ NAME3 ]) =~ 'TRUE') {
			$tableau[$i][ FOUND ] = 'o';
			$fichier = $tableau[$i][ NAME3 ];
		}

		if ((length($fichier) > 0) && ($tableau[$i][ FOUND ] =~ "o")) {
			$str = "DEJA INSTALLE:    $fichier ";
			while (length($str) < 37) { $str .= "."; }
			$str .= " $tableau[$i][ DESCRIPTION ] ";
			print "$str\n";
		}

		$question = 'n';
		if ($tableau[$i][ FOUND ] =~ "N") {
			$question = 'o';
		}
		if ($question =~ "o") {
			$str = "Installation de:  $tableau[$i][ $LePaquet ] ";
			while (length($str) < 37) { $str .= "."; }
			$str .= " $tableau[$i][ DESCRIPTION ] ";
			while (length($str) < 100) { $str .= "-"; }
			$str .= "> [O/n] ? ";
			print $str;
			chomp($tmp = <STDIN>);
			if ($tmp !~ 'n') {
				# INSTALLATION
				$tableau[$i][ FOUND ] = "I";
			}
		} else {
			# PAS D INSTALLATION
			$tableau[$i][ FOUND ] = "N";
		}
	}
}


#########################################################################################
# LE TITRE PARLE DE LUI MEME  hein !  ;)
#########################################################################################
sub Installation_depuis_les_depots
{
	my $i;
	my $fichier;

	affiche_entete ("I N S T A L L A T I O N  D E S   A P P L I C A T I O N S...");

	for ($i=0; $i<@tableau; $i++) {

		#########################################################################################
		# L INSTALLATION COMMENCE
		#########################################################################################
		if ($tableau[$i][ FOUND ] =~ "I") {

			$fichier = '';

			switch($TypePaquet) {

				#########################################################################################
				# AMD64 RPM INSTALL
				# I386 RPM INSTALL
				#########################################################################################
				case "RPM"	{

					#########################################################################################
					# DOWNLOAD
					#########################################################################################
					if (length($tableau[$i][ $ClefDepot ]) > 0) {

						$fichier = $tableau[$i][ $ClefDepot ];
						if ($TypeCpuIsAmd64 =~ "TRUE") {
							print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/amd64/Rpm/$fichier\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/amd64/Rpm/$fichier");
						} else {
							print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/i386/Rpm/$fichier\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/i386/Rpm/$fichier");
						}

						if ($ModeAdministrateur =~ "TRUE") {
							if ($apt_install =~ "zypper") {
								system ("$apt_install $path_download/$fichier");
							} else {
								system ("$apt_install $path_download/$fichier");
							}
						} else {
							if ($apt_install =~ "zypper") {
								print "$apt_install $path_download/$fichier\n";
							} else {
								print "$apt_install $path_download/$fichier\n";
							}
						}
					}

					#########################################################################################
					# DEPOT
					#########################################################################################
					else {
						$fichier = $tableau[$i][ $LePaquet ];

						if ($ModeAdministrateur =~ "TRUE") {
							system ("$apt_install $fichier");
						} else {
							print"$apt_install $fichier\n";
						}
					}
				}

				#########################################################################################
				# AMD64 DEB INSTALL
				# I386 DEB INSTALL
				#########################################################################################
				case "DEB"	{

					#########################################################################################
					# DOWNLOAD
					#########################################################################################
					if (length($tableau[$i][ $ClefDepot ]) > 0) {
						$fichier = $tableau[$i][ $ClefDepot ];
						if ($TypeCpuIsAmd64 =~ "TRUE") {
							print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/amd64/Deb/$fichier","\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/amd64/Deb/$fichier");
						} else {
							print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/i386/Deb/$fichier","\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/convertisseurs/i386/Deb/$fichier");
						}
						if ($ModeAdministrateur =~ "TRUE") {
							system("dpkg --unpack $path_download/$fichier");
							system("$apt_install -f");
						} else {
							print "dpkg --unpack $path_download/$fichier\n";
							print "$apt_install -f\n";
						}
					}

					#########################################################################################
					# DEPOT
					#########################################################################################
					else {
						$fichier = $tableau[$i][ $LePaquet ];
						if ($ModeAdministrateur =~ "TRUE") {
							system("$apt_install $fichier");
						} else {
							print "$apt_install $fichier\n";
						}
					}
				}

				#########################################################################################
				# AMD64 TGZ INSTALL
				# I386 TGZ INSTALL
				#########################################################################################
				case "TGZ"	{

					#########################################################################################
					# DOWNLOAD
					#########################################################################################
					if (length($tableau[$i][ $ClefDepot ]) > 0) {

						#########################################################################################
						# SI PAQUET aacplusenc INSTALL DE : fftw-3
						#########################################################################################
						if ($tableau[$i][ $LePaquet ] =~ "aacplusenc") {
							print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/fftw-3.1.2-i486-2kjz.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/fftw-3.1.2-i486-2kjz.tgz");
							print "installpkg $path_download/fftw-3.1.2-i486-2kjz.tgz\n";
							if ($ModeAdministrateur =~ "TRUE") {
								system("installpkg $path_download/fftw-3.1.2-i486-2kjz.tgz");
							}
						}

						#########################################################################################
						# SI PAQUET mplayer, INSTALL DE :
						#	amrnb-7.0.0.2-i486-1as.tgz
						#	amrwb-7.0.0.3-i486-1as.tgz
						#	enca-1.9-i486-1sl.tgz
						#	lirc-0.8.4a-i486-3sbo.tgz
						#	speex-1.2rc1-i486-1dav.tgz
						#	x264-20081031-i486-1gds.tgz
						#	xvidcore-1.2.1-i486-1sl.tgz
						#########################################################################################
						if ($tableau[$i][ $LePaquet ] =~ "mplayer") {
							print "wget amrnb-7.0.0.2-i486-1as.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/amrnb-7.0.0.2-i486-1as.tgz");
							print "wget amrwb-7.0.0.3-i486-1as.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/amrwb-7.0.0.3-i486-1as.tgz");
							print "wget enca-1.9-i486-1sl.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/enca-1.9-i486-1sl.tgz");
							print "wget lirc-0.8.4a-i486-3sbo.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/lirc-0.8.4a-i486-3sbo.tgz");
							print "wget speex-1.2rc1-i486-1dav.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/speex-1.2rc1-i486-1dav.tgz");
							print "wget x264-20081031-i486-1gds.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/x264-20081031-i486-1gds.tgz");
							print "wget xvidcore-1.2.1-i486-1sl.tgz\n";
							system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/dep_mplayer/xvidcore-1.2.1-i486-1sl.tgz");

							print "installpkg $path_download/amrnb-7.0.0.2-i486-1as.tgz\n";
							print "installpkg $path_download/amrwb-7.0.0.3-i486-1as.tgz\n";
							print "installpkg $path_download/enca-1.9-i486-1sl.tgz\n";
							print "installpkg $path_download/lirc-0.8.4a-i486-3sbo.tgz\n";
							print "installpkg $path_download/speex-1.2rc1-i486-1dav.tgz\n";
							print "installpkg $path_download/x264-20081031-i486-1gds.tgz\n";
							print "installpkg $path_download/xvidcore-1.2.1-i486-1sl.tgz\n";

							if ($ModeAdministrateur =~ "TRUE") {
								system("installpkg $path_download/amrnb-7.0.0.2-i486-1as.tgz");
								system("installpkg $path_download/amrwb-7.0.0.3-i486-1as.tgz");
								system("installpkg $path_download/enca-1.9-i486-1sl.tgz");
								system("installpkg $path_download/lirc-0.8.4a-i486-3sbo.tgz");
								system("installpkg $path_download/speex-1.2rc1-i486-1dav.tgz");
								system("installpkg $path_download/x264-20081031-i486-1gds.tgz");
								system("installpkg $path_download/xvidcore-1.2.1-i486-1sl.tgz");
							}
						}

						$fichier = $tableau[$i][ $ClefDepot ];
						print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/$fichier\n";
						system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/defis/paquets_tgz/$fichier");
						print "installpkg $path_download/$fichier\n";
						if ($ModeAdministrateur =~ "TRUE") {
							system("installpkg $path_download/$fichier");
						}
					}

					#########################################################################################
					# DEPOT
					#########################################################################################
					else {
						$fichier = $tableau[$i][ $LePaquet ];
						print "$apt_install $fichier\n";
						if ($ModeAdministrateur =~ "TRUE") {
							system("$apt_install $fichier");
						}
					}
				}

				#########################################################################################
				# AMD64 FPM INSTALL
				# I386 FPM INSTALL
				#########################################################################################
				case "FPM"	{
					$fichier = $tableau[$i][ $LePaquet ];
					print "$apt_install $fichier\n";
					if ($ModeAdministrateur =~ "TRUE") {
						system("$apt_install $fichier");
					}
				}

			}
		}
	}
}


#########################################################################################
# RECHERCHE LE TYPE DE PAQUET: RPM | DEB | TGZ
#########################################################################################
if ((le_fichier_est_present("apt-get") =~ "TRUE") || (le_fichier_est_present("aptitude") =~ "TRUE")) {
	# DEBIAN
	$TypePaquet = 'DEB';
	print "programme ............... : [ apt-get | aptitude ]\n";
} elsif ((le_fichier_est_present("slackpkg") =~ "TRUE") || (le_fichier_est_present("installpkg") =~ "TRUE")) {
	# TGZ
	$TypePaquet = 'TGZ';
	print "programme ............... : [ slackpkg | installpkg ]\n";
} elsif ((le_fichier_est_present("pacman-g2") =~ "TRUE")) {
	# FPM
	$TypePaquet = 'FPM';
	print "programme ............... : [ pacman-g2 ]\n";
} elsif ((le_fichier_est_present("rpm") =~ "TRUE") || (le_fichier_est_present("urpmi") =~ "TRUE") || (le_fichier_est_present("zypper") =~ "TRUE") || (le_fichier_est_present("yum") =~ "TRUE")) {
	# RPM
	$TypePaquet = 'RPM';
	print "programme ............... : [ rpm | urpmi  | zypper | yum ]\n";
}

print "Type de paquet utilise .. : $TypePaquet\n";


#########################################################################################
#########  D E B U G  ## TEST LES TYPES DE PAQUET: RPM | DEB | TGZ  ##  D E B U G  ######
#########################################################################################
#
# Cette option est activee si le parametres 'debug' est passe sur la ligne de commande
#
#########################################################################################
if (($ModeAdministrateur =~ "FALSE") && (@ARGV == 1)) {
	my $tmp;

	if ($ARGV[0] =~ "debug") {
		print "\nSIMULATION MODE DEBUG\n";
		print "\t[  1 ] DEBIAN apt-get   64 bits\n";
		print "\t[  2 ] DEBIAN apt-get   32 bits\n";
		print "\t[  3 ] DEBIAN aptitude  64 bits\n";
		print "\t[  4 ] DEBIAN aptitude  32 bits\n";
		print "\t[  5 ] RPM urpmi        64 bits\n";
		print "\t[  6 ] RPM urpmi        32 bits\n";
		print "\t[  7 ] RPM rpm          64 bits\n";
		print "\t[  8 ] RPM rpm          32 bits\n";
		print "\t[  9 ] RPM zypper       64 bits\n";
		print "\t[ 10 ] RPM zypper       32 bits\n";
		print "\t[ 11 ] RPM yum          64 bits\n";
		print "\t[ 12 ] RPM yum          32 bits\n";
		print "\t[ 13 ] TGZ slackpkg     64 bits\n";
		print "\t[ 14 ] TGZ slackpkg     32 bits\n";
		print "\t[ 15 ] FPM pacman-g2    64 bits\n";
		print "\t[ 16 ] FPM pacman-g2    32 bits  >  ?  ";

		chomp($tmp = <STDIN>);

		switch($tmp) {
			case "1" {
			$TypePaquet = 'DEB';
			$apt_install = 'apt-get install';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGEDEBIAN_64;
			$ClefDepot = DEPOTDEBIAN_64;
			}
			case "2" {
			$TypePaquet = 'DEB';
			$apt_install = 'apt-get install';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGEDEBIAN_32;
			$ClefDepot = DEPOTDEBIAN_32;
			}
			case "3" {
			$TypePaquet = 'DEB';
			$apt_install = 'aptitude --assume-yes -y install';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGEDEBIAN_64;
			$ClefDepot = DEPOTDEBIAN_64;
			}
			case "4" {
			$TypePaquet = 'DEB';
			$apt_install = 'aptitude --assume-yes -y install';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGEDEBIAN_32;
			$ClefDepot = DEPOTDEBIAN_32;
			}
			case "5" {
			$TypePaquet = 'RPM';
			$apt_install = 'urpmi';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGERPM_64;
			$ClefDepot = DEPOTRPM_64;
			}
			case "6" {
			$TypePaquet = 'RPM';
			$apt_install = 'urpmi';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGERPM_32;
			$ClefDepot = DEPOTRPM_32;
			}
			case "7" {
			$TypePaquet = 'RPM';
			$apt_install = 'rpm -ivh';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGERPM_64;
			$ClefDepot = DEPOTRPM_64;
			}
			case "8" {
			$TypePaquet = 'RPM';
			$apt_install = 'rpm -ivh';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGERPM_32;
			$ClefDepot = DEPOTRPM_32;
			}
			case "9" {
			$TypePaquet = 'RPM';
			$apt_install = 'zypper install';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGERPMZYPPER_64;
			$ClefDepot = DEPOTRPMZYPPER_64;
			}
			case "10" {
			$TypePaquet = 'RPM';
			$apt_install = 'zypper install';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGERPMZYPPER_32;
			$ClefDepot = DEPOTRPMZYPPER_32;
			}
			case "11" {
			$TypePaquet = 'RPM';
			$apt_install = 'yum install';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGERPM_64;
			$ClefDepot = DEPOTRPM_64;
			}
			case "12" {
			$TypePaquet = 'RPM';
			$apt_install = 'yum install';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGERPM_32;
			$ClefDepot = DEPOTRPM_32;
			}
			case "13" {
			$TypePaquet = 'TGZ';
			$apt_install = 'slackpkg install';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGETGZ_64;
			$ClefDepot = DEPOTTGZ_64;
			}
			case "14" {
			$TypePaquet = 'TGZ';
			$apt_install = 'slackpkg install';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGETGZ_32;
			$ClefDepot = DEPOTTGZ_32;
			}
			case "15" {
			$TypePaquet = 'FPM';
			$apt_install = 'pacman-g2 --force --noconfirm -S';
			$TypeCpuIsAmd64 = "TRUE";
			$LePaquet = PACKAGE_FPM_64;
			$ClefDepot = DEPOT_FPM_64;
			}
			case "16" {
			$TypePaquet = 'FPM';
			$apt_install = 'pacman-g2 --force --noconfirm -S';
			$TypeCpuIsAmd64 = "FALSE";
			$LePaquet = PACKAGE_FPM_32;
			$ClefDepot = DEPOT_FPM_32;
			}
			else {
				print "ERREUR DANS LE CHOIX  :/\n";
				exit 1;
			}
		}
		$ModeDebug = "TRUE";
		affiche_entete ("Mode Debug is TRUE");
		print "TypePaquet     = $TypePaquet\n";
		print "apt_install    = $apt_install\n";
		print "TypeCpuIsAmd64 = $TypeCpuIsAmd64\n";
		print "LePaquet       = $LePaquet\n";
		print "ClefDepot      = $ClefDepot\n";
	}
}


if ($ModeDebug =~ "FALSE") {

	switch($TypePaquet) {

	#########################################################################################
	# PAQUETS RPM
	#########################################################################################
	case "RPM" {

		my $tmp    = "";
		my $rpm    = le_fichier_est_present("rpm");
		my $urpmi  = le_fichier_est_present("urpmi");
		my $zypper = le_fichier_est_present("zypper");
		my $yum    = le_fichier_est_present("yum");

		if (($yum =~ "TRUE") && ($rpm =~ "TRUE")) {
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] YUM ----> par defaut',"\n\t",'[ 2 ] RPM ? ';
			$apt_install = 'yum install';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'rpm -ivh';
			}
		}
		elsif ($rpm =~ "TRUE" && $urpmi =~ "TRUE" && $zypper =~ "TRUE") {
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] URPMI ----> par defaut',"\n\t",'[ 2 ] RPM',"\n\t",'[ 3 ] ZYPPER ? ';
			$apt_install = 'urpmi';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'rpm -ivh';
			} elsif ($tmp =~ '3') {
				$apt_install = 'zypper install';
			}
		}
		elsif ($rpm =~ "TRUE" && $urpmi =~ "TRUE") {
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] URPMI ----> par defaut',"\n\t",'[ 2 ] RPM ? ';
			$apt_install = 'urpmi';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'rpm -ivh';
			}
		}
		elsif ($rpm =~ "TRUE" && $zypper =~ "TRUE") {
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] RPM ----> par defaut',"\n\t",'[ 2 ] ZYPPER ? ';
			$apt_install = 'rpm -ivh';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'zypper install';
			}
		}
		elsif ($urpmi =~ "TRUE" && $zypper =~ "TRUE") {
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] URPMI ----> par defaut',"\n\t",'[ 2 ] ZYPPER ? ';
			$apt_install = 'urpmi';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'zypper install';
			}
		}
		elsif (($rpm =~ "FALSE") && ($urpmi =~ "FALSE") && ($zypper =~ "FALSE") && ($yum =~ "FALSE")) {
			print "\n";
			print "PROBLEME DE RECONNAISSANCE DES PAQUETS RPM  !\n";
			print "rpm, urpmi, zypper, yum ABSENTS !  !\n";
			print "Veuillez prevenir l auteur  !\n";
			print "\n";
			exit 1
		}
		elsif ($rpm =~ "TRUE") {
			$apt_install = 'rpm -ivh';
		}
		elsif ($urpmi =~ "TRUE") {
			$apt_install = 'urpmi';
		}
		elsif ($zypper =~ "TRUE") {
			$apt_install = 'zypper install';
		}
		elsif ($yum =~ "TRUE") {
			$apt_install = 'yum install';
		}

		if ($apt_install =~ "zypper") {
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				$LePaquet = PACKAGERPMZYPPER_64;
				$ClefDepot = DEPOTRPMZYPPER_64;
			}else {
				$LePaquet = PACKAGERPMZYPPER_32;
				$ClefDepot = DEPOTRPMZYPPER_32;
			}
		}
		elsif ($apt_install =~ "yum") {
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				$LePaquet = PACKAGEYUM_64;
				$ClefDepot = DEPOTYUM_64;
			} else {
				$LePaquet = PACKAGEYUM_32;
				$ClefDepot = DEPOTYUM_32;
			}
		}
		else {
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				$LePaquet = PACKAGERPM_64;
				$ClefDepot = DEPOTRPM_64;
			} else {
				$LePaquet = PACKAGERPM_32;
				$ClefDepot = DEPOTRPM_32;
			}
		}
	} # End case

	#########################################################################################
	# PAQUETS DEBIAN
	#########################################################################################
	case "DEB" {
		my $apt_get = 'FALSE';
		my $aptitude = 'FALSE';
		my $tmp = '1';

		if (le_fichier_est_present("apt-get") =~ 'TRUE') {
			$apt_get = 'TRUE';
			$apt_install = 'apt-get install';
		} else {
			$apt_get = 'FALSE';
		}

		if (le_fichier_est_present("aptitude") =~ 'TRUE') {
			$aptitude = 'TRUE';
			$apt_install = 'aptitude --assume-yes -y install';
		} else {
			$aptitude = 'FALSE';
		}

		# APT-GET ou APTITUDE ?
		if (($aptitude =~ 'TRUE') && ($apt_get =~ 'TRUE')) {
			$apt_install = 'apt-get install';
			print "\n\t",'Choix du programme d\'installation',"\n","\t",'[ 1 ] APT-GET par defaut',"\n\t",'[ 2 ] APTITUDE ? ';
			chomp($tmp = <STDIN>);
			if ($tmp =~ '2') {
				$apt_install = 'aptitude --assume-yes -y install';
			}
		} elsif ($apt_get =~ 'TRUE') {
			$apt_install = 'apt-get install';
			print "\n\t",'aptitude est ABSENT et APT-GET sera l\'installateur par defaut',"\n";
			print "\t",'Continuer [O/n] ? ';
			chomp($tmp = <STDIN>);
			if ($tmp =~ 'n') {
				print "\n";
				exit 1;
			}
		} elsif ($aptitude =~ 'TRUE') {
			$apt_install = 'aptitude --assume-yes -y install';
			print "\n\t",'apt-get est ABSENT et APTITUDE sera l\'installateur par defaut',"\n";
			print "\t",'Continuer [O/n] ? ';
			chomp($tmp = <STDIN>);
			if ($tmp =~ 'n') {
				print "\n";
				exit 1;
			}
		} else {
			print "\n";
			print "PROBLEME DE RECONNAISSANCE DES PAQUETS DEB  !\n";
			print "apt-get, aptitude ABSENTS !  !\n";
			print "Veuillez prevenir l auteur  !\n";
			print "\n";
			exit 1
		}

		if ($TypeCpuIsAmd64 =~ "TRUE") {
			$LePaquet = PACKAGEDEBIAN_64;
			$ClefDepot = DEPOTDEBIAN_64;
		} else {
			$LePaquet = PACKAGEDEBIAN_32;
			$ClefDepot = DEPOTDEBIAN_32;
		}
	} # End case

	#########################################################################################
	# PAQUETS TGZ
	#########################################################################################
	case "TGZ" {
		my $slackpkg = le_fichier_est_present("slackpkg");

		if ($slackpkg =~ "TRUE") {
			print "slackpkg est present\n";
			$apt_install = 'slackpkg install';
		} else {
			print "slackpkg est absent\n";
			exit 1;
		}
		if (le_fichier_est_present("installpkg") =~ "TRUE") {
			print "installpkg est present\n";
		} else {
			print "\n";
			print "PROBLEME DE RECONNAISSANCE DES PAQUETS TGZ  !\n";
			print "installpkg ABSENTS !  !\n";
			print "Veuillez prevenir l auteur  !\n";
			print "\n";
			exit 1
		}
		print "NB: Seul le CPU i386 est prit en compte pour les paquets TGZ\n";

		# Son gestionnaire "evolue" est pkgtool, mais les commandes installpkg, upgradepkg et removepkg suffisent amplement.
		# pkgtool
		# upgradepkg
		# removepkg
		# netpkg
		# installpkg  ** Installation en local
		# Slackpkg    ** Installation en depot

		if ($TypeCpuIsAmd64 =~ "TRUE") {
			$LePaquet = PACKAGETGZ_64;
			$ClefDepot = DEPOTTGZ_64;
		} else {
			$LePaquet = PACKAGETGZ_32;
			$ClefDepot = DEPOTTGZ_32;
		}
	} # End case

	#########################################################################################
	# PAQUETS FPM
	#########################################################################################
	case "FPM" {
		my $pacman_g2 = le_fichier_est_present("pacman-g2");

		if ($pacman_g2 =~ "TRUE") {
			$apt_install = 'pacman-g2 --force --noconfirm -S';
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				$LePaquet = PACKAGE_FPM_64;
				$ClefDepot = DEPOT_FPM_64;
			} else {
				$LePaquet = PACKAGE_FPM_32;
				$ClefDepot = DEPOT_FPM_32;
			}
		} else {
			print "\n";
			print "PROBLEME DE RECONNAISSANCE DES PAQUETS FPM  !\n";
			print "pacman-g2 ABSENTS !  !\n";
			print "Veuillez prevenir l auteur  !\n";
			print "\n";
			exit 1
		}
	} # End case

	} # End switch

	print "\nCette commande [ $apt_install ] sera utilisee\n";
} # End if


#########################################################################################
# INSTALLATION DE xcfa si paquet TGZ
#########################################################################################
if ($TypePaquet =~ "TGZ") {

	affiche_entete ("INSTALLATION DE xcfa");

	if ($ModeAdministrateur =~ "TRUE") {
		if ($TypeCpuIsAmd64 =~ "TRUE") {
			print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.tgz\n";
			system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.tgz");
			print "installpkg $path_download/xcfa-5.0.0_amd64.tgz\n";
			system("installpkg $path_download/xcfa-5.0.0_amd64.tgz");
		} else {
			print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.tgz\n";
			system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.tgz");
			print "installpkg $path_download/xcfa-5.0.0_i386.tgz\n";
			system("installpkg $path_download/xcfa-5.0.0_i386.tgz");
		}
	} else {
		if ($TypeCpuIsAmd64 =~ "TRUE") {
			print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.tgz\n";
			print "installpkg $path_download/xcfa-5.0.0_amd64.tgz\n";
		} else {
			print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.tgz\n";
			print "installpkg $path_download/xcfa-5.0.0_i386.tgz\n";
		}
	}
}
#########################################################################################
# INSTALLATION DE libtaglib_c0 ET DE xcfa si paquet RPM
#########################################################################################
elsif ($TypePaquet =~ "RPM") {

	#########################################################################################
	# IDEE CODE DE LEONUX
	#########################################################################################
	if ($apt_install =~ "urpmi") {

		affiche_entete("INSTALLATION DE libtaglib_c0 ET DE xcfa");

		if ($ModeAdministrateur =~ "TRUE") {

			## les fameux PLF (equivalents Debian multimedia)
			# if ($TypeCpuIsAmd64 =~ "TRUE") {
			# 	system ("urpmi.addmedia --update plf-free ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandriva/2010.0/free/release/binary/x86_64/ with media_info/synthesis.hdlist.cz");
			# 	system ("urpmi.addmedia --update plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandriva/2010.0/non-free/release/binary/x86_64/ with media_info/synthesis.hdlist.cz");
			# } else {
			# 	system ("urpmi.addmedia --update plf-free ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandriva/2010.0/free/release/binary/i586/ with media_info/synthesis.hdlist.cz");
			# 	system ("urpmi.addmedia --update plf-nonfree ftp://ftp.free.fr/pub/Distributions_Linux/plf/mandriva/2010.0/non-free/release/binary/i586/ with media_info/synthesis.hdlist.cz");
			# }
			## CORRECTION PAR: David Cossé TODO: A TESTER
			system ("urpmi.addmedia --distrib --mirrorlist '\$MIRRORLIST'");
			system ("urpmi.addmedia --distrib --mirrorlist 'http://plf.zarb.org/mirrors/\$RELEASE.\$ARCH.list'");

			## on se rend dans le repertoire /tmp et on cree un dossier xcfa
			mkdir("/tmp/xcfa");

			## on recupere le fichier rpm
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				system("wget --quiet --directory-prefix=/tmp/xcfa http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.rpm");
			} else {
				system("wget --quiet --directory-prefix=/tmp/xcfa http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.rpm");
			}
			## rafraichissement
			system ("urpmi.update -a");

			## installation de la librairie manquante
			system ("urpmi libtaglib_c0");

			## installation de xcfa
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				# Bug trouve par leonux :
				# Suppression des deux premieres lignes
				# print "rpm -ivh /tmp/xcfa/xcfa-5.0.0_amd64.rpm\n";
				# system ("rpm -ivh /tmp/xcfa/xcfa-5.0.0_amd64.rpm");
				print "urpmi /tmp/xcfa/xcfa-5.0.0_amd64.rpmm\n";
				system ("urpmi /tmp/xcfa/xcfa-5.0.0_amd64.rpm");
			} else {
				# Bug trouve par leonux :
				# Suppression des deux premieres lignes
				# print "rpm -ivh /tmp/xcfa/xcfa-5.0.0_i386.rpm\n";
				# system ("rpm -ivh /tmp/xcfa/xcfa-5.0.0_i386.rpm");
				print "urpmi /tmp/xcfa/xcfa-5.0.0_i386.rpm\n";
				system ("urpmi /tmp/xcfa/xcfa-5.0.0_i386.rpm");
			}

			## suppression du repertoire temporaire xcfa
			system ("rm -rf /tmp/xcfa");
		}
	}
	if ($apt_install =~ "yum") {

		affiche_entete ("INSTALLATIONS NECESSAIRES POUR: yum");

		if ($ModeAdministrateur =~ "TRUE") {

			system ("yum install wget");
			## on cree un dossier /tmp/xcfa/
			mkdir("/tmp/xcfa");
			## on telecharge le fichier xcfa.repo
			system("wget --quiet --directory-prefix=/tmp/xcfa http://download.tuxfamily.org/xcfaudio/xcfa/xcfa.repo");
			## pour le copier dans le dossier: /etc/yum.repos.d/
			copy ("/tmp/xcfa/xcfa.repo", "/etc/yum.repos.d/xcfa.repo");
			## suppression du repertoire temporaire xcfa/
			system ("rm -rf /tmp/xcfa");
			## mises a jour
			system ("rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm");
			system ("yum repolist");
			## Hoho  ;)
			system ("yum install xcfa");
		}
		else {
			print "yum install wget\n";
			print "Enregistrement de: /etc/yum.repos.d/xcfa.repo\n";
			print "rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm\n";
			print "yum repolist\n";
		}
	}

	if ($apt_install =~ "zypper") {

		affiche_entete ("A J O U T E R   L E   D E P O T:  P A C K M A N");

		if ($ModeAdministrateur =~ "TRUE") {
			system ("zypper ar http://ftp.skynet.be/pub/packman/suse/11.1/ Packman");
			system ("zypper refresh");
		} else {
			print "zypper ar http://ftp.skynet.be/pub/packman/suse/11.1/ Packman","\n";
			print "zypper refresh","\n";
		}

		#########################################################################################
		# ACTIVER LE DEPOT XCFA
		#########################################################################################

		affiche_entete ("A J O U T E R   L E   D E P O T:  X C F A");

		if ($ModeAdministrateur =~ "TRUE") {
			system ("zypper ar $path_download xcfa");
			system ("zypper refresh");
		} else {
			print "zypper ar $path_download xcfa\n";
			print "zypper refresh\n";
		}

		#########################################################################################
		# INSTALLATION DE xcfa
		#########################################################################################

		affiche_entete ("INSTALLATION DE xcfa");

		if ($ModeAdministrateur =~ "TRUE") {
			if ($TypeCpuIsAmd64 =~ "TRUE") {
				print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.rpm\n";
				system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.rpm");
				print "$apt_install $path_download/xcfa-5.0.0_amd64.rpm\n";
				system ("$apt_install $path_download/xcfa-5.0.0_amd64.rpm");
			} else {
				print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.rpm\n";
				system("wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.rpm");
				print "$apt_install $path_download/xcfa-5.0.0_i386.rpm\n";
				system ("$apt_install $path_download/xcfa-5.0.0_i386.rpm");
			}
		} else {

			if ($TypeCpuIsAmd64 =~ "TRUE") {
				print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_amd64.rpm\n";
				print "$apt_install $path_download/xcfa-5.0.0_amd64.rpm\n";
			} else {
				print "wget --quiet --directory-prefix=$path_download http://download.tuxfamily.org/xcfaudio/xcfa_beta/xcfa-5.0.0_i386.rpm\n";
				print "$apt_install $path_download/xcfa-5.0.0_i386.rpm\n";
			}
		}
	}
}


#########################################################################################
# CHOIX PAR L UTILISATEUR DES PROGRAMMES A INSTALLER
#########################################################################################
&Choix_des_paquets_pour_installation();


#########################################################################################
# INSTALLATION DEPUIS LES DEPOTS
#########################################################################################
&Installation_depuis_les_depots();


#########################################################################################
# TEST POUR SUPPRESSION DES DEPOTS AVEC ZYPPER
#########################################################################################
if ($apt_install =~ "zypper") {
	if ($ModeAdministrateur =~ "TRUE") {
		system ("zypper rr xcfa");
		system ("zypper rr Packman");
		system ("zypper refresh");
	}
}
# system ("rm -rf $path_download");


print "\n\n";
print '=============================',"\n";
print ' !  FIN DE L\'INSTALLATION  !',"\n";
print '=============================',"\n\n";


