# &command;

&pagename;

1

&pagename;

Build Debian packages in a container

    		       &command;
    		       @BUILD_FLAGS_SYNOPSIS@
    		       SUITE
    		       DIR|DSC_FILE

## Description

Build a Debian package from a directory or source package `*.dsc` file. `debspawn` will create a new container for the respective build using the base image specified, build the package and return build artifacts in the default output directory `/var/lib/debspawn/results/` unless a different location was specified via the `--results-dir` flag.

Downloaded packages that are build dependencies are cached and will be reused on subsequent builds if possible.

You can inject packages into the build environment that are not available in the preconfigured APT repositories by placing them in `/var/lib/debspawn/injected-pkgs/${container-name}`, or in `/var/lib/debspawn/injected-pkgs/` to make a package available in all environments. Internally, `debspawn` will build a transient package repository with the respective packages and add it as a package source for APT.

If you want to debug the package build process, you can pass the `--interact` flag to `debspawn`. This will open an interactive root shell in the build environment post-build, no matter whether the build failed or succeeded. After investigating the issue / building the package manually, the shell can be exited and the user is asked whether `debspawn` should copy back the changes made in the packages' `debian/` directory to the host to make them permanent. Please keep in mind that while interactive mode is enabled, no build log can be created.

## Examples

You can build a package from its source directory, or just by passing a plain `.dsc` file to `&command;`. If the result should be automatically signed, the `--sign` flag needs to be passed too:

    			$ cd ~/packages/hello
    			$ &command; sid --sign

    			$ &command; --arch=i386 cosmic ./hello_2.10-1.dsc

You can also build packages using `git-buildpackage` and `debspawn`. In this case the `--lintian` flag is also used to perform a Lintian static analysis check in the container after build:

    			$ gbp buildpackage --git-builder='debspawn b sid --lintian --sign'

To debug a build issue interactively, the `--interact` flag can be used:

    			$ &command; sid --interact

## Options

@BUILD_FLAGS_ENTRIES@

## Differences to sbuild

On Debian, `sbuild` is the primary tool used for package building, which uses different technology. So naturally, the question is whether the sbuild build environments and the `debspawn` build environments are be identical or at least compatible.

Due to the different technology used, there may be subtle differences between `sbuild` chroots and `debspawn` containers. The differences should not have any impact on package builds, and any such occurrence is highly likely a bug in the package's build process. If you think it is not, please file a bug against Debspawn. We try to be as close to sbuild's default environment as possible, but unfortunately can not make any guarantees.

One way the build environment of `debspawn` differs from Debian's default `sbuild` setup intentionally is in its consistent use of unicode. By default, `debspawn` will ensure that unicode is always available and enabled. If you do not want this behavior, you can pass the `--no-unicode` flag to `&command;` to disable unicode in the tool itself and in the build environment.

## See Also

debspawn-update(1), debspawn-create(1), dpkg-buildpackage(1).

## AUTHOR

This manual page was written by Matthias Klumpp mak@debian.org.