LinuxCommandLibrary

dh_pysupport

Register Python packages for Debian packaging

SYNOPSIS

dh_pysupport [debhelper options] [--no-pycompile]

PARAMETERS

-p, --package=name
    Limit operation to the named binary package

-i, --indep
    Act on architecture-independent packages only

-a, --arch
    Act on architecture-dependent packages only

-X, --exclude=ITEM
    Exclude files matching shell pattern ITEM from processing

--no-pycompile
    Skip generating pycompile/pypurge calls in maintainer scripts

--dbg-package=package
    Specify the name of the associated debug package

--no-act
    Show what commands would be run without executing them

DESCRIPTION

dh_pysupport is a debhelper program that automates Python support in Debian packages containing Python modules. It generates maintainer scripts (postinst, prerm) to handle byte-compilation using pycompile and pypurge, and registers modules with the pycentral system by scanning for .py files in DEBIAN/python directories or standard locations.

Typically invoked in debian/rules as part of the binary-install or binary target, e.g., dh_pysupport. It supports multiple Python versions based on /usr/share/python/deb-python/pyversions.

Key features include automatic handling of Python version-specific paths and exclusion of specified files. However, dh_pysupport is deprecated since Debian 6 (Squeeze) due to improved alternatives, and was removed in Debian 9 (Stretch). Migrate to dh_python for modern packaging.

CAVEATS

Deprecated and removed from Debian 9+. Does not support Python 3 natively; use dh_python or --with python3 with dh. Limited multiarch support in older versions.

TYPICAL USAGE

Add to debian/rules:
  dh pysupport or manually dh_pysupport in override targets.

Example:
override_dh_auto_install:
  $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
  dh_pysupport -ppython-module

MIGRATION NOTE

Replace with dh $@ --with python or --with python3 in modern debian/compat ≥ 9 setups.

HISTORY

Introduced in debhelper 5 (circa 2006) to comply with Debian Python Policy for versions 2.4/2.5 using pycentral. Deprecated in Debian 6 (Squeeze, 2011) with Python 2.6 transition; replaced by dh-python in Debian 7 (Wheezy, 2013). Fully removed in debhelper 10 (Debian 9, Stretch, 2017).

SEE ALSO

dh_python(1), pycompile(1), pypurge(1), debhelper(7), dh(1)

Copied to clipboard