NAME

CPAN::Packager::Manual - User manual

USER MANUAL

This is the CPAN::Packager users manual.

DESCRIPTION

cpan-packager creates RPM and Deb packages of CPAN distributions. Given a module name, cpan-packager will automatically analyze dependencies, download, build, test, provision, and install packages.

SETUP
How to setup cpan-packager
Installation
Install CPAN::Packager from CPAN.

cpan CPAN::Packager

Additional setup for redhat users
Apply patches/rpm/perlreq.patch to /usr/lib/rpm/perl.req. Otherwise, perl.req extracts needles module dependencies.

Additional setup for debian users
Copy conf/debian/rules* to the ~/.dh-make-perl directory. Otherwise, you may experience conflicts. For example: perllocal.pod.

HOW TO USE CPAN-PACKAGER SCRIPT
RPMs
$ sudo cpan-packager --module Test::Exception --builder RPM --conf \ conf/config-rpm.yaml --verbose

The resulting package may be found at: ~/.cpanpackager/rpm

Debs
$ sudo cpan-packager --module Test::Exception --builder Deb --conf \ conf/config-deb.yaml --verbose

The resulting package may be found at: ~/.cpanpackager/deb

Options

         Foo::Bar
         Wibble::Plink

CONFIGURATION

The configuration file is YAML-based and is comprised of two main sections, the "global" section, and the "modules" section. The configuration schema is defined in: CPAN::Packager::Config::Schema

The "global" configuration section.
This section defines common configuration entities.

An example configuration section for "cpan_mirrors" may look like:

         ---
         global:
           cpan_mirrors:
             - http://ftp.funet.fi/pub/languages/perl/CPAN/
             - file:///home/dann/minicpan

The "modules" configuration section
This section defines module-specific configuration entities.

MISCELLANEOUS
Using cpan-packager with minicpan
You may use CPAN::Packager with minicpan. First, establish your local minicpan mirror:

minicpan -r http://ftp.funet.fi/pub/languages/perl/CPAN/ -l ~/minicpan

Then, just set the path to your local minicpan mirror in your configuration file:

     ---
     global:
       cpan_mirrors:
         - file:///home/dann/minicpan

Applying patches to tarballs for RPM builds Write the module's configuration as such:

The patch should, for example, look like:

        --- Acme-1.11111/t/acme.t.orig 2010-01-26 22:26:51.000000000 +0900
        +++ Acme-1.11111/t/acme.t   2010-01-26 22:26:39.000000000 +0900
        @@ -1,8 +1,10 @@
         use lib 't', 'lib';
         use strict;
         use warnings;
        -use Test::More tests => 2;
        +use Test::More tests => 3;
         use Acme;
         
     ok(acme->is_acme);
         ok(acme->is_perfect);
        +ok 1;

Specify installation location (optional) It is possible for a CPAN::Packager user to explicitly specify installation locations for a distribution's libraries, documentation, man pages, binaries, and scripts. Setting both of the below environment variables, for example, will accomplish this.

     PERL_MM_OPT="INSTALLVENDORMAN1DIR=/usr/local/share/man/man1
     INSTALLVENDORMAN3DIR=/usr/local/share/man/man3
     INSTALLVENDORBIN=/usr/local/bin INSTALLVENDORSCRIPT=/usr/local/bin"

     PERL_MB_OPT="--config installvendorman1dir=/usr/local/share/man/man1
     --config installvendorman3dir=/usr/local/share/man/man3 --config
     installvendorbin=/usr/local/bin --config installvendorscript=/usr/local/bin"

Additionally, for RPMs, you may specify the directory in which non-man documentation (Changes, README, etc) are installed via adding an entry to your ~/.rpmmacros file:

%_defaultdocdir /usr/local/share/doc

ENVIRONMENT VARIABLES

Environment variable "CPAN_PACKAGER_TEST_LIVE" can be used to execute live tests.

Environment variable "CPAN_PACKAGER_ENABLE_DUMP" can be used to dump variables.

BUGS

Please report any bugs or feature requests to this project's GitHub repository at:

http://github.com/dann/p5-cpan-packager/issues

Thank you!

AUTHOR

Takatoshi Kitano <kitano.tk@gmail.com>