SBUILD-DEBUILD(1)

NAME
sbuild-debuild - build debian packages from source in debuild-like manner

SYNOPSIS
sbuild-debuild [-h|--help | -V|--version] [--dpkg-buildpackage-opts string] [--dpkg-buildpackage-extra-opts string] [--sbuild-opts string] [--sbuild-extra-opts string] [--lintian-opts string] [--lintian-extra-opts string] [--no-lintian] [--pre-dpkg-buildpackage-commands string] [--pre-sbuild-commands string] [--pre-lintian-commands string] [--pre-exit-commands string] [PACKAGE1[.dsc] [PACKAGE2[.dsc] [PACKAGEn[.dsc]]]]

DESCRIPTION
sbuild-debuild rebuilds Debian binary packages from the corresponding Debian source in a manner similar to debuild.

sbuild-debuild is given a list of packages to process as the arguments PACKAGEi[.dsc]. These arguments are in the form of either debianized package source directories or a .dsc file.

For arguments given as source directories, dpkg-buildpackage is first run to produce a source .dsc file. Then, the package is built using the .dsc produced. For arguments given as .dsc files, running dpkg-buildpackage is skipped altogether. If no arguments are given, sbuild-debuild acts on the current working directory as a source directory to process.

Before a package is built, sbuild-debuild first changes into the directory where the corresponding .dsc file resides.

After a successful build, if lintian is installed on the system, lintian is run on the resulting .changes file produced after a build.

In between each run of dpkg-buildpackage, sbuild, and lintian for a package, a list of commands can be run, similar to running hooks, except that arguments can be given and "special" keywords can be given as an argument to these commands to have sbuild-debuild convert them into various arguments. See the section EXTERNAL COMMANDS for more on this.

The exit status from sbuild-debuild is either 0 or 1. When a package is processed, if dpkg-buildpackage, sbuild, or lintian fails, processing of that package is stopped immediately and processing of the next package is started instead. For external commands, if an external command fails, the next external command is run but processing of a package is not halted. If at any point the processing of a package failed or an external command failed, sbuild-debuild is marked to exit with value 1 (i.e. failure), otherwise it exits with value 0 (i.e. success).

OPTIONS

-h, --help
    Display this manual.

-V, --version
    Print version information.

--dpkg-buildpackage-opts string
    Override the default options passed to dpkg-buildpackage.
    Default is "-S -us -uc".

--dpkg-buildpackage-extra-opts string
    Supply extra options to dpkg-buildpackage.

--sbuild-opts string
    Override the default options passed to sbuild.
    Default is no options are given.

--sbuild-extra-opts string
    Supply extra options to sbuild.

--lintian-opts string
    Override the default options passed to lintian.
    Default is no options are given.

--lintian-extra-opts string
    Supply extra options to lintian.

--no-lintian
    Do not run lintian.

--pre-dpkg-buildpackage-commands string
    String of command to run before running dpkg-buildpackage.
    This option can be supplied multiple times to add more commands.

--pre-sbuild-commands string
    String of command to run before running sbuild.
    This option can be supplied multiple times to add more commands.

--pre-lintian-commands string
    String of command to run before running lintian.
    This option can be supplied multiple times to add more commands.

--pre-exit-commands string
    String of command to run before ending the processing of a package.
    This option can be supplied multiple times to add more commands.

CONFIG FILES

/etc/sbuild/sbuild-debuild.conf
    Configuration, maintained by the system administrator. This may be used to override the defaults.

~/.sbuild-debuildrc
    User-specific configuration.

EXTERNAL COMMANDS
Support to run external commands during an sbuild-debuild run is provided. A set of external commands can be run before running dpkg-buildpackage, before running sbuild, before running lintian, and before ending processing of a package. Providing commands to run is done through the --pre-*-commands options given on the command line and through the use of the configuration files. In the configuration file, the list of commands to run are placed in an array of strings corresponding to the commands to run.

Here's an example of how to edit the configuration files to run "foo" and "bar" with arguments before dpkg-buildpackage is run.

$pre_dpkg_buildpackage_commands = ['foo arg1 arg2',
'bar arg1 arg2 arg3',
];

Here's an example of how to do the same with the previous example, except using the --pre-dpkg-buildpackage-commands option.

$ sbuild-debuild \
--pre-dpkg-buildpackage-commands 'foo arg1 arg2' \
--pre-dpkg-buildpackage-commands 'bar arg1 arg2 arg3'

Besides running external commands, sbuild-debuild can also detect the use of certain keywords given as arguments. These keywords are used to allow for a command to be supplied with a certain argument depending on the keyword given. For example, it could be possible to have an external command be given the path to a .changes file.

Here is a listing of keywords and a description of what it's converted to.

@SBUILD_DEBUILD_DSC@
    This keyword is converted to the absolute path to a package's .dsc file.

@SBUILD_DEBUILD_SOURCE_CHANGES@
    This keyword is converted to the absolute path to a package's source .changes file.

@SBUILD_DEBUILD_BIN_CHANGES@
    This keyword is converted to the absolute path to a package's .changes file depending on architecture.

Here's an example of using a keyword to run piuparts on a .changes file before the processing of a package ends.

$ sbuild-debuild --pre-exit-commands \
'piuparts @SBUILD_DEBUILD_BIN_CHANGES@'

One final note, external commands are processed in the order they are given. Also, the commands given in a configuration file are processed first, then the commands given through the command line options.

AUTHORS
Andres Mejia.

COPYRIGHT
Copyright © 2009      Andres Mejia <mcitadel@gmail.com>