DH-MAKE-PERL(1p)
π DH-MAKE-PERL(1p) β User Contributed Perl Documentation π
okay bestie, welcome to the group chat. this is dh-make-perl, section 1p of the user-contributed Perl docs, and it's literally the tool that turns your lil Perl module into a whole Debian source package. buckle up. π
β¨ NAME β¨
dh-make-perl β Create debian source packages from Perl modules π¦
β¨ SYNOPSIS β¨
dh-make-perl [make] {SOURCE_DIR | --cpan MODULE|DIST} options...
dh-make-perl refresh {--only ...} [directory]
dh-make-perl locate Foo::Bar ...
dh-make-perl refresh-cache
dh-make-perl dump-config
dh-make-perl help
cpan2deb MODULE|DIST options...
cpan2dsc MODULE|DIST options...
like. look at those. so many entry points. main character energy fr. π
β¨ DESCRIPTION β¨
so dh-make-perl will create all the files you need to build a debian source package out of a Perl module or a CPAN distribution. it works for most simple packages, and ngl it's also super useful for just getting started with packaging Perl modules in the first place.
you can name a module or distribution with the --cpan switch, and dh-make-perl will go download it for you from a CPAN mirror β or you can just point it at a directory that already has the unpacked sources sitting there. and if you give it neither --cpan nor a directory as an argument, it tries to create a Perl package from the data in the current directory. lowkey convenient.
you can build and install the debian binary package using the --build and --install command line switches. slay.
if dh-make-perl gets called as
cpan2deb <options...> Foo::Bar
it behaves like
dh-make-perl make <options...> --build --cpan Foo::Bar
and if it gets called as
cpan2dsc <options...> Foo::Bar
it behaves like
dh-make-perl make <options...> --build-source --cpan Foo::Bar
π«Ά bestie. using this program is no excuse for not reading the debian developer documentation. that means the Debian policy, the Debian Perl policy, the packaging manual, and so on. read them. for real. no skimming.
πΈ COMMANDS πΈ
make
the default command when you don't give a command at all. it creates a "debianisation" from scratch. and it fails with an error if a debian/ directory already exists β so don't try it, it's not gonna work. π
refresh [directory]
for refreshing a package. directory defaults to the current working directory. it rebuilds debian/copyright and debian/rules using the current templates. and before anything gets changed in those files, a backup copy is made with a .bak suffix. safety first, we love that. π«Ά
this is useful when debian/rules was created using older templates and doesn't contain much customization. but as always, you're strongly encouraged to verify whether debian/rules looks sane. read your own diff, bestie.
refresh also tries to update dependency lists in debian/control from META.yml.
when updating debian/copyright, dh-make-perl tries to be clever about remembering email addresses. it gets the list of copyright holders and their emails for debian/* from the sign off lines in debian/changelog. but to allow for email addresses changing, it looks for change lines of the form
* Email change: Debbie Devlin -> devlin@debian.org
so now Debbie Devlin <devlin@debian.org> will be used in the copyright instead of Debbie Devlin <debbie@devlin.org>. glow up. β¨
--only | -o control|copyright|docs|examples|rules
this option lets you update only one or more file(s) in the debian/ directory when dh-make-perl is run in refresh mode. filenames are separated by a comma. the option can be given multiple times, and the arguments accumulate. π
locate MODULE ...
tries to locate the package that contains the given Perl MODULEs.
example:
dh-make-perl locate IPC::Run3 XML::Tidy
refresh-cache
dh-make-perl parses the Contents files, fetched by apt-file(1), and stores the result in a cache. the cache is refreshed automatically if it's older than any Contents file. but β and this is the annoying part β if you run apt-file(1) in your nightly cron job, the first time you run dh-make-perl during the day you shall wait for the cache to be reconstructed. π with this option you can move the cache re-creation to the cron job, right after apt-file update.
does nothing if the cache is newer than the Contents files. periodt.
dump-config
causes the current config, including any default settings, to be printed to the standard output.
useful for populating a dh-make-perl.conf file. iykyk.
help
displays short usage information.
π OPTIONS π
--archany | all β switches between arch-dependent and arch-independent packages. if--archisn't used,dh-make-perluses a relatively good-working algorithm to decide this all on its own. independent queen.--backups|--no-backupsβ inrefreshmode, create backups ofdebian/copyrightanddebian/rulesbefore overwriting them. on by default.--basepkgsβ explicitly gives a comma-separated list of packages to consider "base" packages (i.e. packages that should always be available in Debian systems). this option defaults toperl,perl-baseβ it's used to check for module dependencies. if a needed module is in thebasepkgs, it won't be mentioned in thedepends:field ofdebian/control.
if this option is specified, the above mentioned default packages will not be included (but will be mentioned as explicit dependencies in the resulting package). you can, of course, mention your own modules and explicitly specify the default values.
β οΈ note that this option should be used sparingly and with care, as it might lead to packages not being rebuildable because of unfulfilled dependencies. be careful bestie.
--bdependsBUILD-DEPENDS β manually specify a string to be added to the module's build-dependencies (that is, the packages and their versions that have to be installed in order to successfully build the package). keep in mind that packages generated bydh-make-perlrequire debhelper to be specified as a build dependency. same note as for--dependsapplies here β use only when needed.--bdependsiBUILD-DEPENDS-INDEP β manually specify a string to be added to the module's build-dependencies for architecture-independent builds. same notes as those for the--dependsand--bdependsoptions apply here.--buildβ builds the binary package (i.e. the.debfile) after setting the package directory up.
π¨ NB: this builds only a binary package (by calling fakeroot debian/rules binary) and does not sign the package. it's meant for a quick local install of a package, not for creating a package ready for submission to the Debian archive.
--build-scriptpath β use the specified script for building the binary package. the script is run in the working directory, where thedebian/directory is, with no arguments. the result of the build process is expected to appear in the parent directory.--build-sourceβ builds the source package (i.e. the.dscand.debian.tar.gzfiles) after setting the package directory up.
π¨ NB: this builds only a source package (by calling dpkg-source -b) and does not sign the package. it's meant for a quick local install of a source package to be thrown into e.g. a pbuilder, not for creating a source package ready for submission to the Debian archive.
--closesITPBUG β manually specify the ITP bug number that this package closes. if it's not given,dh-make-perlwill try to connect tobugs.debian.orgto fetch the appropriate bug number, using WWW::Mechanize.--core-okβ allows building core Perl modules. by default,dh-make-perlwill not allow building a module that is shipped as part of the standard Perl library; by specifying this option,dh-make-perlwill build them anyway.
β οΈ note that, although it is not probable, this might break unrelated items in your system β if a newer version of a core module breaks the API, all kinds of daemons might get upset ;-)
--cpanMODULE|DIST β instructsdh-make-perlto fetch and extract the given CPAN module or distribution. works both withFoo::BarandFoo-Bar. π--cpan-mirrorMIRROR β specifies a CPAN site to use as mirror.--data-dirDIRECTORY β use another data directory, instead of the default,/usr/share/dh-make-perl.
data directory is where dh-make-perl looks for its default rules.* templates. it's similar to --config-dir, but does not change the location of the APT Contents cache file. if both are given, --config-dir takes precedence.
--dependsDEPENDS β manually specify a string to be added to the module's dependencies. this should be used when building modules wheredh-make-perlcannot guess the Perl dependencies (such as modules built using Module::Install), or when the Perl code depends on non-Perl binaries or libraries. usually,dh-make-perlwill figure out the dependencies by itself. if you need to passdh-make-perldependency information, you must do it using the debian package format. i.e.
dh-make-perl --depends libtest-more-perl
if you need to override the detection and specify the full dependency list by hand, use --force-depends.
--descSHORT DESCRIPTION β uses the argument to--descas short description for the package.--dhVERSION β set desired debhelper compatibility level. the default is 13.
since version 0.77, dh-make-perl only supports debhelper compatibility levels >=8.
see debhelper(1).
--distDISTRIBUTION β limit the distributions whoseContentsfiles are parsed. the argument is a distribution name.
default: empty, meaning no filtering.
example:
dh-make-perl --dist etch
--email|-eEMAIL β manually specify the Maintainer email address to use indebian/controland indebian/changelog.--exclude|-i[REGEX] β this allows you to specify a PCRE to exclude some files from the search for docs and stuff like that. if no argument is given (but the switch is specified β not specifying the switch will include everything), it defaults to dpkg-source's default values.--force-dependsSTRING β completely override detected run-time dependencies, replacing them with the given STRING. no cap, full override. π₯--guess-nocheck|--no-guess-nocheckβ this adds<!nocheck>to the build-time dependencies where appropriate. uses a hardcoded list with exceptions so it is not turned on by default.
default: --no-guess-nocheck
--installβ installs the freshly built package. specifying--installimplies--buildβ the package will not be installed unless it was built (obviously ;-) )--install-depsβ install all dependencies for the module, as long as those dependencies are available as Debian packages.--install-build-depsβ install dependencies required for building the module, as long as those dependencies are available as Debian packages.--install-with apt|apt-get|aptitude|dpkgβ okay so when--installis in the mix, this is the tool that actually does the installing. The default isapt. Mix and match as you please. β¨--intrusiveβ when it's working out module dependencies andModule::Dependsfails, it goes "bet" and tries again withModule::Depends::Intrusive. And bestieβ¦M:D:Iloads all the.pmfiles, intercepting the loading of other modules, which is effectively running untrusted code on your behalf. Use with caution. Like, for real, tread carefully here. π--networkβ enables querying of Debian WNPP lists for ITP and similar bugs. It's on by default, so pass"--no-network"to switch it off. π--notestβ girlyβ¦ this option, the one for not running the automatic testing of the module as part of the build script, was removed in 0.54. So please putnocheckin theDEB_BUILD_OPTIONSenvironment variable if you want to skip the tests when building a package. That's the move now. π«π--config-dir DIRECTORYβ where the configuration files are stored. This one takes precedence over--home-dir.
Default: ~/.dh-make-perl (if present), $XDG_CONFIG_HOME/dh-make-perl, ~/.config/dh-make-perl
--cache-dir DIRECTORYβ where APT Contents and other caches are stored. This option also has precedence over--home-dir.
Default: ~/.dh-make-perl (if present), $XDG_CACHE_HOME/dh-make-perl, ~/.cache/dh-make-perl
--home-dir DIRECTORYβ the legacy option that specifies both the config and cache directories in one go. See--config-dirand--cache-dir. Lowkey the old way but it still works. π--packagename | -p PACKAGENAMEβ you get to manually specify the Package Name. Super useful when the module has dashes in its name and the vibes get confusing.--pkg-perlβ useful when you're preparing a package for the Debian Perl Grouphttps://perl-team.pages.debian.net/. π
Sets "Maintainer", "Uploaders", "Vcs-Git" and "Vcs-Browser" fields in debian/control accordingly. Also, when "--vcs git" is used (the default), it sets up a Git remote pointing to the right place on salsa.debian.org.
--recursiveβ only valid in"make"mode with--cpanor directory arguments. It makes dh-make-perl try to create packaging (and maybe build and install the packages too, if--buildand--installare also given) for any dependencies which are missing packages.
The way this works: when the 'main' package is constructed, any missing packages get dropped into a list, and then the "debianisation" procedure is run in turn on each of them, recursively. It's giving infinite loop but, like, the helpful kind. π
--requiredepsβ fail if a dependency Perl package was not found. No missing deps allowed, periodt. β--revision REVISIONβ specifies the debian revision of the resulting package.
Useful when you want to let dh-make-perl discover the ustream version, but still enforce a specific debian revision, e.g. when backporting.
Overridden by --version.
--source-format formatβ when creating or refreshing packaging, use the specified source format. Defaults to"3.0 (quilt)". She's classic. πΈ--vcs VCSβ in--pkg-perlmode, use the specified version control system in the generatedVcs-*fields. The default is"git".
If VCS is "git", "dh-make-perl" will setup a Git repository with three branches:
upstream/latestβ the initial branch containing upstream sourcesdebian/latestβ the branch where packaging is done, forked off"upstream/latest"and with the contents of the"debian/"directory added.pristine-tarβ a branch to keep pristine-tar(1) data.
If --pkg-perl is also given, an "origin" remote is added pointing to the repository on salsa.debian.org. Very main character of it. π
--verbose | --no-verboseβ print additional information while processing.
--verbose is on by default in "make" mode, off otherwise. π£οΈ
--version VERSIONβ specifies the upstream version of the resulting package. Usually it's calculated correctly, but--versioncan override wrong guesses.
Note that this is just the upstream version and is also used for the tag in the "upstream" branch. If you need to also specify the Debian revision, use --revision.
π«Ά DEPENDENCY RESOLUTION π«Ά
For mapping upstream build, test, and runtime requirements to build and runtime dependencies on Debian packages, dh-make-perl can use APT's Contents files, if apt-file(1) is installed, and additionally /var/lib/dpkg/available, using libdpkg-perl. It will find your deps, trust. π¦
π FILES π
The following directories will be searched to find additional files required by dh-make-perl:
/usr/share/dh-make-perl/
$HOME/.dh-make-perl/
dh-make-perl.conf
User configuration. The file is in YAML format. The keys are option names, as documented in "OPTIONS" (without leading --).
See the output of dh-make-perl --dump-config, which can also be used for population of dh-make-perl.conf. Handy bestie behavior honestly. π
π ENVIRONMENT π
HOME- get user's home directoryDEBFULLNAME- get the real name of the maintainerLOGNAMEorUSER- get the usernameDEBEMAILorEMAIL- get the email address of the user
π BUGS π
Several, let me know when you find them. π
π AUTHOR π
Paolo Molaro <lupus@debian.org> (MIA)
Maintained for a time by Ivan Kohler <ivan-debian@420.am>.
Maintained for a time by Marc Brockschmidt <marc@dch-faq.de>.
Maintained for a time by Gunnar Wolf <gwolf@gwolf.org>.
Now team-maintained by the Debian Perl Group, https://salsa.debian.org/perl-team/modules/packages/dh-make-perl
Patches from:
Adam Sjoegren <asjo@koldfront.dk>Adrian Phillips <adrianp@powertech.no>Amos Shapira <amos.shapira@gmail.com>Ansgar Burchardt <ansgar@debian.org>Axel Beckert <abe@debian.org>CarnΓ« Draug <carandraug+dev@gmail.com>Christian Kurz <shorty@debian.org>Christopher Hoskin <mans0954@debian.org>Damyan Ivanov <divanov@creditreform.bg>David Paleino <d.paleino@gmail.com>David Pashley <david@davidpashley.com>Dima Kogan <dima@secretsauce.net>Edward Betts <edward@debian.org>Fermin Galan <galan@dit.upm.es>Geoff Richards <qef@ungwe.org>Gergely Nagy <algernon@bonehunter.rulez.org>gregor herrmann <gregoa@debian.org>Hilko Bengen <bengen@debian.org>Kees Cook <keex@outflux.net>Jesper Krogh <jesper@krogh.cc>Johnny Morano <jmorano@moretrix.com>Juerd <juerd@ouranos.juerd.net>Marc Chantreux <mc@unistra.fr>Matt Hope <dopey@debian.org>Matthew Gabeler-Lee <cheetah@fastcat.org>Maximilian Gass <mxey@cloudconnected.org>Noel Maddy <noel@zhtwn.com>Oleg Gashev <oleg@gashev.net>Oliver Gorwits <oliver.gorwits@oucs.ox.ac.uk>Paul Fenwick <pjf@perltraining.com.au>Peter Flanigan <Support@RoxSoft.co.uk>Peter Moerch <mn3k66i02@sneakemail.com>Peter Pentchev <roam@ringlet.net>Ryan Niebur <ryanryan52@gmail.com>Salvatore Bonaccorso <carnil@debian.org>Stephen Oberholtzer <oliverklozoff@gmail.com>Tim Retout <diocles@debian.org>Ton Nijkes <tonn@wau.mis.ah.nl>
... And others who, sadly, we have forgot to add :-/ π
okay love u, that's the whole page!! π«Ά this one shipped as perl v5.40.1, dated 2026-05-08, and it lives at DH-MAKE-PERL(1p). go make some packages bestie, you got this ππΈβ¨
π¦ where this page comes from
- ubuntu stonking: dh-make-perl 0.133 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms