debuild
Build Debian packages from source code
TLDR
Build the package in the current directory
Build a binary package only
Do not run lintian after building the package
SYNOPSIS
debuild [dpkg-buildpackage-options] [debuild-options]
PARAMETERS
-b
Build binary packages only. This option is passed directly to dpkg-buildpackage.
-S
Build source packages only. This option is passed directly to dpkg-buildpackage.
-sa
Build source and binary packages, including the original tarball. Passed to dpkg-buildpackage.
-us
Do not sign the source package (.dsc file).
-uc
Do not sign the .changes file.
-tc
Clean the source tree after building, by invoking debian/rules clean.
-d
Do not check build dependencies. This option is passed to dpkg-buildpackage.
--no-lintian
Do not run lintian after the build process completes (lintian runs by default).
--preserve-env
Preserve environment variables that would otherwise be unset during the build process.
DESCRIPTION
debuild is a powerful front-end for dpkg-buildpackage, designed to streamline the process of building Debian source and binary packages. It automates several crucial steps, including setting up the build environment (e.g., configuring DEB_BUILD_OPTIONS), invoking dpkg-buildpackage with appropriate arguments, and performing post-build actions like signing .dsc and .changes files with gpg. Additionally, it integrates with lintian to perform comprehensive policy compliance checks on the generated packages. This command aims to provide a cleaner and more consistent build experience, ensuring necessary dependencies are met and often initiating the build in a controlled environment. debuild is part of the devscripts package and is widely used by Debian developers and maintainers to prepare packages for upload or local testing.
CAVEATS
Building with debuild requires a properly structured debian/ directory within the source tree. All build dependencies must be installed on the system unless the -d option is used to skip dependency checks. Signing package files requires a configured GPG key and passphrase. lintian warnings or errors, if critical, can be configured to halt the build process based on settings in devscripts.conf.
TYPICAL USAGE WORKFLOW
A common workflow involves navigating into the package source directory (which must contain the debian/ folder) and simply executing debuild. For local testing without cryptographic signing, debuild -us -uc is frequently used. To prepare a source package for upload to the Debian archives, debuild -S is the standard command, which generates a .dsc and .orig.tar.gz (if needed) file, along with a signed .changes file.
ENVIRONMENT AND CONFIGURATION
debuild's behavior can be significantly influenced by various environment variables (e.g., DEB_BUILD_OPTIONS, DEBEMAIL, DEBFULLNAME) and configuration settings found in files like /etc/devscripts.conf or user-specific ~/.devscripts. These allow customization of default build flags, signing preferences, lintian behavior, and other build-time parameters.
HISTORY
debuild is an integral part of the devscripts package, a collection of utilities developed within the Debian project to aid package maintainers. It emerged as a higher-level wrapper for dpkg-buildpackage, providing a more convenient and standardized interface for common packaging tasks. Its development has focused on automating routine steps like cryptographic signing and adherence to Debian policy checks, evolving continuously with Debian's packaging standards and best practices.