dpkg_build plugin

Dpkg build element

A BuildElement implementation for using dpkg elements

Default Configuration

The dpkg default configuration:
# Dpkg default configurations

variables:

  # build-commands
  rulesfile: "debian/rules"
  prepare-dir: "/bin/chmod +x debian/rules"
  clean: "%{rulesfile} clean"
  build: "%{rulesfile} build"
  binary: "env DH_OPTIONS='--destdir=.' %{rulesfile} binary"

  # install-commands
  #
  # packages' default value will be automatically replaced with
  # defaults calculated from debian/control. Replace this with a
  # space-separated list of packages to have more control over
  # what gets generated.
  #
  # e.g.
  # packages: "foo foo-dev foo-doc"
  #
  packages: <PACKAGES>
  install-packages: |
    for pkg in %{packages}; do
      cp -a debian/${pkg}/* %{install-root}
    done
  clear-debian: |
    rm -r %{install-root}/DEBIAN

  # Set this if the sources cannot handle parallelization.
  #
  # notparallel: True

config:

  # Commands for building the software
  #
  build-commands:
  - |
    %{prepare-dir}
  - |
    %{clean}
  - |
    %{build}
  - |
    %{binary}

  # Commands for installing the software into a
  # destination folder
  #
  install-commands:
  - |
    %{install-packages}
  - |
    %{clear-debian}

  # Commands for stripping debugging information out of
  # installed binaries
  #
  strip-commands:
  - |
    %{strip-binaries}

# Use max-jobs CPUs for building and enable verbosity
environment:
  MAKEFLAGS: -j%{max-jobs}
  V: 1
  DH_VERBOSE: 1
  QUILT_PATCHES: debian/patches

# And don't consider MAKEFLAGS or V as something which may
# effect build output.
environment-nocache:
- MAKEFLAGS
- V
- DH_VERBOSE

Public data

This plugin writes to an element’s public data.

split-rules

This plugin overwrites the element’s split-rules with a list of its own creation, creating a split domain for every package that it detected. e.g.

public:
  bst:
    split-rules:
      foo:
      - /sbin/foo
      - /usr/bin/bar
      bar:
      - /etc/quux

dpkg-data

control

The control file will be written as raw text into the control field. e.g.

public:
  bst:
    dpkg-data:
      foo:
        control: |
          Source: foo
          Section: blah
          Build-depends: bar (>= 1337), baz
          ...

name

The name of the plugin will be written to the name field. e.g.

public:
  bst:
    dpkg-data:
      bar:
        name: foobar

package-scripts

preinst, postinst, prerm and postrm scripts may be written to the package if they are detected. They are written as raw text. e.g.

public:
  bst:
    package-scripts:
      foo:
        preinst: |
          #!/usr/bin/bash
          /sbin/ldconfig
      bar:
        postinst: |
          #!/usr/bin/bash
          /usr/share/fonts/generate_fonts.sh