stas        2002/07/31 07:40:15

  Added:       src/docs/general/cpan_mod_dev cpan_mod_dev.pod
  Log:
  started a new doc: "Preparing mod_perl modules for CPAN"
  
  Revision  Changes    Path
  1.1                  
modperl-docs/src/docs/general/cpan_mod_dev/cpan_mod_dev.pod
  
  Index: cpan_mod_dev.pod
  ===================================================================
  =head1 NAME
  
  Preparing mod_perl modules for CPAN
  
  =head1 Description
  
  This document provides information for CPAN modules developers whose
  modules require mod_perl.
  
  =head1 Defining Makefile.PL Prerequisites that Require mod_perl
  
  If there are any prerequisites that need to be defined in
  I<Makefile.PL>, but require a mod_perl environment to successfully get
  loaded, the following workaround can be used. The following example
  will specify two prerequisites: C<CGI.pm> and C<Apache::DBI>, the
  latter can be loaded only under mod_perl whereas the former can be
  loaded from the command line.
  
    file:Makefile.PL
    ----------------
    use ExtUtils::MakeMaker;
    
    # set prerequisites
    my %prereq = (
        'CGI' => 2.71,
    );
    
    # Manually test whether Apache::DBI is installed and add it to the
    # PREREQ_PM if it's not installed, so CPAN.pm will automatically fetch
    # it. If Apache::DBI is already installed it will fail to get loaded by
    # MakeMaker because it requires the mod_perl environment to load.
    eval { require Apache::DBI };
    if ($@ && $@ !~ /Can't locate object method/) {
        $prereq{'Apache::DBI'} = 0.87;
    }
    
    WriteMakefile(
        NAME          => 'Apache::SuperDuper',
        VERSION_FROM  => 'SuperDuper.pm',
        PREREQ_PM     => \%prereq,
        # ... the rest
    );
  
  Notice that I<Can't locate object method> is a part of the error
  generated when C<Apache::DBI> is installed but is attempted to be
  loaded outside of mod_perl, e.g. at the command line, which is the
  case with I<Makefile.PL>.
  
  
  
  =head1 Writing the Test Suite
  
  The C<Apache::Test> framework provides an easy way to test modules
  which require mod_perl (or Apache in general), be it 1.0 or 2.0
  generation. Here is L<the complete guide to the C<Apache::Test>
  framework|docs::general::testing::testing>.
  
  =head1 Maintainers
  
  Maintainer is the person(s) you should contact with updates,
  corrections and patches.
  
  Stas Bekman E<lt>stas (at) stason.orgE<gt>
  
  =head1 Authors
  
  =over
  
  =item *
  
  Stas Bekman E<lt>stas (at) stason.orgE<gt>
  
  =item * 
  
  =back
  
  Only the major authors are listed above. For contributors see the
  Changes file.
  
  =cut
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to