dpkg-buildpackage

Debian package build tool

TLDR

Build package
$ dpkg-buildpackage
Build unsigned
$ dpkg-buildpackage -us -uc
Build binary only
$ dpkg-buildpackage -b
Build source only
$ dpkg-buildpackage -S
Build with parallelism
$ dpkg-buildpackage -j[4]
Build without cleaning
$ dpkg-buildpackage -nc
Specify key for signing
$ dpkg-buildpackage -k[keyid]

SYNOPSIS

dpkg-buildpackage [options]

DESCRIPTION

dpkg-buildpackage builds Debian packages from source. It orchestrates the full build process including extracting source, running the build system, and creating .deb files.The tool handles dependencies, runs debian/rules targets, calls dpkg-source for source packages, and dpkg-genchanges for upload files. It's the standard way to build Debian packages.

PARAMETERS

-b

Binary-only build.
-S
Source-only build.
-F
Full build (source and binary).
-us
Don't sign source package.
-uc
Don't sign changes file.
-j n
Parallel jobs.
-nc
Don't clean before build.
-tc
Clean after build.
-k keyid
GPG key for signing.
-r cmd
Use cmd to gain root.
-d
Don't check dependencies.
--build= type
Specify build type.

INSTALL

sudo dnf install dpkg-dev
sudo apk add dpkg-dev

CAVEATS

Requires build dependencies installed. Signing needs GPG key. Must run in package source directory. Clean environment recommended for reproducible builds.

HISTORY

dpkg-buildpackage is part of the dpkg suite, the core of Debian package management since 1994. It has evolved with Debian's packaging practices, adding features for source formats, signing, and cross-compilation over the years.

SEE ALSO

dpkg(1), dpkg-deb(1), debuild(1), pbuilder(1)