#!/usr/bin/env perl
use strict;
use warnings;
use FindBin::libs;
use CPAN::Packager::Script;

my $script = CPAN::Packager::Script->new_with_options;
$script->run;

__END__

=head1 NAME

cpan-packager -  create redhat/debian packages from perl modules

=head1 SYNOPSIS

case1: build a module

    sudo cpan-packager --module Test::Exception --builder Deb --conf conf/config.yaml 

case2: build multiple modules at a time 

    sudo cpan-packager --modulelist modulelist.txt --builder RPM --conf conf/config.yaml 

options
    --module         module name (required option)
    --builder        Deb or RPM (optional. default is Deb)
    --conf           configuration file path (required)
    --always-build   always build cpan modules if module is aready installed (optional)
    --modulelist     File containing a list of modules that should be built. (optional)

RPM/Deb Packages are generated at /tmp/cpanpackager/{deb or rpm}

=head2 Configuration location and schema

config.yaml is located at github repo.

    See http://github.com/dann/cpan-packager/tree/master

Please see the configuration schema if you want to write config your self.
You can see schema like below.

    perldoc CPAN::Packager::Config::Schema


=head2 Configure CPAN mirrors

CPAN::Packager downloads modules from cpan_mirrors 
if you set CPAN mirror uri in your config.

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

=head2 Use cpan-packager with minicpan

You can use minicpan with CPAN::Packager.
At first, you mirror CPAN modules with minicpan.

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

Set cpan mirrors uri in your config if you want to use minicpan.
after that you just use cpan-packager ;)

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

=head1 DESCRIPTION

cpan-packager will create the files required to build a debian or redhat source 
package out of a perl package. This works for most simple packages and is also 
useful for getting started with packaging perl modules. Given a perl package name, 
it can also automatically download it from CPAN. 

=head1 AUTHOR

Takatoshi Kitano E<lt>kitano.tk@gmail.comE<gt>

=head1 SEE ALSO

=head1 LICENSE

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

=cut
