CPAN2DIST(1p)
β¨ CPAN2DIST π
okay bestie, so this is the manual page for cpan2dist from the User Contributed Perl Documentation β it's a Perl script, she's iconic, she makes packages, and we're gonna go through every single thing she does. no skimming, no skipping, we're doing the whole thing π«Ά
πΈ NAME πΈ
cpan2dist β the CPANPLUS distribution creator π
π¦ DESCRIPTION π¦
so basically, this script will create distributions of CPAN modules in the format you specify, and it grabs all their prerequisites too. once you've got those packages, you can install them with the matching package manager for whatever format you picked. slay.
also important: you can do this interactively from the default shell, CPANPLUS::Shell::Default. check out the CPANPLUS::Dist documentation, plus the docs for whichever format you chose, for any format-specific deets. iykyk π
β 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'll build a distribution of type FMT of all the modules you list on the command line, prerequisites included. and it can also build a distribution of type FMT from a local archive, plus everything that archive needs. π
π Options π
take no argument:
--helpβ shows you this help message. bestie behavior tbh.--installβ installs this package (and any prerequisites you built) after building it.--skiptestβ skips the tests. you can negate it with--noskiptest.--forceβ forces the operation. you can negate it with--noforce.--verboseβ be verbose. you can negate it with--noverbose.--keepsourceβ keeps the sources after building the distribution. you can negate it with--nokeepsource. heads up: may not be supported by all formats π«--makefileβ prefersMakefile.PLoverBuild.PL. you can negate it with--nomakefile. defaults to your config setting.--buildprereqβ builds packages for any prerequisites, even if they're already uptodate on your local system. you can negate it with--nobuildprereq. defaults to false.--archiveβ says that all the modules you listed are actually archives.--flushcacheβ updates CPANPLUS' cache before starting any operation.--defaultsβ tellsExtUtils::MakeMakerandModule::Buildto use default answers during the'perl Makefile.PL'or'perl Build.PL'calls, wherever possible.--edit-metafileβ lets you edit the distribution's metafile(s) before the distribution gets built. requires a configured editor.
take argument:
--formatβ the installer format to use (defaults to your config setting).--banβ patterns of module names to skip during installation, case-insensitive (and yes, it affects prerequisites too). may be given multiple times.--banlistβ a file containing patterns that could be given to--ban. they get appended to the ban list built up by--ban. may be given multiple times.--ignoreβ patterns of modules to exclude from the prereq list. super useful when a prereq listed by a CPAN module gets 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β a file containing patterns that may be given to--ignore. they get appended to the ban list built up by--ignore. may be given multiple times.--modulelistβ a file containing a list of modules that should be built. they get appended to the list of command line modules. may be given multiple times.--logfileβ a 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 for terminating any build that hangs, or that happens to be interactive even though it was told not to be π. defaults to300seconds. to turn it 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 documentation of the installer of your choice for the 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 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. you can use the --ignore and --ban options for this, but we also provide some built-in lists that catch common cases. use the built-in ones if you like, or supply your own if you need to. no cap.
π Built-In Ignore List π
you can use this list of regexes to ignore modules matching it, so they don't get listed as prerequisites of a package. particularly useful if they're bundled with core-perl anyway and they have known issues building. π
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. periodt.
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::Dist, CPANPLUS::Module, CPANPLUS::Shell::Default, "cpanp"
π BUG REPORTS π
please report bugs or other issues to <bug-cpanplus@rt.cpan.org<gt>. (yes, literally that string, bestie, i'm not touching it π)
π AUTHOR π
this module by Jos Boumans <kane@cpan.org>.
π 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's from perl v5.40.1, dated 2025-03-01 π¦ go build something gorgeous π β¨
π¦ where this page comes from
- debian trixie: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcpanplus-perl 0.9916-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms