|
Recherche |
CPAN est un ensemble de modules pour perl qui permettent de faire beaucoup de choses interessantes. Vous pouvez avoir un petit listing des modules disponibles sur http://mir2.ovh.net/ftp.cpan.org/modules/by-module. Pour installation de tous les modules CPAN, il existe un module perl qui peut les installer tous. On va commencer par l'installer, puis on va le configurer pour enfin installer les autres modules. Installation CPAN Pour installer CPAN il faut le compiler de la manière suivante : [root@ns370 root]# mkdir /temp [root@ns370 root]# cd /temp [root@ns370 temp]# wget http://cpan.mirror.fr/authors/id/A/AN/ANDK//CPAN-1.76.tar.gz 22:04:33 http://cpan.mirror.fr/authors/id/A/AN/ANDK//CPAN-1.76.tar.gz => `CPAN-1.76.tar.gz' Connexion vers mir2.ovh.net:80...Connecté! requête HTTP transmise, en attente de la réponse...200 OK Longueur: 135,191 [application/x-tar] 0K .......... .......... .......... .......... .......... 37% @ 6.98 MB/s 50K .......... .......... .......... .......... .......... 75% @ 2.71 MB/s 100K .......... .......... .......... .. 100% @ 2.61 MB/s 22:04:33 (3.48 MB/s) - `CPAN-1.76.tar.gz' sauvegardé [135191/135191] [root@ns370 temp]# tar xvfz CPAN-1.76.tar.gz CPAN-1.76/ CPAN-1.76/lib/ CPAN-1.76/lib/CPAN.pm CPAN-1.76/lib/CPAN/ CPAN-1.76/lib/CPAN/Admin.pm CPAN-1.76/lib/CPAN/Nox.pm CPAN-1.76/lib/CPAN/FirstTime.pm CPAN-1.76/lib/Bundle/ CPAN-1.76/lib/Bundle/CPAN.pm CPAN-1.76/t/ CPAN-1.76/t/loadme.t CPAN-1.76/t/vcmp.t CPAN-1.76/t/signature.t CPAN-1.76/t/mirroredby.t CPAN-1.76/t/Nox.t CPAN-1.76/PAUSE2003.pub CPAN-1.76/MANIFEST CPAN-1.76/MANIFEST.SKIP CPAN-1.76/scripts/ CPAN-1.76/scripts/cpan CPAN-1.76/META.yml CPAN-1.76/BUNDLE/ CPAN-1.76/BUNDLE/Test/ CPAN-1.76/BUNDLE/Test/Builder.pm CPAN-1.76/BUNDLE/Test/More.pm CPAN-1.76/Todo CPAN-1.76/ChangeLog CPAN-1.76/Changes.old CPAN-1.76/Makefile.PL CPAN-1.76/README CPAN-1.76/SIGNATURE [root@ns370 temp]# cd CPAN-1.76 [root@ns370 CPAN-1.76]# red:perl Makefile.PL Checking if your kit is complete... Looks good Warning: prerequisite Test::More failed to load: Can't locate Test/More.pm in @INC (@INC contains: /usr/lib/perl5/5.6.0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/lib/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl .) at (eval 4) line 3. Writing Makefile for CPAN [root@ns370 CPAN-1.76]# make install mkdir blib mkdir blib/lib mkdir blib/arch mkdir blib/arch/auto mkdir blib/arch/auto/CPAN mkdir blib/lib/auto mkdir blib/lib/auto/CPAN mkdir blib/man1 mkdir blib/man3 cp lib/CPAN/Nox.pm blib/lib/CPAN/Nox.pm cp lib/Bundle/CPAN.pm blib/lib/Bundle/CPAN.pm cp lib/CPAN/Admin.pm blib/lib/CPAN/Admin.pm cp lib/CPAN.pm blib/lib/CPAN.pm cp lib/CPAN/FirstTime.pm blib/lib/CPAN/FirstTime.pm mkdir blib/script cp scripts/cpan blib/script/cpan /usr/bin/perl -I/usr/lib/perl5/5.6.0/i386-linux -I/usr/lib/perl5/5.6.0 -MExtUtils::MakeMaker -e "MY->fixin(shift)" blib/script/cpan Manifying blib/man3/CPAN::Nox.3pm Manifying blib/man3/Bundle::CPAN.3pm Manifying blib/man3/CPAN::Admin.3pm Manifying blib/man3/CPAN.3pm Manifying blib/man1/cpan.1 Manifying blib/man3/CPAN::FirstTime.3pm Installing /usr/lib/perl5/5.6.0/CPAN.pm Installing /usr/lib/perl5/5.6.0/Bundle/CPAN.pm Installing /usr/lib/perl5/5.6.0/CPAN/Nox.pm Installing /usr/lib/perl5/5.6.0/CPAN/Admin.pm Installing /usr/lib/perl5/5.6.0/CPAN/FirstTime.pm Installing /usr/share/man/man1/cpan.1 Installing /usr/share/man/man3/CPAN::Nox.3pm Installing /usr/share/man/man3/Bundle::CPAN.3pm Installing /usr/share/man/man3/CPAN::Admin.3pm Installing /usr/share/man/man3/CPAN.3pm Installing /usr/share/man/man3/CPAN::FirstTime.3pm Installing /usr/bin/cpan Writing /usr/lib/perl5/5.6.0/i386-linux/auto/CPAN/.packlist Appending installation info to /usr/lib/perl5/5.6.0/i386-linux/perllocal.pod [root@ns370 CPAN-1.76]# Voilà le module CPAN est installé. Configuration CPAN Passons à sa configuration, il suffit de repondre entrée à toutes les questions, puis choisir le miroir chez OVH (puisque nous sommes l'un des 11 miroirs officiels en France de CPAN). [root@ns370 CPAN-1.76]# perl -MCPAN -e shell; /usr/lib/perl5/5.6.0/CPAN/Config.pm initialized. CPAN is the world-wide archive of perl resources. It consists of about 100 sites that all replicate the same contents all around the globe. Many countries have at least one CPAN site already. The resources found on CPAN are easily accessible with the CPAN.pm module. If you want to use CPAN.pm, you have to configure it properly. If you do not want to enter a dialog now, you can answer 'no' to this question and I'll try to autoconfigure. (Note: you can revisit this dialog anytime later by typing 'o conf init' at the cpan prompt.) Are you ready for manual configuration? [yes] entrée The following questions are intended to help you with the configuration. The CPAN module needs a directory of its own to cache important index files and maybe keep a temporary mirror of CPAN files. This may be a site-wide directory or a personal directory. First of all, I'd like to create this directory. Where? CPAN build and cache directory? [/root/.cpan] entrée If you want, I can keep the source files after a build in the cpan home directory. If you choose so then future builds will take the files from there. If you don't want to keep them, answer 0 to the next question. How big should the disk cache be for keeping the build directories with all the intermediate files? Cache size for build directory (in MB)? [10] entrée By default, each time the CPAN module is started, cache scanning is performed to keep the cache size in sync. To prevent from this, disable the cache scanning with 'never'. Perform cache scanning (atstart or never)? [atstart] entrée To considerably speed up the initial CPAN shell startup, it is possible to use Storable to create a cache of metadata. If Storable is not available, the normal index mechanism will be used. Cache metadata (yes/no)? [yes] entrée The next option deals with the charset your terminal supports. In general CPAN is English speaking territory, thus the charset does not matter much, but some of the aliens out there who upload their software to CPAN bear names that are outside the ASCII range. If your terminal supports UTF-8, you say no to the next question, if it supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it supports neither nor, your answer does not matter, you will not be able to read the names of some authors anyway. If you answer no, names will be output in UTF-8. Your terminal expects ISO-8859-1 (yes/no)? [yes] entrée If you have one of the readline packages (Term ReadLine Perl,Term ReadLine Gnu, possibly others) installed, the interactive CPANshell will have history support. The next two questions deal with the filename of the history file and with its size. If you do not want to set this variable, please hit SPACE RETURN to the following question. File to save your history? [/root/.cpan/histfile] entrée Number of lines to save? [100] entrée The CPAN module can detect when a module that which you are trying to build depends on prerequisites. If this happens, it can build the prerequisites for you automatically ('follow'), ask you for confirmation ('ask'), or just ignore them ('ignore'). Please set your policy to one of the three values. Policy on building prerequisites (follow, ask or ignore)? [ask]entrée The CPAN module will need a few external programs to work properly. Please correct me, if I guess the wrong path for a program. Don't panic if you do not have some of them, just press ENTER for those. To disable the use of a download program, you can type a space followed by ENTER. Where is your gzip program? [/bin/gzip] entrée Where is your tar program? [/bin/tar] entrée Warning: unzip not found in PATH entrée Where is your unzip program? [] entrée Where is your make program? [/usr/bin/make] entrée Where is your lynx program? [/usr/bin/lynx] entrée Where is your wget program? [/usr/bin/wget] entrée Where is your ncftpget program? [/usr/bin/ncftpget] entrée Where is your ftp program? [/usr/bin/ftp] entrée What is your favorite pager program? [/usr/bin/less] entrée What is your favorite shell? [/bin/bash] entrée Every Makefile.PL is run by perl in a separate process. Likewise we run 'make' and 'make install' in processes. If you have any parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass to the calls, please specify them here. If you don't understand this question, just press ENTER. Parameters for the 'perl Makefile.PL' command? entrée Typical frequently used settings: PREFIX=~/perl non-root users (please see manual for more hints) Your choice: [] entrée Parameters for the 'make' command? Typical frequently used setting: * j3 dual processor system Your choice: [] entrée Parameters for the 'make install' command? entrée Typical frequently used setting: UNINST=1 to always uninstall potentially conflicting files Your choice: [] entrée Sometimes you may wish to leave the processes run by CPAN alone without caring about them. As sometimes the Makefile.PL contains question you're expected to answer, you can set a timer that will kill a 'perl Makefile.PL' process after the specified time in seconds. If you set this value to 0, these processes will wait forever. This is the default and recommended setting. Timeout for inactivity during Makefile.PL? [0] entrée If you're accessing the net via proxies, you can specify them in the CPAN configuration or via environment variables. The variable in the $CPAN::Config takes precedence. Your ftp_proxy? Your http_proxy? Your no_proxy? You have no /root/.cpan/sources/MIRRORED.BY I'm trying to fetch one LWP not available Please, install Net::FTP as soon as possible. CPAN.pm installs it for you if you just type install Bundle::libnet Trying with "/usr/bin/lynx -source" to get ftp://ftp.perl.org/pub/CPAN/MIRRORED.BY[4] Now we need to know where your favorite CPAN sites are located. Push a few sites onto the array (just in case the first on the array won't work). If you are mirroring CPAN to your local workstation, specify a file: URL. First, pick a nearby continent and country (you can pick several of each, separated by spaces, or none if you just want to keep your existing selections). Then, you will be presented with a list of URLs of CPAN mirrors in the countries you selected, along with previously selected URLs. Select some of those URLs, or just keep the old list. Finally, you will be prompted for any extra URLs file:, ftp:, or http: that host a CPAN mirror. (1) Africa (2) Asia (3) Central America (4) Europe (5) North America (6) Oceania (7) South America Select your continent (or several nearby continents) []4 Sorry! since you don't have any existing picks, you must make a geographic selection. (1) Austria (2) Belgium (3) Bosnia and Herzegovina (4) Bulgaria (5) Croatia (6) Czech Republic (7) Denmark (8) Estonia (9) Finland (10) France (11) Germany (12) Greece (13) Hungary (14) Iceland (15) Ireland (16) Italy 16 more items, hit SPACE RETURN to show them Select your country (or several nearby countries) [] 10 Sorry! since you don't have any existing picks, you must make a geographic selection. (1) ftp://cpan.cict.fr/pub/CPAN/ (2) ftp://cpan.mirrors.easynet.fr/pub/ftp.cpan.org/ (3) ftp://ftp.club-internet.fr/pub/perl/CPAN/ (4) ftp://ftp.crihan.fr/mirrors/ftp.cpan.org/ (5) ftp://ftp.lip6.fr/pub/perl/CPAN/ (6) ftp://ftp.oleane.net/pub/mirrors/CPAN/ (7) ftp://ftp.pasteur.fr/pub/computing/CPAN/ (8) ftp://ftp.u-paris10.fr/perl/CPAN (9) ftp://ftp.u-strasbg.fr/CPAN (10)ftp://mir1.ovh.net/ftp.cpan.org (11)http://www.enstimac.fr/Perl/CPAN Select as many URLs as you like (by number), put them on one line, separated by blanks, e.g. '1 4 5' [] 10 Enter another URL or RETURN to quit: [] New set of picks: ftp://mir1.ovh.net/ftp.cpan.org commit: wrote /usr/lib/perl5/5.6.0/CPAN/Config.pm Terminal does not support AddHistory?. cpan shell CPAN exploration and modules installation (v1.76) ReadLine? support available (try 'install Bundle::CPAN') cpan> Installation des autres modules Maintenant on peut installer les modules. Pour avoir quelque chose qui fonctionne normalement, installez 2 modules : Bundle::CPAN et LWP. Les dépendances vont permettre l'installation de pas mal d'autres modules. cpan> install Bundle::CPAN Trying with "/usr/bin/lynx -source" to get ftp://mir1.ovh.net/ftp.cpan.org/authors/01mailrc.txt.gz gzip: /root/.cpan/sources/authors/01mailrc.txt: not in gzip format Going to read /root/.cpan/sources/authors/01mailrc.txt.gz [...] CPAN: Term ReadLine Perl loaded ok................... 19 subroutines in Term::ReadLine redefined cpan shell CPAN exploration and modules installation (v1.76) ReadLine? support enabled cpan> |