debhelper(7)
β¨ debhelper(7) β¨
okay bestie, welcome to debhelper(7) β this is the page you read when you're leveling up your packaging game, and ngl it is dense. But we're gonna get through it together, fr fr. π
π NAME π
debhelper-compat-upgrade-checklist β the glow-up checklist for every supported debhelper compat level. Basically: "you're on compat what now? okay here's what changes when you move up." π
π¦ SYNOPSIS π¦
This doc is a straight-up upgrade checklist covering all the supported debhelper compat levels. It also justβ¦ lists all the supported debhelper compat levels. Two-for-one, iconic. π
There's also the dh_assistant compat-upgrade-checklist command, which will hand you a checklist tailored to your package, starting from compat 7 and up (requires debhelper/13.25 or later). Its one big catch? Its heuristics are only as accurate as heuristics can be, so double-check its vibe. Peep the docs for dh_assistant(1) if you want the details. π
Wanna know how you even declare a compat level in the first place? That's in "COMPATIBILITY LEVELS" in debhelper(7). Go look, we'll wait. π«Ά
And if you're crawling out of a (now) obsolete compat level, that's a whole different page β go read debhelper-obsolete-compat(7). πͺ¦
πΈ DESCRIPTION πΈ
π Upgrade checklist for supported compatibility levels π
These are the compatibility levels that are available. Buckle up, bestie. π
π v15
This compatibility level is still open for development β use with caution. It's giving "beta era, proceed mindfully." π
Changes from v14 are:
- The single-binary add-on for
dhis no longer implicitly activated by source packages that have a singlePackagestanza indebian/control. If your package needs the short-cuts for single-binary packages, it has to explicitly activate the single-binary add-in. π
You can do that via a Build-Depends on dh-sequence-single-binary.
And any --without single-binary you were passing to dh just to dodge the warning in compat 14? That can now be removed to simplify debian/rules without triggering the warning. Clean-up era. π§Ή
- It is now an error to use package-less versions of debhelper configuration files when there are 2 or more binary packages listed in
debian/control, in most cases. Legacy files should be renamed todebian/package.foo(fromdebian/foo), where package is the first binary package listed indebian/control. π₯
The primary exception to this change are files such as debian/changelog, debian/NEWS, and debian/copyright, where the same file is used for all packages by default. Those cases remain unchanged, no stress there. π
- It is now an error to use a packaging file without the package prefix for
--name, even if the source package only produces one binary package. Example time! Say you had adebian/bar.servicewith this little snippet indebian/rules:
override_dh_installsystemd:
dh_installsystemd -p foo --name bar
Then you need to rename debian/bar.service to debian/foo.bar.service. That's it, that's the fix. π
β v14
This is the recommended mode of operation. Bestie, this is the safe pick. π«Ά
Changes from v13 are:
- The
dh_installmodulestool will now install its configuration files under/usr/lib/modprobe.d/package instead of/etc/modprobe.d. π
Please consider using the "rm_conffile" feature from dh_installdeb(1) to make sure previous modprobe files get properly removed.
Note: Retroactively change indebhelper/14.1β Thedh_installpamcommand had a similar change, which was reverted at the request of the pam maintainer. π So yeah, that one walked back.
- Packages using the
dhsequencer should be aware of these changes: π¨- The order and placement has changed for
dh_strip_nondeterminism,dh_compress, anddh_fixperm. Previously, these three commands were run in the listed order betweendh_installxfontsanddh_missing.
- The order and placement has changed for
Their new placement is after dh_missing (arch:all) or dh_shlibdeps (arch:any) and before dh_installdeb. Additionally, their new order is dh_fixperms, dh_strip_nondeterminism, and then dh_compress. π
This change may require updates to third-party add-ons that use either of these three commands as anchor or to hook targets for any of these commands that made assumptions about the command order. π
Additionally, dh_strip_nondeterminism and dh_compress plus any commands added by third-party add-ons using these as anchors will no longer be able to rely on the mode/ownership normalization by dh_fixperms, which may expose bugs in the form of incorrect mode or ownership in the resulting binary package. π
Please file any such bugs against the relevant tool. Feel free to include the debhelper maintainers in CC. π«Ά
- The tool
dh_installsysusersis now included in the default sequence. This helper tool will process systemd sysusers files. β¨ - The
dh_installalternativestool will now be run afterdh_linkrather than afterdh_installinitramfsin the defaultdhsequence. π - The
dh_dwzcommand has been removed from the default sequence. If it is still desired, adddh-sequence-dwztoBuild-Depends-Archor run it inexecute_before_dh_strip-archwith-ato get the closest emulation of the previous behavior. π οΈ
Note: Thedh_dwzcommand will cause a lot of differences in the generated debug symbols. If you usediffoscopeas part of your compat upgrade checks, you may want to temporarily usedh_dwzto keep the delta reviewable while upgrading and then removedh_dwzafterwards. π
- Use of the
dh_gconfcommand in override and hook targets now causes an error. Thedh_gconfcommand has been a no-op for years and was removed in debhelper 13.4. π It's gone, bestie, let it go. - A new tool called
dh_computeautosubstvarshas been added and is now run immediately beforedh_gencontrol. If you inject commands beforedh_gencontrol(either via hook targets or third-party sequence add-on), consider moving them to afterdh_installdebinstead, as the new tool generally assumes no more changes will occur between it is called anddh_gencontrolis called. π€
Notable exception to this assumption if you have to tweak substvars per <https://lists.debian.org/debian-devel/2024/03/msg00030.html>.
- This item only applies to source packages that have exactly one
Packagestanza indebian/control. π
The dh_auto_install command now unconditionally uses --destdir=debian/tmp by default. The special-case for source packages building a single binary package is now moved to single-binary dh addon. Note, this add-on is activated by default in compat 14 but not in compat 15 (see next bullet item). β οΈ
- This item only applies to source packages that have exactly one
Packagestanza indebian/control. π
The dh sequencer will warn if the single-binary addon is implicitly activated, to warn maintainers of the pending compat 15 change in dh_auto_install. The implicit activation is a transitional feature to reduce the changes of risks with this change. In compat 15, the implicit activation will no longer trigger. π§
Maintainers are urged to either explicitly activate the single-binary addon to preserve the existing behaviour (e.g., by adding dh-sequence-single-binary to Build-Depends), or explicitly passing --destdir to dh_auto_install if used and then passing --without single-binary to dh (the latter to silence the warning). π
The rationale for this change is to avoid "surprises" when adding a second binary package later. Previously, debhelper would silently change behaviour often resulting in empty binary packages being uploaded to the archive by mistake. With the new behaviour, the single-binary addon will detect the mismatch and warn the maintainer of what is about to happen. π
- The
dh_installsystemdusertool will default to enabling systemd user units, start them on installation, restart them on upgrades and stop them on uninstalling the package. Units that should not be started/stopped/restarted automatically should be marked with theRefuseManualStart=yesand/orRefuseManualStop=yesunit directives. π - The
dh_gencontroltool now automatically applies relationship substvars to relevant fields. That means that many substvars such as${misc:Depends}and${shlibs:Depends}no longer need to be explicitly mentioned indebian/control. π€― This applies to any substvar named after a field that the installed version ofdpkgconsiders a relation or dependency-like field (e.g.,${*:Depends},${*:Recommends}). At the time of writing, the list consists of:Pre-DependsDependsRecommendsSuggestsEnhancesConflictsBreaksReplacesProvidesBuilt-UsingStatic-Built-Using
This means that Depends: foo, ${misc:Depends} in debian/control can now be reduced to Depends: foo and Depends: ${misc:Depends}, ${shlibs:Depends} can be removed entirely as examples of how the feature works. π₯
Note that other substvars such as ${binary:Version} are unaffected by this change and should still be used explicitly as necessary. Additionally, for Essential: yes packages that manually promoted ${shlibs:Depends} into Pre-Depends field, dh_shlibdeps will handle this automatically as well (see the next compat item). π
okay so the full deets on this proposal live at <https://lists.debian.org/debian-devel/2024/02/msg00230.html> π and the summary at <https://lists.debian.org/debian-devel/2024/03/msg00030.html> also covers when the substvars actually need tweaking. The most common case? Using the -d option from dpkg-shlibdeps, possibly via dh_shlibdeps.
π¨ Note: this change is gonna cause false-positives from an unfixedlintian(1). Please check <https://bugs.debian.org/1067653> forlintian(1) support for this change.
And finally β and because of implementation details, no less β debhelper also applies this feature to the substvars for these fields:
Commandsβ see #638517 at <https://bugs.debian.org/638517> for what this field is even used for π«Ά
- The
dh_shlibdepstool now defaults to using${shlibs:Pre-Depends}for packages that areEssential: yesπ- Good news tho: because of that
dh_gencontrolchange above, any package usingdh_gencontroldoes not have to do anything at all for this migration. Nothing. Zero. π - Fixed in
debhelper/14.3: there was a bug in the implementation that meant it didn't trigger for compat 14 beforedebhelper/14.3π
- Good news tho: because of that
- When running
dh_auto_install, debhelper-provided build systems now make sure all paths in the destdir have minimal user permissions (chmod -R u+rwX) so you don't get weird permission-denied errors during builds.- Third-party debhelper build systems are recommended to support this too, bestie. You do it by running
$this->ensure_minimal_permissions($destdir) if not compat(13);
in the debhelper Buildsystem code, from your sub install implementation, after the upstream code has been run β¨
- Not using
dh_auto_installand still hitting weird permission-denied errors? Runningchmod -R u+rwX DIRECTORYafter you run the install target from the upstream build system often solves it. - But please π₯Ί take care to check if your package has any special cases for permissions where files or directories for some reason must not have the "user write bit" set. Known cases are
*.alifiles and/etc/sudoers.d, anddh_fixpermswill fix those up by default. - The problem with uncommon permissions has always been there in theory, but it got considerably more visible with
dh_fixpermsrunning later in the sequence as of compat 14, and with the move to remove fakeroot by default (which used to paper over some of these issues). This change is here to mitigate the problem.
- The debhelper configuration files are getting these changes too:
- You now get a warning for using package-less versions of debhelper configuration files when there are 2 or more binary packages listed in
debian/control, in most cases. Legacy files should be renamed todebian/package.foo(fromdebian/foo), where package is the first binary package listed indebian/control.- The primary exception to this change: files such as
debian/changelog,debian/NEWS, anddebian/copyright, where the same file is used for all packages by default. Those cases stay unchanged. The debhelper tool using the files will trigger warnings on usage. - In compat 15 (or later), this is changed to an error π
- For most packages, this one can be fixed by running:
- The primary exception to this change: files such as
- You now get a warning for using package-less versions of debhelper configuration files when there are 2 or more binary packages listed in
apt-get satisfy 'debputy (>= 0.1.73~), debhelper (>= 13.26~)'
debputy migrate-from-dh --migration-target=dh-package-prefixed-config-files
- The only known caveat are architecture specific configuration files (such as
debian/symbols.amd64ordebian/install.amd64).
- You also now get a warning for using a packaging file without the package prefix for
--name, even if the source package only produces one binary package. Example: say you had adebian/bar.servicewith this snippet indebian/rules:
override_dh_installsystemd:
dh_installsystemd -p foo --name bar
Then you need to rename debian/bar.service to debian/foo.bar.service.
- In compat 15 (or later), this is changed to an error.
- For most packages, this item can be fixed by running:
apt-get satisfy 'debputy (>= 0.1.73~), debhelper (>= 13.26~)'
debputy migrate-from-dh --migration-target=dh-package-prefixed-config-files
- The only known caveat are architecture specific configuration files. The debhelper stack does not accept any config files that have architecture restrictions and
--name. Third-party add-ons might, though π
- The default look up rules for
Dh_Libbased tools now assume that configuration files are no longer named (--name) nor support architecture restrictions by default. If you work with a third-party debhelper-like tool and need support for either of these features, please file a bug against the tool asking it to declare its configuration file with the relevant options in itspkgfilecall.- Note that debhelper itself tweaked its rules for most of its tools as well, based on analysis of usage via codesearch.debian.org. If you're relying on a feature like architecture restrictions for a given config file that is no longer supported, please file a feature request for the use-case and it might be restored π₯Ί
- Packages using the cmake build system, listen up π£:
- The cmake buildsystem now passes
-DCMAKE_BUILD_RPATH_USE_ORIGIN=ONtocmake(1) to avoid some reproducibility issues. - The cmake build system now sets the
ASMFLAGSenvironment variable when it is unset andASFLAGSis present. The former name (ASMFLAGS) is the name cmake expects, while the latter (ASFLAGS) is the name thatdpkg-buildpackage(1) uses. - The cmake build systems now use
cmake --installinstead ofmake installin thedh_auto_install(1) call. So any override ofdh_auto_installthat passes extra parameters to the upstream build system should be reviewed π
- The cmake buildsystem now passes
- Packages using the meson build system, same energy:
- The meson build system now passes
--auto-features=enabledto meson. - The meson+ninja build system now use
meson installinstead ofninja installin thedh_auto_install(1) call. Any override ofdh_auto_installthat passes extra parameters to the upstream build system should be reviewed.
- The meson build system now passes
- The
debian/compatfile is no longer accepted as a source for specifying the debhelper compat level. Please review "COMPATIBILITY LEVELS" indebhelper(7) for alternatives. - The tool
dh_installtmpfilesnow runs with--removeon package removal, and--purgeon package purge. systemd v256 is required for the latter. - The
dh_lintiantool no longer accepts architecture specific overrides files for packages withMulti-Arch: sameindebian/control, since these would not be co-installable. Instances affected by this error should migrate tolintian(1) architecture specific overrides. - The third-party
dh_qmldepstool (frompkg-kde-toolspackage) no longer demote detected dependencies. In v13 you get warnings about demotions. You can use the-ddependency field in thedebian/PKG.qmlfilesto get the dependencies end up in the correct dependency field.
β¨ v13 Changes from v12 are: β¨
- The meson+ninja build system now uses
meson testinstead ofninja testwhen running the test suite. Any override ofdh_auto_testthat passes extra parameters to upstream test runner should be reviewed, asmeson testis not command line compatible withninja test. - All debhelper like tools based on the official debhelper library (including
dhand the officialdh_*tools) no longer accepts abbreviated command parameters. And at the very same time,dhnow optimizes out calls to redundantdh_*helpers even when passed long command line options π₯ - The ELF related debhelper tools (
dh_dwz,dh_strip,dh_makeshlibs,dh_shlibdeps) are now only run for arch dependent packages by default (i.e. they are excluded from*-indeptargets and are passed-aby default). If you need them for*-indeptargets, you can add an explicitBuild-Dependsondh-sequence-elf-tools. - The third-party gradle build system (from
gradle-debian-helperpackage) now runs the upstream-provided test suite automatically. To suppress such behavior, overridedh_auto_test. - The
dh_installmantool now aborts if it sees conflicting definitions of a manpage. This typically happens if the upstream build system is installing a compressed version and the package lists an uncompressed version of the manpage indebian/package.manpages. Often the easiest fix is to remove the manpage fromdebian/package.manpages(assuming both versions are identical). - The
dh_auto_*helpers now reset the environment variableHOMEand the commonXDG_*variables. Please see description of the environment variables in "ENVIRONMENT" indebhelper(1) for how this is handled π¦
(still the same bullet, bestie, we're just picking up mid-thought π
) This feature changed between debhelper 13 and debhelper 13.2.
- The
dhcommand will now error out π if an override or hook target for an obsolete command are present indebian/rules(likeoverride_dh_systemd_enable:). So if you've got ghosts of helpers past haunting your rules file, it's gonna yell at you. - The
dh_missingcommand will now default to--fail-missing. If you want the old non-fatal warning vibe back, you can revert it by explicitly passing--list-missing, exactly like it was in compat 12.
And if you don't want the warning either? Just omit the call to dh_missing entirely. Using the dh command sequencer? Then you can do it by inserting an empty override target in the debian/rules file of the relevant package. Example, periodt:
# Disable dh_missing
override_dh_missing:
- The
dhcommand sequencer now runsdh_installtmpfilesin the default sequence. β¨ Thedh_installtmpfilestakes over handling oftmpfiles.dconfiguration files, and the related functionality indh_installsystemdis now disabled.
Lowkey important note: dh_installtmpfiles responds to debian/package.tmpfiles β where dh_installsystemd used a name without the trailing "s". Yes the "s" matters, don't come for me.
- Many
dh_*tools now support limited variable expansion via the${foo}syntax. πͺ In many cases, this can be used to reference paths that contain either spaces ordpkg-architecture(1)values. While this can reduce the need fordh-exec(1)in some cases, it is not a replacement fordh-exec(1)in general. If you need filtering, renaming, etc., the package will still needdh-exec(1).
Please see "Substitutions in debhelper config files" for syntax and available substitution variables. And to all the dh_* tool writers out there: substitution expansion occurs as a part of the filearray and filedoublearray functions. iykyk π«Ά
- The
dhcommand sequencer will now skip all hook and override targets fordh_auto_test,dh_dwzanddh_stripwhenDEB_BUILD_OPTIONSlists the relevantnocheck/nostripoptions.
Any package relying on these targets to always be run should instead move the relevant logic out of those targets. E.g. non-test related packaging code from override_dh_auto_test would have to be moved to execute_after_dh_auto_build or execute_before_dh_auto_install. Relocate, don't cry. π
- The
cmakebuildsystem now passes-DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=ONtocmake(1)to speed up the automatic installation process. If for some reason you need the previous behavior, override the flag like this:
dh_auto_configure -- -DCMAKE_SKIP_INSTALL_ALL_DEPENDENCY=OFF ...
### v12 Changes from v11 are: π
- The
dh_makeshlibstool now generatesshlibsfiles with versioned dependency by default. That means-VUpstream-Version(a.k.a.-V) is now the default. Slay.
If an unversioned dependency in the shlibs file is wanted, you can get it by passing -VNone instead. However, please see dh_makeshlibs(1) for the caveat of unversioned dependencies. Read the docs, bestie, not just the vibes.
- The
-s(--same-arch) option is removed. Please use-a(--arch) instead. - Invoking
dh_clean -know causes an error instead of a deprecation warning. It was giving "hey maybe don't" and now it's giving "absolutely not". π« - The
--no-restart-on-upgradeoption indh_installinithas been removed. Please use the new name--no-stop-on-upgrade. - There was a bug in the
doit(and similar) functions fromDebian::Debhelper::Dh_Libthat made them spawn a shell in one particular circumstance. This bug is now removed and will cause helpers that rely on the bug to fail with a"command not found"-error. π - The
--list-missingand--fail-missingindh_installhas been removed. Please usedh_missingand its corresponding options, which can also see the files installed by other helpers. - The
dh_installinithelper no longer installs configuration for the upstart init system. Instead, it will abort the build if it finds an old upstart configuration file. The error is there to remind the package maintainer to ensure the proper removal of the conffiles shipped in previous versions of the package (if any). It's not being dramatic, it's being helpful. π - The
dh_installdebtool will do basic validation of somedpkg-maintscript-helper(1)commands and will error out if the commands appear to be invalid. - The
dh_missingtool will now default to--list-missing. - The
dh_makeshlibstool will now only pass libraries todpkg-gensymbols(1)if the ELF binary has aSONAME(containing.so). - The
dh_compresstool no longer compresses examples (i.e. anything installed in</usr/share/doc/package/examples>). - The standard sequence in
dhnow includesdh_dwzanddh_installinitramfsby default. π₯ This makes thedwzandinstallinitramfssequences obsolete and they will now fail with an error. If you want to skip these commands, then please insert an empty override target for them indebian/rules(e.g.override_dh_dwz:). - The build systems
mesonandautoconfno longer explicitly set the--libexecdirvariable and thus relies on the build system default β which should be/usr/libexec(per FHS 3.0, adopted in Debian Policy 4.1.5).
If a particular upstream package does not use the correct default, the parameter can often be passed manually via dh_auto_configure(1). E.g. via the following example:
override_dh_auto_configure:
dh_auto_configure -- --libexecdir=/usr/libexec
Note the -- before the --libexecdir parameter. Do not forget the --. The -- is the main character here. π
- Retroactively removed in
debhelper/13.5:
The dh_installdeb tool would no longer install the maintainer provided conffiles file as it was deemed unnecessary. However, the remove-on-upgrade from dpkg/1.20 made the file relevant again and dh_installdeb now installs it again in compat levels 12+.
- The
dh_installsystemdtool no longer relies ondh_installinitfor handling systemd services that have a sysvinit alternative. Both tools must now be used in such a case to ensure the service is properly started under both sysvinit and systemd.
If you have an override for dh_installinit (e.g. to call it with --no-start) then you will probably need one for dh_installsystemd as well now.
This change makes dh_installinit inject a misc:Pre-Depends for init-system-helpers (>= 1.54~). Please ensure that the package lists ${misc:Pre-Depends} in its Pre-Depends field before upgrading to compat 12. Do not skip this step, it's not optional and it's not cute. π€
- The third-party
dh_golangtool (fromdh-golangpackage) now defaults on honoringDH_GOLANG_EXCLUDESvariable for source installation in-devpackages and not only during the building process. Please setDH_GOLANG_EXCLUDES_ALLtofalseto revert to the previous behaviour. SeeDebian::Debhelper::Buildsystem::golang(3pm)for details and examples. dh_installsystemduseris now included in thedhstandard sequence by default. β¨- The
python-distutilsbuildsystem is now removed. Please use the third-party build systempybuildinstead. It's gone, bestie, it's not coming back. π¦
### v11 β This mode is discouraged. π¬
The compat 11 is discouraged for new packages as it suffers from feature interaction between dh_installinit and dh_installsystemd causing services to not run correctly in some cases. Please consider using compatibility mode 10 or 12 instead. More details about the issue are available in Debian#887904 and <https://lists.debian.org/debian-release/2019/04/msg01442.html>.
Changes from v10 are:
dh_installinitno longer installs service or tmpfile files, nor generates maintainer scripts for those files. Please use the newdh_installsystemdhelper.- The
dh_systemd_enableanddh_systemd_starthelpers have been replaced by the newdh_installsystemdhelper. For the same reason, thesystemdsequence fordhhas also been removed. If you need to disable thedh_installsystemdhelper tool, please use an empty override target.
Please note that the dh_installsystemd tool has a slightly different behaviour in some cases (e.g. when using the --name parameter). Slightly different is still different, okay? π
dh_installdirsno longer createsdebian/packagedirectories unless explicitly requested (or it has to create a subdirectory in it).
The vast majority of all packages will be unaffected by this change. You're probably fine. Probably. π
- The
makefilebuildsystem now passesINSTALL="install --strip-program=true"tomake(1). Derivative buildsystems (e.g.configureorcmake) are unaffected by this change. - The
autoconfbuildsystem now passes--runstatedir=/runto./configure. - The
cmakebuildsystem now passes-DCMAKE_INSTALL_RUNSTATEDIR=/runtocmake(1). dh_installmanwill now prefer detecting the language from the path name rather than the extension.dh_auto_installwill now only create the destination directory it needs. Previously, it would create the package build directory for all packages. This will not affect packages that only build with debhelper commands, but it may expose bugs in commands not included in debhelper. Snitches get... well, they get exposed bugs. π- The helpers
dh_installdocs,dh_installexamples,dh_installinfo, anddh_installmannow error out if their config has a pattern that does not match anything or reference a path that does not exist.
Known exceptions include building with the nodoc profile, where the above tools will silently permit failed matches where the patterns are used to specify documentation.
- The helpers
dh_installdocs,dh_installexamples,dh_installinfo, anddh_installmannow accept the parameter--sourcedirwith same meaning asdh_install. Furthermore, they now also fall back todebian/tmplikedh_install.
Migration note: A bug in debhelper 11 up to 11.1.5 made dh_installinfo incorrectly ignore --sourcedir. π
- The
perl-makemakerandperl-buildbuild systems no longer pass-I.to perl. Packages that rely on this behavior can often use thePERL5LIBenvironment variable as a substitute. E.g. by addingexport PERL5LIB=.in theirdebian/rulesfile (or similar). - The
PERL_USE_UNSAFE_INCenvironment variable is no longer set bydhor any of thedh_auto_*tools. It was added as a temporary work around to avoid a lot of packages failing to build at the same time.
Note this item will eventually become obsolete as upstream intends to drop support for the PERL_USE_UNSAFE_INC environment variable. When perl drops support for it, then this variable will be removed retroactively from existing compat levels as well. π
- The
dh_makeshlibshelper will now exit with an error ifobjdumpreturns a non-zero exit from analysing a given file. - The
dh_installdocsanddh_installexamplestools may now install most of the documentation in a different path to comply with the recommendation from Debian policyΒ§12.3(since version3.9.7). π
Note that if a given source package only contains a single binary package in debian/control or none of the packages are -doc packages, then this change is not relevant for that source package and you can skip to the next change. π«Ά
By default, these tools will now attempt to determine a "main package for the documentation" (called a doc-main-package from here on) for every -doc package. If they find such a doc-main-package, they will now install the documentation into the path /usr/share/doc/doc-main-package in the given doc package. I.e. the path can change but the documentation is still shipped in the -doc package.
The --doc-main-package option (or, since debhelper/13.28, the X-Doc-Main-Package field) can be used when the auto-detection is insufficient or to reset the path to its previous value if there is a reason to diverge from Debian policy recommendation.
Some documentation will not be affected by this change. These exceptions include the copyright file, changelog files, README.Debian, etc. These files will still be installed in the path /usr/share/doc/package. β¨
- The
dh_stripanddh_shlibdepstools no longer uses filename patterns to determine which files to process. Instead, they open the file and look for anELFheader to determine if a given file is an shared object or anELFexecutable. π
This change may cause the tools to process more files than previously.
π v10 β Changes from v9 are: π
dh_installinitwill no longer installs a file nameddebian/packageas an init script.dh_installdocswill error out if it detects links created with--link-docbetween packages of architecturealland non-allas it breaks binNMUs. π€dh_installdebno longer installs a maintainer-provideddebian/package.shlibsfile. This is now done bydh_makeshlibsinstead.dh_installwmrefuses to create a broken package if no man page can be found (required to register for thex-window-manageralternative).- Debhelper will default to
--parallelfor all buildsystems that support parallel building. This can be disabled by using either--no-parallelor passing--max-parallelwith a value of1. - The
dhcommand will not accept any of the deprecated "manual sequence control" parameters (--before,--after, etc.). Please use override targets instead. π
Retroactively applied to earlier compat levels: dh no longer accepts any of these since debhelper/12.4.
- The
dhcommand will no longer use log files to track which commands have been run. Thedhcommand still keeps track of whether it already ran thebuildsequence and skip it if it did.
The main effects of this are: π
- With this, it is now easier to debug the install or/and binary sequences because they can now trivially be re-run (without having to do a full "clean and rebuild" cycle)
- The main caveat is that
dh_*now only keeps track of what happened in a single override target. When all the calls to a givendh_cmdcommand happens in the same override target everything will work as before.
Example of where it can go wrong:
override_dh_foo:
dh_foo -pmy-pkg
override_dh_bar:
dh_bar
dh_foo --remaining
In this case, the call to dh_foo --remaining will also include my-pkg, since dh_foo -pmy-pkg was run in a separate override target. This issue is not limited to --remaining, but also includes -a, -i, etc. π
- The
dh_installdebcommand now shell-escapes the lines in the maintscript config file. This was the original intent but it did not work properly and packages have begun to rely on the incomplete shell escaping (e.g. quoting file names). - The
dh_installinitcommand now defaults to--restart-after-upgrade. For packages needing the previous behaviour, please use--no-restart-after-upgrade. - The
autoreconfsequence is now enabled by default. Please pass--without autoreconftodhif this is not desirable for a given package - The
systemdsequence is now enabled by default. Please pass--without systemdtodhif this is not desirable for a given package. π₯ - Retroactively removed:
dhno longer creates the package build directory when skipping running debhelper commands. This will not affect packages that only build with debhelper commands, but it may expose bugs in commands not included in debhelper.
This compatibility feature had a bug since its inception in debhelper/9.20130516 that made it fail to apply in compat 9 and earlier. As there has been no reports of issues caused by this bug in those ~5 years, this item have been removed rather than fixed. π
πΈ v9 β Changes from v8 are: πΈ
- Multiarch support. In particular,
dh_auto_configurepasses multiarch directories to autoconf in--libdirand--libexecdir. dhis aware of the usual dependencies between targets indebian/rules. So,"dh binary"will run anybuild,build-arch,build-indep,install, etc targets that exist in the rules file. There's no need to define an explicitbinarytarget with explicit dependencies on the other targets.dh_stripcompresses debugging symbol files to reduce the installed size of-dbgpackages.dh_auto_configuredoes not include the source package name in--libexecdirwhen using autoconf.dhdoes not default to enabling--with=python-supportπ
(Obsolete: As the dh_pysupport tool was removed from Debian stretch. Since debhelper/10.3, dh no longer enables this sequence add-on regardless of compat level)
- All of the
dh_auto_*debhelper programs anddhset environment variables listed bydpkg-buildflags, unless they are already set. dh_auto_configurepassesdpkg-buildflagsCFLAGS,CPPFLAGS, andLDFLAGSto perlMakefile.PLandBuild.PLdh_stripputs separated debug symbols in a location based on theirbuild-id.- Executable debhelper config files are run and their output used as the configuration.
This mode is deprecated.
π¦ v8 β Changes from v7 are: π¦
- Commands will fail rather than warning when they are passed unknown options.
dh_makeshlibswill rundpkg-gensymbolson all shared libraries that it generates shlibs files for. So-Xcan be used to exclude libraries. Also, libraries in unusual locations thatdpkg-gensymbolswould not have processed before will be passed to it, a behavior change that can cause some packages to fail to build.dhrequires the sequence to run be specified as the first parameter, and any switches come after it. Ie, use"dh $@ --foo", not"dh --foo $@".dh_auto_*prefer to use Perl'sModule::Buildin preference toMakefile.PL.
This mode is deprecated. π
π v7 β This mode is deprecated. π
This is the lowest supported compatibility level.
If you are upgrading from an earlier compatibility level, please review debhelper-obsolete-compat(7). π
π SEE ALSO π
debhelper-obsolete-compat(7)β Upgrading from a (now) obsolete compatibility level? This document covers the upgrade checklist up to the earliest supported level. π§debhelper(7)β General information about the debhelper framework. This document also covers how to declare your chosen debhelper compat level.
π«Ά AUTHORS π«Ά
Niels Thykier <niels@thykier.net>
Joey Hess
okay bestie that's a wrap on the whole debhelper(7) saga π this page is version 14.5ubuntu1, dated 2026-09-21, and it lives in section 7 of the manual (yes, that's the debhelper(7) we've been screaming about the entire time πΈ). go forth and package, you absolute icon πβ¨
π¦ where this page comes from
- ubuntu stonking: debhelper 14.5ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms