CPAN2DIST(1)

πŸ“¦
version 0.991.600 Β· 3 versions
, in fedora 43

πŸ’– 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 β€” prefer Makefile.PL over Build.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 β€” tells ExtUtils::MakeMaker and Module::Build to 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 to 300 seconds. to turn off, you can set it to 0.
  • --set-config β€” change any options as specified in your config, for this invocation only. see CPANPLUS::Config for a list of supported options.
  • --set-program β€” change any programs as specified in your config, for this invocation only. see CPANPLUS::Config for a list of supported programs.
  • --dist-opts β€” arbitrary options passed along to the chosen installer format's prepare()/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 --ban and --banlist, but with pre-set lists. see the "Builtin Lists" section for details.
  • --default-ignorelist β€” use our builtin ignorelist. works just like --ignore and --ignorelist but 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::Dist
  • CPANPLUS::Module
  • CPANPLUS::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.


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