CPAN-Maker
view release on metacpan or search on metacpan
* `Devel::Modlist`
* `Perl::PrereqScanner`
...all of which will give about the same results as `scandeps.pl`
If you use any of those other checkers, wrap them in a script to make
sure they output the list in the correct format.
```
cat <<eof > dep_resolver
#!/bin/bash
perl -MDevel::Modlist=nocore \$1.pm 2>&1 | awk '{ print \$1}'
eof
chmod +x dep_resolver
make-cpan-dist -a 'Rob Lauer <rlauer6@comcast.net>' \
-m MyFunc -R no -l . -d "my function" \
-r dep_resolver
```
[Back to Table of Contents](#table-of-contents)
# What Next?
After successfully building and installing the project you will have
available two utilities that are used together to build a CPAN
distribution.
* `make-cpan-dist`
* `make-cpan-dist.pl`
When using a buildspec file you need only be concerned with
`make-cpan-dist.pl` and simply pass the buildspec file as a parameter.
```
make-cpan-dist.pl -b buildspec.yml
```
[Back to Table of Contents](#table-of-contents)
# Creating a CPAN Distribution
There are three possible ways to create a CPAN distribution using the
utiities contained in this project, each with varying degrees of
simplicity and flexibility. As a reminder, the point of these
utilities is to provide a __simple__ solution right? So the
_simplest_ thing you can do is run the utility against a
`buildspec.yml` file that describes the distribution you would like to
create.
[Back to Table of Contents](#table-of-contents)
## The Easy Way
Create a `buildspec.yml` file that looks something like this:
```
project:
git: https://github.com/rlauer6/perl-Amazon-Credentials.git
description: "AWS credentials discoverer"
author:
name: Rob Lauer
mailto: rlauer6@comcast.net
pm_module: Amazon::Credentials
path:
pm_module: src/main/perl/lib
tests: src/main/perl/t
exe_files: src/main/perl/bin
```
You specify some project metadata in the `project:` section and
possibly a pointer to the project in a git repository that will be
cloned.
You must also provide the name of the Perl module to package
(`pm_module`) and include a `path:` section that will point to the
modules and artifacts to be packaged.
The `path` attributes specify the path to the module, the path to the
tests and the path to executable scripts which will be included in
the distribution. All files with an extension of `.t` are assumed to
be included in the package if you have specified a test path.
If your project includes other Perl modules somewhere in the
Perl module path then they will be packaged as well. Paths are relative
to the root of the project or your current working directory if you
are not specifying a git repository as the source of your
package.
If your project includes Perl scripts, you can add those to your
distribution by setting the path to those with the `exe_files` and
`scripts` subsection of `path`. These will be packaged and installed
in the `bin` directory (INSTALLBIN).
So, assuming you have created an appropriate
`buildspec.yml` file, the easy way boils down to this:
```
make-cpan-dist.pl -b buildspec.yml
```
After executing that statement, you should have a tar ball in your
current working directory.
[Back to Table of Contents](#table-of-contents)
### Additional Build Specification Options
The build specification file can contain some additional options to
control what and how things get packaged.
* use the `recurse` option to add additional Perl modules from your
project path. If you want to add additional Perl modules to the
distribution, just make sure they are under the directory path of
your core module and the `recurse` option is set to `yes`. _Actually
this is the default. If you don't want to recurse, set this to
*no*._
```
path:
( run in 1.670 second using v1.01-cache-2.11-cpan-39bf76dae61 )