NAME

CPAN::Maker - create a CPAN distribution

SYNOPSIS

cpan-maker -b buildspec.yml
cpan-maker build -b buildspec.yml
cpan-maker create-cpanfile file1 file2 ...

Options

-a, --author                author in 'name <email>' format (default: anonymouse <anonymouse@example.org) 
-A, --abstract              description of the module
-B, --build-requires        build dependencies
-b, --buildspec             buildspec YAML file
    --cleanup, --no-cleanup remove temp dir after build (default: cleanup)
    --create-buildspec      name of a buildspec file to create
-d, --debug                 debug mode
    --destdir               destination directory for the tarball (default: cwd)
    --dryrun                dump parsed buildspec args and exit
    --exe-files             path to the executables list
    --extra-path            path to the extra files list
-h, --help                  help
    --license               License under which the software can be used (default: perl)
-l, --log-level             ERROR, WARN, INFO, DEBUG, TRACE
-m, --module                module name
-M, --min-perl-version      minimum perl version to consider core (default: 5.010)
    --no-cleanup            preserve temp dir after build
    --no-require-versions   omit version numbers from dependencies
-o, --outfile               output file for create-cpanfile (default: cpanfile, - for STDOUT)
-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
    --preserve-makefile     copy Makefile.PL to destdir after build
-p, --project-root          default: current working directory
    --recommends            path to the file containing the recommended modules and versions
    --recurse               recurse directories when searching for files
-R, --require-versions      add version numbers to dependencies
-r, --requires              path to the file containing the required modules and versions (required for write-makefile)
    --scripts-path          path to the scripts listing
    --skip-tests            skip C<make test> during build
    --suggests              path to the file containing the suggested modules and versions
    --tests-path            path to the tests listing
-V, --verbose               verbose output
-v, --version               version
    --version-from          module that provides the version

Commands

DESCRIPTION

CPAN::Maker is a utility for creating CPAN distribution tarballs from a declarative YAML build specification. It handles dependency resolution, Makefile.PL generation, file staging, and packaging entirely in Perl — no external bash scripts are required.

The build pipeline, invoked via cpan-maker -b buildspec.yml:

Note: Prior to version 2.0.0, the build was delegated to an external bash script (make-cpan-dist). That script is no longer invoked and is retained only as a compatibility shim. All build logic now runs within cpan-maker itself.

OPTION DETAILS

ENVIRONMENT VARIABLES

No environment variables are used by cpan-maker. Options previously controlled by PRESERVE_MAKEFILE, SKIP_TESTS, and DEBUG environment variables (which applied to the now-removed bash script) are now available as --preserve-makefile, --skip-tests, and --debug command-line options.

BUILD SPECIFICATION FORMAT

The preferred way to use cpan-maker is with a buildspec.yml file:

cpan-maker -b buildspec.yml

Minimal example

project:
  description: My awesome module
  author:
    name:   A. U. Thor
    mailto: au@example.com

pm-module: Foo::Bar

dependencies:
  requires:      requires
  test-requires: test-requires

Full key reference

Key Naming

Keys may be written with hyphens (pm-module) or underscores (pm_module). The hyphenated form is canonical. If underscore keys are detected they are normalised before parsing and a corrected copy of the buildspec is written to buildspec.yml.current. The original file is never modified.

DEPENDENCIES

Runtime and test dependencies are read from plain-text files, one module per line with an optional version number:

Amazon::Credentials 1.15
HTTP::Tiny

By default the files are named requires and test-requires. The paths can be overridden in the dependencies section of the buildspec.

If the dependency file is named cpanfile it is parsed in cpanfile format.

VERSION

This documentation refers to version 2.0.6

AUTHOR

Rob Lauer - rlauer@treasurersbriefcase.com