Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   debhelper    ( 7 )

набор инструментов debhelper (the debhelper tool suite)

Окружение (Environment)

This section describes some of the environment variables that influences the behaviour of debhelper or which debhelper interacts with.

It is important to note that these must be actual environment variables in order to affect the behaviour of debhelper (not simply Makefile variables). To specify them properly in debian/rules, be sure to "export" them. For example, "export DH_VERBOSE".

DH_VERBOSE Set to 1 to enable verbose mode. Debhelper will output every command it runs. Also enables verbose build logs for some build systems like autoconf.

DH_QUIET Set to 1 to enable quiet mode. Debhelper will not output commands calling the upstream build system nor will dh print which subcommands are called and depending on the upstream build system might make that more quiet, too. This makes it easier to spot important messages but makes the output quite useless as buildd log. Ignored if DH_VERBOSE is also set.

DH_COMPAT Temporarily specifies what compatibility level debhelper should run at, overriding any value specified via Build- Depends on debhelper-compat or via the debian/compat file.

DH_NO_ACT Set to 1 to enable no-act mode.

DH_OPTIONS All debhelper tools will parse command line arguments listed in this variable before any command option (as if they had been prepended to the command line arguments). Unfortunately, some third-party provided tools may not support this variable and will ignore these command line arguments.

When using dh(1), it can be passed options that will be passed on to each debhelper command, which is generally better than using DH_OPTIONS.

DH_ALWAYS_EXCLUDE If set, this adds the value the variable is set to to the -X options of all commands that support the -X option. Moreover, dh_builddeb will rm -rf anything that matches the value in your package build tree.

This can be useful if you are doing a build from a CVS source tree, in which case setting DH_ALWAYS_EXCLUDE=CVS will prevent any CVS directories from sneaking into the package you build. Or, if a package has a source tarball that (unwisely) includes CVS directories, you might want to export DH_ALWAYS_EXCLUDE=CVS in debian/rules, to make it take effect wherever your package is built.

Multiple things to exclude can be separated with colons, as in DH_ALWAYS_EXCLUDE=CVS:.svn

DH_EXTRA_ADDONS If set, this adds the specified dh addons to be run in the appropriate places in the sequence of commands. This is equivalent to specifying the addon to run with the --with flag in the debian/rules file. Any --without calls specifying an addon in this environment variable will not be run.

This is intended to be used by downstreams or specific local configurations that require a debhelper addon to be run during multiple builds without having to patch a large number of rules file. If at all possible, this should be avoided in favor of a --with flag in the rules file.

DH_COLORS, DPKG_COLORS These variables can be used to control whether debhelper commands should use colors in their textual output. Can be set to "always", "auto" (the default), or "never".

Note that DPKG_COLOR also affects a number of dpkg related tools and debhelper uses it on the assumption that you want the same color setting for dpkg and debhelper. In the off- hand chance you want different color setting for debhelper, you can use DH_COLORS instead or in addition to DPKG_COLORS.

NO_COLOR If no explicit request for color has been given (e.g. DH_COLORS and DPKG_COLORS are both unset), the presence of this environment variable cause the default color setting to be "never".

The variable is defined according to <https://no-color.org/>. In this project, the environment variables (such as DH_COLORS) are considered an explicit request for color.

CFLAGS, CPPFLAGS, CXXFLAGS, OBJCFLAGS, OBJCXXFLAGS, GCJFLAGS, FFLAGS, FCFLAGS, LDFLAGS By default (in any non-deprecated compat level), debhelper will automatically set these flags by using dpkg-buildflags(1), when they are unset. If you need to change the default flags, please use the features from dpkg-buildflags(1) to do this (e.g. DEB_BUILD_MAINT_OPTIONS=hardening=all or DEB_CPPFLAGS_MAINT_APPEND=-DCUSTOM_MACRO=true) rather than setting the concrete variable directly.

HOME, XDG_* In compat 13 and later, these environment variables are reset before invoking the upstream build system via the dh_auto_* helpers. The variables HOME (all dh_auto_* helpers) and XDG_RUNTIME_DIR (dh_auto_test only) will be set to a writable directory. All remaining variables and XDG_RUNTIME_DIR (except for during dh_auto_test) will be cleared.

The HOME directory will be created as an empty directory but it will be reused between calls to dh_auto_*. Any content will persist until explicitly deleted or dh_clean.

DEB_BUILD_OPTIONS Please see "Supported flags in DEB_BUILD_OPTIONS" for this environment variable.

Please note that this variable should not be altered by package maintainers inside debian/rules to change the behaviour of debhelper. Instead, where the package maintainer need these features, they should look disabling the relevant feature directly (e.g. by overriding the concrete tools).

DEB_MAINT_BUILD_OPTIONS This is a dpkg specific environment variable (see e.g. dpkg-buildflags(1)). The debhelper tool suite silently ignores it.

It is documented here because it has a similar name to DEB_BUILD_OPTIONS, which make some people mistakenly assume that debhelper will also react to this variable.

Supported flags in DEB_BUILD_OPTIONS The debhelper tool suite reacts to the following flags in DEB_BUILD_OPTIONS.

dherroron=obsolete-compat-levels This is a debhelper specific value.

When dherroron is present and set to obsolete-compat-levels, then debhelper tools will promote deprecation warnings for usage of old soon to be removed compat levels into errors.

This is useful for automated checking for code relying on deprecated compat levels that is scheduled for removal.

This option is intended for testing purposes; not production builds.

nostrip This value will change the content of the debs being built. The .deb packages built when this is set is therefore not bit-for-bit reproducible with a regular build in the general case.

This value will cause the official debhelper tools will skip actions and helpers that either remove, detach or deduplicate debugging symbols in ELF binaries.

This value affects dh_dwz(1) and dh_strip(1).

nocheck This value will cause the official debhelper build systems to skip runs of upstream test suites.

Package maintainers looking to avoid running the upstream tests should not rely on this. Instead, they can add an empty override target to skip dh_auto_test.

This value affects dh_auto_test(1).

nodoc This value will change the content of the debs being built. The .deb packages built when this is set is therefore not bit-for-bit reproducible with a regular build in the general case.

This value will cause several debhelper tools to skip installation of documentation such as manpages or upstream provided documentation. Additionally, the tools will also ignore if declared documentation is "missing" on the assumption that the documentation has not been built.

This value effects tools like dh_installdocs(1), which knows it is working with documentation.

noautodbgsym, noddebs The official name is autodbgsym. The noddebs variant is accepted for historical reasons.

This value causes debhelper to skip the generation of automatically generated debug symbol packages.

This value affects dh_strip(1).

parallel=N This value enables debhelper to use up to N threads or processes (subject to parameters like --no-parallel and --max-parallel=M). Not all debhelper tools work with parallel tasks and may silently ignore the request.

This value affects many debhelper tools. Most notably dh_auto_*, which will attempt to run the underlying upstream build system with that number of threads.

terse This value will cause the official debhelper build systems to configure upstream builds to be terse (i.e. reduce verbosity in their output). This is subject to the upstream and the debhelper build system supporting such features.

This value affects most dh_auto_* tools.

Unknown flags are silently ignored.

Note third-party debhelper-like tools or third-party provided build systems may or may not react to the above flags. This tends to depend on implementation details of the tool.