CPAN2DIST(1)
π cpan2dist β the CPANPLUS distribution creator π
okay bestie, welcome to cpan2dist, a manual page from the User Contributed Perl Documentation crew. she's the little script that turns CPAN modules into whatever package format you want. iconic behavior honestly.
β¨ NAME β¨
cpan2dist β the CPANPLUS distribution creator π
πΈ DESCRIPTION πΈ
so this script makes distributions out of CPAN modules, in whatever format you tell it, and it drags all the prerequisites along too. like, the whole friendship group comes. then you can install those packages with the matching package manager for that format. slay.
ngl, you can also do this interactively from the default shell, CPANPLUS::Shell::Default. check the CPANPLUS::Dist docs, plus the docs of whatever format you picked, for any format-specific deets. π¦
π USAGE π
Usage: cpan2dist [--format FMT] [OPTS] Mod::Name [Mod::Name, ...]
cpan2dist [--format FMT] [OPTS] --modulelist /tmp/mods.list
cpan2dist [--format FMT] [OPTS] --archive /tmp/dist [/tmp/dist2]
Will create a distribution of type FMT of the modules
specified on the command line, and all their prerequisites.
Can also create a distribution of type FMT from a local
archive and all of its prerequisites.
so yeah: it builds a distribution of type FMT of the modules you list on the command line, plus every single one of their prerequisites. it can also build a type FMT distribution from a local archive and all of its prerequisites. versatile queen. π
Options:
π«Ά options that take no argument
--helpβ shows you this help message. the "bestie pls explain" button.--installβ installs this package (and any prerequisites you built) after building it. she doesn't just build, she commits.--skiptestβ skip tests. you can negate it with--noskiptest.--forceβ force the operation. negate it with--noforce.--verboseβ be verbose. negate it with--noverbose.--keepsourceβ keep sources after building the distribution. negate it with--nokeepsource. heads up: may not be supported by all formats. π--makefileβ preferMakefile.PLoverBuild.PL. negate it with--nomakefile. defaults to your config setting.--buildprereqβ build packages of any prerequisites, even if they're already uptodate on the local system. negate it with--nobuildprereq. defaults to false.--archiveβ says that all the modules you listed are actually archives.--flushcacheβ update CPANPLUS' cache before starting any operation. fresh start energy.--defaultsβ tellsExtUtils::MakeMakerandModule::Buildto use default answers during'perl Makefile.PL'or'perl Build.PL'calls where possible.--edit-metafileβ edit the distribution's metafile(s) before the distribution is built. requires a configured editor.
π options that take an argument
--formatβ the installer format to use (defaults to config setting).--banβ patterns of module names to skip during installation, case-insensitive (affects prerequisites too). may be given multiple times.--banlistβ file containing patterns that could be given to--ban. are appended to the ban list built up by--ban. may be given multiple times.--ignoreβ patterns of modules to exclude from the prereq list. useful for when a prereq listed by a CPAN module is resolved some other way than from its corresponding CPAN package. (the match is done on both the module name and the package name of the package the module is in, case-insensitive.)--ignorelistβ file containing patterns that may be given to--ignore. are appended to the ban list built up by--ignore. may be given multiple times.--modulelistβ file containing a list of modules that should be built. are appended to the list of command line modules. may be given multiple times.--logfileβ file to log all output to. by default, all output goes to the console.--timeoutβ the allowed time for building a distribution before aborting. this is useful to terminate any build that hangs or happens to be interactive despite being told not to be. defaults to300seconds. to turn off, you can set it to0.--set-configβ change any options as specified in your config, for this invocation only. seeCPANPLUS::Configfor a list of supported options.--set-programβ change any programs as specified in your config, for this invocation only. seeCPANPLUS::Configfor a list of supported programs.--dist-optsβ arbitrary options passed along to the chosen installer format'sprepare()/create()routine. please see the docs of the installer of your choice for options it accepts.
π builtin lists
--default-banlistβ use our builtin banlist. works just like--banand--banlist, but with pre-set lists. see the "Builtin Lists" section for details.--default-ignorelistβ use our builtin ignorelist. works just like--ignoreand--ignorelistbut with pre-set lists. see the "Builtin Lists" section for details.
π examples
### build a debian package of DBI and its prerequisites,
### don't bother running tests
cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --skiptest DBI
### build a debian package of DBI and its prerequisites and install them
cpan2dist --format CPANPLUS::Dist::Deb --buildprereq --install DBI
### Build a package, whose format is determined by your config, of
### the local tarball, reloading cpanplus' indices first and using
### the tarballs Makefile.PL if it has one.
cpan2dist --makefile --flushcache --archive /path/to/Cwd-1.0.tgz
### build a package from Net::FTP, but don't build any packages or
### dependencies whose name match 'Foo', 'Bar' or any of the
### patterns mentioned in /tmp/ban
cpan2dist --ban Foo --ban Bar --banlist /tmp/ban Net::FTP
### build a package from Net::FTP, but ignore its listed dependency
### on IO::Socket, as it's shipped per default with the OS we're on
cpan2dist --ignore IO::Socket Net::FTP
### building all modules listed, plus their prerequisites
cpan2dist --ignorelist /tmp/modules.ignore --banlist /tmp/modules.ban
--modulelist /tmp/modules.list --buildprereq --flushcache
--makefile --defaults
### pass arbitrary options to the format's prepare()/create() routine
cpan2dist --dist-opts deb_version=3 --dist-opts prefix=corp
π Built-In Filter Lists π
some modules you'd just rather not package. some because they're part of core-perl and you don't want a whole new package. some because they won't build on your system. some because your package manager of choice already packages them for you.
there may be a myriad of reasons, bestie. you can use the --ignore and --ban options for this, but we also provide some built-in lists that catch the common cases. use these built-in lists if you like them, or supply your own if you need to. no pressure. π
π§ Built-In Ignore List
you can use this list of regexes to ignore modules matching to be listed as prerequisites of a package. particularly useful if they're bundled with core-perl anyway and they have known issues building. messy of them.
toggle it by supplying the --default-ignorelist option.
^IO$ # Provided with core anyway
^Cwd$ # Provided with core anyway
^File::Spec # Provided with core anyway
^Config$ # Perl's own config, not shipped separately
^ExtUtils::MakeMaker$ # Shipped with perl, recent versions
# have bug 14721 (see rt.cpan.org)
^ExtUtils::Install$ # Part of of EU::MM, same reason
π Built-In Ban list
you can use this list of regexes to disable building of these modules altogether. straight up blocked, no cap.
toggle it by supplying the --default-banlist option.
^GD$ # Needs c libraries
^Berk.*DB # DB packages require specific options & linking
^DBD:: # DBD drivers require database files/headers
^XML:: # XML modules usually require expat libraries
Apache # These usually require apache libraries
SSL # These usually require SSL certificates & libs
Image::Magick # Needs ImageMagick C libraries
Mail::ClamAV # Needs ClamAV C Libraries
^Verilog # Needs Verilog C Libraries
^Authen::PAM$ # Needs PAM C libraries & Headers
π SEE ALSO π
CPANPLUS::DistCPANPLUS::ModuleCPANPLUS::Shell::Default"cpanp"
π BUG REPORTS π
please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>.
found a bug? do NOT suffer in silence bestie, tell the maintainers fr fr π
π AUTHOR π
this module by Jos Boumans <kane@cpan.org>. legend behavior.
π COPYRIGHT π
the CPAN++ interface (of which this module is a part of) is copyright (c) 2001 - 2007, Jos Boumans <kane@cpan.org>. all rights reserved.
this library is free software; you may redistribute and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π«Ά this one came from perl v5.42.0, dated 2025-07-25, straight out of the User Contributed Perl Documentation collection β so go forth and cpan2dist, mwah π
β¨
π¦ where this page comes from
- fedora 43: perl-CPANPLUS 0.991.600-2.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms