NAME

CPAN::Maker - create a CPAN distribution

SYNOPSIS

make-cpan-dist.pl options

make-cpan-dist.pl -b buildspec.yml

DESCRIPTION

Utility that is part of a toolchain to create a CPAN distribution.

This utility should normally be called with the --buildspec option specifying a YAML file that describes the distribution to be packaged. The toolchain can:

If the script is passed a YAML file (--buildspec) then the script will parse the build specification and call the bash script make-cpan-dist with all of the necessary flags to build a tarball. If you do not provide a build specification this script will only create the Makefile.PL file for you. It will be left to you to modify the Makefile.PL if necessary and then package the artifacts into a CPAN distribution.

You can also call the bash script yourself, supplying all of the necessary options. When using the bash script, it will ultimately call this script to create the Makefile.PL and before creating your CPAN distribution.

USAGE

make-cpan-dist.pl -b buildspec.yml

make-cpan-dist.pl options

Options

-a, --author                author
-A, --abstract              description of the module
-B, --build-requires        build dependencies
-b, --buildspec             read a buildspec and create command line
    --cleanup, --no-cleanup remove temp files, default: cleanup
    --create-buildspec      name of a buildspec file to create
-d, --debug                 debug mode
    --dryrun                dryrun
    --exe-files             path to the executables list
    --extra-path            path to the extra files list
-h, --help                  help
-l, --log-level             ERROR, WARN, INFO, DEBUG, TRACE
-m, --module                module name
-M, --min-perl-version      minimum perl version to consider core, default: $PERL_VERSION
-P, --pager, --no-pager     use a pager for help, default: use pager
    --pl-files              path to the PL_FILES list (see perldoc ExtUtils::MakeMaker)
    --postamble             name of the file containing the postamble instructions
-p, --project-root          default: current working directory
    --recurse               whether to recurse directors when searching for files
-r, --requires              dependency list
-R, --require-versions      add version numbers to dependencies
    --no-require-versions   
    --scripts-path          path to the scripts listing
-t, --test-requires         test dependencies
    --tests-path            path to the tests listing
-s, --scandeps              use scandeps for dependency checking
-V, --verbose               verbose output
-v, --version               version
    --version-from          module name that provide version

This script is typically called with the --buildspec option specifying a YAML file that contains the options for building a CPAN distribution. Calling this script without the --buildspec option will only result in a Makefile.PL being written to STDOUT.

When invoked with a buildspec it will parse the YAML file and call the make-cpan-dist bash script that actually creates the CPAN distribution.

See man CPAN::Maker for more details.

ENVIRONMENT VARIABLES

VERSION

This documentation refers to version 1.8.4

USING THE BASH SCRIPT

Assuming you have a module named Foo::Bar in a directory named lib and some tests in a directory named t, you might try:

make-cpan-dist -l lib -t t -m Foo::Bar \
 -a 'Rob Lauer <rlauer6@comcast.net>' -d 'the Foo::Bar module!'

NOTE: Running the Bash script in any directory of your project if it is part of a git repository will use the root of the repository as your project home directory. If you are not in a git repository AND do not supply the -H option (project home), then the current directory will be considered the project home directory. This means that options like -l will be relative to the current directory.

Using buildspec.yml

make-cpan-dist.pl -b buildspec.yml

Calling this utility directly with the -b option will parse the buildspec and invoke the bash script with all of the appropriate options. This is the preferred way of using this toolchain. The format of the YAML build file is described below.

IMPORTANT: All files specified in the buildspec.ym file must be specified as absolute paths or they should be relative to the project's root directory, NOT THE CURRENT WORKING DIRECTORY!

OPTION DETAILS

BUILD SPECIFICATION FORMAT

Example:

version: 1.8.4
project:
  git: https://github.com/rlauer6/perl-Amazon-Credentials
  description: "AWS credentials discoverer"
  author:
    name: Rob Lauer
    mailto: rlauer6@comcast.net
pm_module: Amazon::Credentials
include-version: no
dependencies:
  resolver: scandeps
  requires: requires
  test_requires: test-requires
  required_modules: no
path:
  recurse: yes
  pm_module: src/main/perl/lib
  tests: src/main/perl/t
  exe_files: src/main/perl/bin
exclude_files: exclude_files
extra: extra-files
extra-files:
  - file
  - /usr/local/share/my-project:
    - file
provides: provides
postamble: postamble
man-links:
resources:
  homepage: 'http://github.com/rlauer6/perl-Amazon-API'
  bugtracker:
    web: 'http://github.com/rlauer6/perl-Amazon-API/issues'
    mailto: rlauer6@comcast.net
  repository:
    url: 'git://github.com/rlauer6/perl-Amazon-API.git'
    web: 'http://github.com/rlauer6/perl-Amazon-API'
    type: 'git'

The sections are described below:

DEPENDENCIES

By default the script will look for dependencies in files named requires and test-requires. These can be created automatically by the bash script (make-cpan-dist).

You can specify a different name for the files with the -r and -t options.

You must however have a file that contains the dependency list in order to create a CPAN distribution.

Again, if you use the bash script that invokes this utility or are calling this utility with a buildspec.yml file, these files can be automatically created for you based on your options. If you provide your own requires or test-requires file, modules should be specified as shown below unless the name of the dependency file is cpanfile.

module-name version

Example:

AWS::Signature4 1.02
...

AUTHOR

Rob Lauer - rlauer6@comcast.net