dpkg-buildpackage
Compile binary and/or source Debian packages from source code. tldr-pages
On Linux
Linux
Compile binary and/or source Debian packages from source code. Normally executed inside a source tree that contains a debian/ directory. Also handles build dependencies, creates files like .buildinfo and .changes, and signs the result if applicable.
Generate source and binary packages
dpkg-buildpackageIdentifyGenerate only binary packages (no source package)
dpkg-buildpackage --build=binaryIdentifyGenerate only the source package (without compiling binaries)
dpkg-buildpackage --build=sourceIdentifyDo not sign the .dsc and .changes files
dpkg-buildpackage --unsigned-source --unsigned-changesIdentifyDo not run clean before compiling
dpkg-buildpackage --no-pre-cleanIdentifyUse fakeroot as the command to gain root privileges during the build
dpkg-buildpackage --root-command=fakerootIdentifyRun a specific debian/rules target
dpkg-buildpackage --rules-target=cleanIdentify