LinuxCommandLibrary

cpan2dist

Create a distribution from CPAN modules

SYNOPSIS

cpan2dist [options] MODULE|/path/to/dist.tar.gz

PARAMETERS

--format=TYPE, -f TYPE
    Target package format (e.g., RPM, DEB, Arch, Slackware, Par).

--dist_dir=DIR, -d DIR
    Output directory for packages (default: current dir).

--verbose, -v
    Enable verbose output.

--trace, -t
    Enable debug tracing.

--force, -f
    Overwrite existing files/directories.

--skip_prereq
    Skip prerequisite checks.

--skip_configure
    Skip running Makefile.PL/Build.PL.

--notest, -T
    Skip running tests.

--help
    Show usage help.

--version
    Show version info.

DESCRIPTION

cpan2dist is a command-line tool from the CPANPLUS suite that automates creating native OS packages (e.g., RPM, DEB) from Perl distributions on CPAN.

It downloads the specified module or tarball, resolves dependencies, configures, builds, tests (optionally), and packages using backend modules like CPANPLUS::Dist::RPM or CPANPLUS::Dist::Deb.

Ideal for Linux packagers integrating Perl modules into distros like RPM-based (Fedora) or Debian systems, avoiding manual spec/debian dir creation.

Specify format with --format; defaults to configured or first available. Supports source/binary packages, custom dirs, and CPANPLUS options.

While powerful, it's legacy; modern workflows favor cpanm, mbtool, or alien tools for packaging.

CAVEATS

Requires CPANPLUS and format-specific CPANPLUS::Dist::* modules installed. May fail on modules with complex build reqs or non-standard META. Legacy tool; less maintained since ~2010.

SUPPORTED FORMATS

RPM, DEB, Arch, Slackware, Par, FreeBSD; list via cpan2dist --help.

EXAMPLE

cpan2dist --format=DEB --verbose IO::Socket::SSL
Downloads, builds, and creates Debian package in current dir.

HISTORY

Introduced ~2006 with CPANPLUS by Jos Boumans (KANE) as extensible CPAN frontend. Expanded for dist packaging via plugins. Peaked mid-2000s; declined with rise of cpanminus (2009+). Still in distros like Debian.

SEE ALSO

cpanplus(1), cpan(1), cpanm(1), dh-make-perl(1)

Copied to clipboard