Skip to content

debian/build

Configure jobs to build Debian binary package (.deb) for this project from a source distribution or Debian source package.

Latest release

latest badge

Description

This component creates multiple jobs, each with a common prefix, that take in a pre-existing upstream source distribution (tarball) or Debian source package, and use dpkg-buildpackage to create a Debian binary package, one for each chosen Debian distribution version (selected by the version codename).

After each build, lintian is executed to produce a GitLab Code Quality report

Usage

include:
  - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>

Inputs

Input Default value Description
stage build The stage to add jobs to
debian_versions [bullseye, bookworm] Debian/Ubuntu versions to build, see Supported versions for details
project_dir "." Project path that contains the relevant debian/ directory
needs [] List of jobs whose artifacts are needed for the Debian build
job_prefix debian_build Prefix to use for job name
add_changelog_entry true Add a changelog entry when building the Debian source package, see Adding changelog entries for more details
dpkg_buildpackage_options "-us -uc" Options to pass to dpkg-buildpackage
lintian_options --pedantic --display-info Options to pass to lintian, see lintianrc for details on using a lintian configuration file.

Notes

Supported versions

The following versions of Debian or Ubuntu are supported, with each using the listed Docker image for the build.

Version Codename debian_version input Docker image
Debian 11 Bullseye bullseye igwn/builder
Debian 11 backports Bullseye (backports) bullseye-backports igwn/builder
Debian 12 Bookworm bookworm igwn/builder
Debian 13 Trixie trixie igwn/builder
Debian 'oldstable' oldstable debian
Debian 'stable' stable debian
Debian 'testing' testing debian
Debian 'unstable' unstable debian
Debian 'experimental' experimental debian
Ubuntu 20.04 Focal Fossa focal ubuntu
Ubuntu 22.04 Jammy Jellyfish jammy ubuntu
Ubuntu 24.04 Noble Numbat noble ubuntu

For each job, the Debian/Ubuntu version for that job is stored in the DEBIAN_VERSION environment variable.

Requires an upstream source distribution or Debian source package

Creating a Debian binary package is only supported when starting from an upstream tarball that contains a debian/ configuration directory, OR a Debian source package (.dsc).

See Examples for examples.

Adding changelog entries

See Adding changelog entries in debian/source for details.

Customisation

Controlling the lintian behaviour

The behaviour of lintian can be controlled in a few different ways (ordered by preference, most recommended to least):

  1. Create a {package.,source/}lintian-overrides file in the debian/ tree for the relevant package. See https://www.debian.org/doc/manuals/maint-guide/dother.en.html#lintian for further details.

  2. Create a .lintianrc file in the project root. See lintian(1) for details of the lintian configuration file syntax.

    If you wish to choose a path other than .lintianrc for the lintian configuration file, pass that in lintian_options:

    include:
      - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>
        inputs:
          lintian_options: "--cfg mylintianrcfile"
    
  3. Pass override arguments via the lintian_options input:

    include:
      - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>
        inputs:
          lintian_options: "--suppress-tags python-script-but-no-python-dep"
    

Examples

Create Debian source and binary packages separately from a Python 'sdist'

include:
  - component: $CI_SERVER_FQDN/computing/gitlab/components/python/sdist@0.1
    inputs:
      stage: source
  - component: git.ligo.org/computing/gitlab/components/debian/source@<VERSION>
    inputs:
      needs: [sdist]
  - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>
    inputs:
      needs: [debian_source]
      debian_versions:
        - bullseye
        - bookworm

Create a Debian binary package directly from a Python 'sdist'

include:
  - component: $CI_SERVER_FQDN/computing/gitlab/components/python/sdist@0.1
    inputs:
      stage: source
  - component: git.ligo.org/computing/gitlab/components/debian/build@<VERSION>
    inputs:
      needs: [sdist]