martes, 5 de febrero de 2013

Compilando módulos de PERL


Definimos la variable ftp_proxy, en caso de salir por uno.

Recordemos que Linux diferencia las variables ftp_proxy, http_proxy y https_proxy.




Nosotros necesitamos ftp_proxy (En minúsculas!!!)

export ftp_proxy=http://10.2.15.129:8090/

Nos aseguramos de que se ha establecido correctamente con env o echo $ftp_proxy

Accedemos al prompt del cpan.

Con help veremos todas las ocpiones.

cpan> help

Display Information
 command  argument          description
 a,b,d,m  WORD or /REGEXP/  about authors, bundles, distributions, modules
 i        WORD or /REGEXP/  about anything of above
 r        NONE              reinstall recommendations
 ls       AUTHOR            about files in the author's directory

Download, Test, Make, Install...
 get                        download
 make                       make (implies get)
 test      MODULES,         make test (implies make)
 install   DISTS, BUNDLES   make install (implies test)
 clean                      make clean
 look                       open subshell in these dists' directories
 readme                     display these dists' README files

Other
 h,?           display this menu       ! perl-code   eval a perl command
 o conf [opt]  set and query options   q             quit the cpan shell
 reload cpan   load CPAN.pm again      reload index  load newer indices
 autobundle    Snapshot                force cmd     unconditionally do cmd


Con reload index podremos verificar la conectividad.

Con o conf podemos ver las variables de entorno de cpan con o conf.

cpan> o conf
CPAN::Config options from /usr/lib/perl5/5.8.8/CPAN/Config.pm:
    commit             Commit changes to disk
    defaults           Reload defaults from disk
    init               Interactive setting of all options

    build_cache        10
    build_dir          /root/.cpan/build
    cache_metadata     1
    cpan_home          /root/.cpan
    dontload_hash
    ftp                /usr/kerberos/bin/ftp
    ftp_proxy          http://10.2.15.129:8090/
    getcwd             cwd
    gpg                /usr/bin/gpg
    gzip               /bin/gzip
    histfile           /root/.cpan/histfile
    histsize           100
    http_proxy         http://10.2.15.129:8090/
    inactivity_timeout 0
    index_expire       1
    inhibit_startup_message 0
    keep_source_where  /root/.cpan/sources
    links
    make               /usr/bin/make
    make_arg
    make_install_arg
    makepl_arg
    ncftp
    ncftpget
    no_proxy
    pager              /usr/bin/less
    prerequisites_policy follow
    scan_cache         atstart
    shell              /bin/bash
    tar                /bin/tar
    term_is_latin      1
    unzip              /usr/bin/unzip
    urllist
    wget               /usr/bin/wget


Fijaos que también existen las variables ftp_proxy y http_proxy. Aseguraos de que, o están en blanco (cogerá las del sistema) o son las que necesitáis. Porque son las que mandan.

Una vez tengamos claro esto con install y el nombre del módulo instalaremos.

La nomenclatura de los módulos de PERL suele ser como se ve  en el ejemplo.


cpan> install IO::Pty
Running install for module IO::Pty
Running make for T/TO/TODDR/IO-Tty-1.10.tar.gz

......
.....
Installing /usr/share/man/man3/IO::Tty::Constant.3pm
Installing /usr/share/man/man3/IO::Tty.3pm
Installing /usr/share/man/man3/IO::Pty.3pm
Writing /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/auto/IO/Tty/.packlist
Appending installation info to /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/perllocal.pod
  /usr/bin/make install  -- OK


Con esto ya tendríamos el módulo instalado.








No hay comentarios: