Ingy döt Net > Package-0.17 > Package



Annotate this POD



Open  0
View/Report Bugs
Module Version: 0.17   Source  


From the command line:

    > pkg help

    > pkg new \
            --from=pkg/perl/dzil \
            --module=Foo::Bar \
            --desc='Foo to the Bar' \


pkg is your tool for creating distributable, modular packages, in a variety of programming languages. Perl 5 modules for CPAN, Python modules for PyPI, Ruby modules for RubyGems, etc.

In truth, pkg is nothing more than a simple way to create a new directory of starter files, by applying a set of configuration information to a set of file templates. The information is all completely in your control. You can use other people's templates or create your own.


Here's the quick and simple way to get started, assuming you are familiar with cpanm and git. From the command line:

    # Go to the directory where you keep your repos:
    cd $HOME/src/
    # Get the base pkg directory:
    git clone pkg
    # pkg/README will contain a list of known pkg template repos
    # Get a basic pkg template. In the case, for a Perl module:
    git clone pkg/perl
    # Maybe get a more specific Perl module template:
    git clone pkg/perl/dzil
    # Edit the conf files appropriately
    edit pkg/pkg.conf pkg/perl/pkg.conf pkg/perl/dzil/pkg.conf
    # Now create a new perl module in the foo-bar-pm directory
    pkg new --from=pkg/perl --module=Foo::Bar --desc='Foo Bar' foo-bar-pm
    # Make another new module!
    pkg new --from=pkg/perl/dzil --module=Bar::Bar --desc='Bar Bar' bar-bar-pm

That was easy.


The main template repository is:

The README in this repo contains repos for many other repos. You can easily create your own too. Just make sure there is a pkg.conf file in each template dir (even if it is empty). Template directories inherit from their parent directory.

More doc soon.

syntax highlighting: