Check-Script: debhelper
Author: Joey Hess <joeyh@debian.org>
Abbrev: dh
Type: source
Info: This looks for common mistakes in debhelper source packages.
Needs-Info: debfiles

Tag: maintainer-script-lacks-debhelper-token
Severity: normal
Certainty: possible
Info: This package is built using debhelper commands that may modify
 maintainer scripts, but the maintainer scripts do not contain
 the "#DEBHELPER#" token debhelper uses to modify them.
 .
 Adding the token to the scripts is recommended.

Tag: package-uses-debhelper-but-lacks-build-depends
Severity: important
Certainty: possible
Info: If a package uses debhelper, it must declare a Build-Depends
 on debhelper.

Tag: package-lacks-versioned-build-depends-on-debhelper
Severity: pedantic
Certainty: certain
Info: The package either doesn't declare a versioned build dependency on
 debhelper or does not declare a versioned build dependency on a new
 enough version of debhelper to satisfy the declared compatibility level.
 .
 Recommended practice is to always declare an explicit versioned
 dependency on debhelper equal to or greater than the compatibility level
 used by the package, even if the versioned dependency isn't strictly
 necessary.  Having a versioned dependency also helps with backports to
 older releases and correct builds on partially updated systems.
Ref: debhelper(7)

Tag: package-needs-versioned-debhelper-build-depends
Severity: minor
Certainty: certain
Info: The package either doesn't declare a versioned build dependency on
 debhelper or does not declare a versioned build dependency on a new
 enough version of debhelper to satisfy the declared compatibility level.
 .
 The required version of debhelper is not guaranteed to be satisfied
 in all supported releases of Debian and therefore this may lead to
 a build failure.
 .
 Recommended practice is to always declare an explicit versioned
 dependency on debhelper equal to or greater than the compatibility level
 used by the package, even if the versioned dependency isn't strictly
 necessary.  Having a versioned dependency also helps with backports to
 older releases and correct builds on partially updated systems.
 .
 Note if you are using a compat level, which is marked as experimental,
 such as compat 9 in debhelper 8.1.3, then please override this tag.
Ref: debhelper(7)

Tag: dh-make-template-in-source
Severity: normal
Certainty: possible
Info: This package contains debian/*.ex and/or debian/ex.* files
 installed by dh_make. These are intended to be filled in with the
 package's details and renamed for use by various debhelper commands.
 If they are not being used, they should be removed.

Tag: dh_suidregister-is-obsolete
Severity: normal
Certainty: certain
Ref: dh_suidregister(1)
Info: suidregister is obsoleted by dpkg-statoverride, so registration of
 files in with dh_suidregister is unnecessary, and even harmful.

Tag: dh_undocumented-is-obsolete
Severity: normal
Certainty: certain
Ref: dh_undocumented(1)
Info: This package calls dh_undocumented in its <tt>debian/rules</tt>
 file.  The dh_undocumented command is obsolete and does nothing, since
 it's former behavior of adding symlinks to the undocumented(7) man page
 is now obsolete.

Tag: dh_python-is-obsolete
Severity: normal
Certainty: certain
Info: This package calls dh_python in its <tt>debian/rules</tt> file.
 dh_python is deprecated and has been replaced by dh_python2.
 .
 dh_python2 is available in Squeeze; if backporting the package to a
 Lenny or older system, please ignore this warning.

Tag: dh_pycentral-is-obsolete
Severity: normal
Certainty: certain
Info: This package calls dh_pycentral in its <tt>debian/rules</tt> file.
 dh_pycentral is deprecated and has been replaced by dh_python2.
 .
 dh_python2 is available in Squeeze; if backporting the package to a
 Lenny or older system, please ignore this warning.
Ref: http://wiki.debian.org/Python/PyCentral2DhPython2

Tag: dh_installmanpages-is-obsolete
Severity: normal
Certainty: certain
Ref: dh_installmanpages(1)
Info: This package calls dh_installmanpages in its <tt>debian/rules</tt> file.
 dh_installmanpages is deprecated in favour of dh_installman.

Tag: dh_desktop-is-deprecated
Severity: normal
Certainty: certain
Ref: dh_desktop(1)
Info: This package calls dh_desktop in its <tt>debian/rules</tt> file.
 dh_desktop is deprecated and no longer does anything.  The setup it used
 to handle is now done with triggers.

Tag: dh_scrollkeeper-is-deprecated
Severity: normal
Certainty: certain
Ref: dh_scrollkeeper(1)
Info: This package calls dh_scrollkeeper in its <tt>debian/rules</tt> file.
 dh_scrollkeeper is deprecated and no longer does anything.  scrollkeeper
 has been replaced by rarian, which does not require the functionality
 dh_scrollkeeper used to provide.

Tag: dh-clean-k-is-deprecated
Severity: normal
Certainty: certain
Ref: dh_clean(1)
Info: This package calls dh_clean -k in its <tt>debian/rules</tt> file
 and declares a debhelper compatibility version of at least 7.
 .
 debhelper 7 deprecated dh_clean -k in favour of dh_prep.

Tag: debhelper-compat-file-is-empty
Severity: important
Certainty: certain
Ref: debhelper(7)
Info: The source package has an empty debian/compat file. This is an error,
 the compat level of debhelper should be in there. Note that only the first
 line of the file is relevant.

Tag: declares-possibly-conflicting-debhelper-compat-versions
Severity: important
Certainty: certain
Ref: debhelper(7)
Info: The source package declares the debhelper compatibility version
 both in the <tt>debian/compat</tt> file and in the <tt>debian/rules</tt>
 file. If these ever get out of synchronisation, the package may not build
 as expected.

Tag: package-uses-deprecated-debhelper-compat-version
Severity: normal
Certainty: certain
Ref: debhelper(7)
Info: The debhelper compatibility version used by this package is marked
 as deprecated by the debhelper developer. You should really consider
 using a newer compatibility version.
 .
 The compatibility version can be set in (preferred)
 <tt>debian/compat</tt> or by setting and exporting DH_COMPAT in
 <tt>debian/rules</tt>.  If it is not set in either place, debhelper
 defaults to the deprecated compatibility version 1.

Tag: debhelper-but-no-misc-depends
Severity: normal
Certainty: possible
Ref: debhelper(7)
Info: The source package uses debhelper, but it does not include
 ${misc:Depends} in the given binary package's debian/control entry.  Any
 debhelper command may add dependencies to ${misc:Depends} that are
 required for the work that it does, so recommended best practice is to
 always add ${misc:Depends} to the dependencies of each binary package if
 debhelper is in use.

Tag: missing-build-dependency-for-dh_-command
Severity: important
Certainty: possible
Info: The source package appears to be using a dh_ command but doesn't build
 depend on the package that actually provides it.  If it uses it, it must
 build depend on it.

Tag: missing-build-dependency-for-dh-addon
Severity: important
Certainty: possible
Info: The source package appears to be using a dh addon but doesn't build
 depend on the package that actually provides it.  If it uses it, it must
 build depend on it.

Tag: debhelper-script-needs-versioned-build-depends
Severity: normal
Certainty: certain
Info: The given debhelper script was introduced in a later version of
 debhelper than the package Build-Depends on.  The package Build-Depends
 should be updated to require that version of debhelper.  Giving the
 version followed by <tt>~</tt> is recommended so that backports will
 satisfy the dependency.
 .
 etch was released with debhelper version 5.0.42, so every package that
 assumes a newer version should explicitly declare so for the sake of
 etch backports.

Tag: debhelper-overrides-need-versioned-build-depends
Severity: normal
Certainty: certain
Ref: dh(1)
Info: The override targets facility in debhelper, involving debian/rules
 targets that begin with "override_dh_", was introduced in a later version
 of debhelper than the package Build-Depends on.  The package Build-Depends
 should be updated to require at least debhelper 7.0.50.  Giving the version
 followed by <tt>~</tt> is recommended so that backports will satisfy the
 dependency.
 .
 lenny was released with debhelper version 7.0.15, so every package that
 assumes a newer version should explicitly declare so for the sake of lenny
 backports.

Tag: debhelper-maintscript-needs-versioned-build-depends
Severity: normal
Certainty: certain
Ref: dh(1)
Info: The maintscript files used by this package was introduced in a later
 version of debhelper than the package Build-Depends on.  The package's
 Build-Depends should be updated to require at least debhelper 8.1.0.
 Giving the version followed by <tt>~</tt> is recommended so that
 backports will satisfy the dependency.
 .
 squeeze was released with debhelper version 8.0.0, so every package that
 assumes a newer version should explicitly declare so for the sake of
 squeeze backports.

Tag: brace-expansion-in-debhelper-config-file
Severity: normal
Certainty: possible
Info: This debhelper config file appears to use shell brace expansion
 (such as <tt>{foo,bar}</tt>) to specify files.  This happens to work due
 to an accident of implementation but is not a supported feature.  Only
 <tt>?</tt>, <tt>*</tt>, and <tt>[...]</tt> are supported.
Ref: debhelper(1)

Tag: weak-dependency-on-misc-depends
Severity: normal
Certainty: possible
Ref: debhelper(7)
Info: The source package declares a weak dependecy on ${misc:Depends} in
 the given binary package's debian/control entry.  A stronger dependency, that
 is one that ensures the package's installation, is required so that the
 additional commands are available to the maintainer scripts when they are run.

Tag: debhelper-compat-not-a-number
Severity: important
Certainty: certain
Ref: debhelper(7)
Info: The debhelper compatibility level specified in
 <tt>debian/compat</tt> is not a number.

Tag: debhelper-compatibility-level-not-a-number
Severity: important
Certainty: possible
Info: The debhelper compatibility level specified in <tt>debian/rules</tt>
 is not a number.  If you're using make functions or other more complex
 methods to generate the compatibility level, write the output into
 <tt>debian/compat</tt> instead of setting DH_COMPAT.  The latter should
 be available for a user to override temporarily.

Tag: temporary-debhelper-file
Severity: important
Certainty: certain
Ref: dh_clean(1)
Info: The package contains temporary debhelper files, which are normally
 removed by <tt>dh_clean</tt>. The most common cause for this is that a
 binary package has been renamed or removed without cleaning the build
 directory first.

Tag: unused-build-dependency-on-cdbs
Severity: normal
Certainty: possible
Info: The package build-depends on cdbs, but does not include any cdbs
 files in <tt>debian/rules</tt>.

Tag: python-depends-but-no-python-helper
Severity: serious
Certainty: possible
Experimental: yes
Info: The source package declares a dependency on ${python:Depends} in the
 given binary package's debian/control entry.  However, debian/rules doesn't
 call any helper that would generate this substitution variable.
 .
 When using debhelper compatibility level below 9, dh will call dh_pysupport by
 default if it's installed, but the build dependency on python-support is still
 necessary.

Tag: python3-depends-but-no-python3-helper
Severity: serious
Certainty: possible
Experimental: yes
Info: The source package declares a dependency on ${python3:Depends} in the
 given binary package's debian/control entry.  However, debian/rules doesn't
 call any helper that would generate this substitution variable.

Tag: package-file-is-executable
Severity: normal
Certainty: certain
Info: The packaging file is marked exectuable.  For control, changelog and
 copyright there is no reason for them to be executable.
 .
 This tag is also emitted if a debhelper file is marked executable without
 using compat level 9, since debhelper does not execute them at lower
 compat levels.

Tag: executable-debhelper-file-without-being-executable
Severity: important
Certainty: possible
Info: The packaging file is marked exectuable, but it does not appear to be
 executable (e.g. it has no #! line).
 .
 If debhelper file is not supposed to be executable, please remove the
 executable bit from it.

Tag: dh-exec-private-helper
Severity: important
Certainty: certain
Info: The packaging file uses dh-exec, but it does not use /usr/bin/dh-exec.
 .
 If running dh-exec with the default set of helpers is not desired,
 use its --with or --without options instead of directly using the
 desired helper.

Tag: package-uses-dh-exec-but-lacks-build-depends
Severity: important
Certainty: possible
Info: If a package uses dh-exec, it must declare a Build-Depends
 on it.

Tag: dh-exec-script-without-dh-exec-features
Severity: normal
Certainty: possible
Info: The package uses dh-exec in at least one of its files, but does
 not use any of the features provided by dh-exec.
 .
 If the features provided by dh-exec is not needed, please remove the
 executable bit, and the dh-exec usage.

Tag: dh-exec-install-not-allowed-here
Severity: important
Certainty: possible
Info: The package uses a dh-exec-install contruct in a non-.install
 file.
 .
 The dh-exec-install constructs are only allowed in dh_install's
 .install files, and nowhere else.

Tag: dh-exec-subst-unknown-variable
Severity: minor
Certainty: wild-guess
Info: The package uses a variable in one of its debhelper config
 files, but the variable is not one known to dpkg-architecture.
 .
 It is recommended to use a known subset of variables. If the package
 needs more than that, and makes sure the variable is exported through
 the build one way or the othern, then this tag can be safely ignored
 or overridden.

Tag: debhelper-compat-file-is-missing
Severity: normal
Certainty: certain
Info: The package uses debhelper but does not ship a compat file.
 This is deprecated and eventaully cause the package to FTBFS.
 .
 Please refer to the dehelper documentation on how to create the
 compat file and the differences between each compat level.
Ref: http://packages.qa.debian.org/d/debhelper/news/20120115T191738Z.html,
 debhelper(7)
