Difference between revisions of "CPAN install"

From Apache OpenOffice Wiki
Jump to: navigation, search
(Detailed installation instructions)
(Detailed installation instructions)
Line 41: Line 41:
 
Phase 1: Everyone
 
Phase 1: Everyone
 
# '''CPAN:''' perl -MCPAN -e 'install Archive::Zip'
 
# '''CPAN:''' perl -MCPAN -e 'install Archive::Zip'
# '''CPAN:''' perl -MCPAN -e 'XML::Parser'
+
# '''CPAN:''' perl -MCPAN -e 'install XML::Parser'
  
 
Phase 2: For committers
 
Phase 2: For committers
Line 49: Line 49:
 
## perl Makefile.PL
 
## perl Makefile.PL
 
## make; make test; make install
 
## make; make test; make install
# '''CPAN:''' perl -MCPAN -e 'LWP::UserAgent'  
+
# '''CPAN:''' perl -MCPAN -e 'install LWP::UserAgent'  
# '''CPAN:''' perl -MCPAN -e 'SOAP::Lite'
+
# '''CPAN:''' perl -MCPAN -e 'install SOAP::Lite'
  
 
==Troubleshooting==
 
==Troubleshooting==

Revision as of 14:46, 4 July 2006

Short guide for CPAN downloads

As you might need to install additional perl modules to build OOo 2.0 or to use the tinderbox script this document describes briefly how to access and use CPAN.

What is CPAN?

CPAN is the Comprehensive Perl Archive Network, a large collection of Perl software and documentation. You can begin exploring from either http://www.cpan.org/, http://www.perl.com/CPAN/ or any of the mirrors listed at http://www.cpan.org/SITES.html and http://mirror.cpan.org/.

Note that CPAN is also the name of a Perl module, CPAN.pm, which is used to download and install Perl software from the CPAN archive.

This page tells you only enough to use this Perl module to install additional perl modules. You may find the documentation for it by using perldoc CPAN via the command line or on the web at http://search.cpan.org/author/JHI/perl-5.8.0/lib/CPAN.pm.

Install a module with CPAN.

If you are behind a firewall set FTP_PASSIVE to 1.

$ export FTP_PASSIVE="1"

Start the CPAN module.

$ perl -MCPAN -e shell

If this is your first time you use this module you have to answer some questions of this module. Just follow the directions on your screen.

For example, if you want to install the Mail::Sender module do it like:

cpan> install Mail::Sender

Typing help gets you some online help.

cpan> help

And typing quit quits the module.

cpan> quit

This is everything you need to know to use the CPAN module.

Detailed installation instructions

Especially on win32 there are some issues with Crypt::SSLeay. CPAN designates modules that can be installed using CPAN directly, MANUAL indicate modules that must be installed manually (really!). The installation order is also important. Phase 1 must be installed before Phase 2 (and the internal order is significant)

Phase 1: Everyone

  1. CPAN: perl -MCPAN -e 'install Archive::Zip'
  2. CPAN: perl -MCPAN -e 'install XML::Parser'

Phase 2: For committers

  1. MANUAL: Crypt::SSLeay. The CPAN installation is broken.
    1. Download and unpack the installation tarball: http://www.perl.com/CPAN/modules/by-module/Crypt/Crypt-SSLeay-0.51.tar.gz
    2. Apply this patch: ssleay.patch (the rationale for the patch can be found here)
    3. perl Makefile.PL
    4. make; make test; make install
  2. CPAN: perl -MCPAN -e 'install LWP::UserAgent'
  3. CPAN: perl -MCPAN -e 'install SOAP::Lite'

Troubleshooting

Problem: Win32/Cygwin: /bin/sh: -c: line 0: unexpected EOF while looking for matching `"'

Solution: Either your LIB or INCLUDE environment variable ends with a trailing "\" (backslash). This backslash espaces a double quote used by certain makefiles to protect variables passed to the shell. The shell then can't find the matching double quote and dies. This happens notably with SOAP::Lite and other CWS cpan modules.

Note: If you really have the environment variables LIB and INCLUDE set better consider yourself a wizard that is able to deal with CPAN (compiling cygwin programs in general) problems as you are most propably mixing gcc and MSVC here. Don't set LIB and INCLUDE, the OOo build doesn't need them.

Personal tools