.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "dpkg-buildpackage 1" .TH dpkg-buildpackage 1 2024-01-19 1.22.3 "dpkg suite" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME dpkg\-buildpackage \- build binary or source packages from sources .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fBdpkg-buildpackage\fR [\fIoption\fR...] .SH DESCRIPTION .IX Header "DESCRIPTION" \&\fBdpkg-buildpackage\fR is a program that automates the process of building a Debian package. It consists of the following steps: .IP \fB1.\fR 4 .IX Item "1." It runs the \fBpreinit\fR hook before reading any source file. It prepares the build environment by setting various environment variables (see \fBENVIRONMENT\fR), runs the \fBinit\fR hook, and calls \&\fBdpkg-source \-\-before\-build\fR (unless \fB\-T\fR or \fB\-\-target\fR has been used). .IP \fB2.\fR 4 .IX Item "2." It checks that the build-dependencies and build-conflicts are satisfied (unless \fB\-d\fR or \fB\-\-no\-check\-builddeps\fR is specified). .IP \fB3.\fR 4 .IX Item "3." If one or more specific targets have been selected with the \fB\-T\fR or \&\fB\-\-target\fR option, it calls those targets and stops here. Otherwise it runs the \fBpreclean\fR hook and calls \fBfakeroot debian/rules clean\fR to clean the build-tree (unless \fB\-nc\fR or \fB\-\-no\-pre\-clean\fR is specified). .IP \fB4.\fR 4 .IX Item "4." It runs the \fBsource\fR hook and calls \fBdpkg-source \-b\fR to generate the source package (if a \fBsource\fR build has been requested with \&\fB\-\-build\fR or equivalent options). .IP \fB5.\fR 4 .IX Item "5." It runs the \fBbuild\fR hook and calls \fBdebian/rules\fR \fIbuild-target\fR, then runs the \fBbinary\fR hook followed by \fBfakeroot debian/rules\fR \&\fIbinary-target\fR (unless a source-only build has been requested with \&\fB\-\-build=source\fR or equivalent options). Note that \fIbuild-target\fR and \fIbinary-target\fR are either \fBbuild\fR and \fBbinary\fR (default case, or if an \fBany\fR and \fBall\fR build has been requested with \fB\-\-build\fR or equivalent options), or \&\fBbuild-arch\fR and \fBbinary-arch\fR (if an \fBany\fR and not \fBall\fR build has been requested with \fB\-\-build\fR or equivalent options), or \&\fBbuild-indep\fR and \fBbinary-indep\fR (if an \fBall\fR and not \fBany\fR build has been requested with \fB\-\-build\fR or equivalent options). .IP \fB6.\fR 4 .IX Item "6." It runs the \fBbuildinfo\fR hook and calls \fBdpkg-genbuildinfo\fR to generate a \fB.buildinfo\fR file. Several \fBdpkg-buildpackage\fR options are forwarded to \&\fBdpkg-genbuildinfo\fR. .IP \fB7.\fR 4 .IX Item "7." It runs the \fBchanges\fR hook and calls \fBdpkg-genchanges\fR to generate a \fB.changes\fR file. The name of the \fB.changes\fR file will depend on the type of build and will be as specific as necessary but not more; the name will be: .RS 4 .IP \fIsource-name\fR\fB_\fR\fIbinary-version\fR\fB_\fR\fIarch\fR\fB.changes\fR 4 .IX Item "source-name_binary-version_arch.changes" for a build that includes \fBany\fR .IP \fIsource-name\fR\fB_\fR\fIbinary-version\fR\fB_\fR\fBall.changes\fR 4 .IX Item "source-name_binary-version_all.changes" otherwise for a build that includes \fBall\fR .IP \fIsource-name\fR\fB_\fR\fIsource-version\fR\fB_\fR\fBsource.changes\fR. 4 .IX Item "source-name_source-version_source.changes." otherwise for a build that includes \fBsource\fR .RE .RS 4 .Sp Many \fBdpkg-buildpackage\fR options are forwarded to \&\fBdpkg-genchanges\fR. .RE .IP \fB8.\fR 4 .IX Item "8." It runs the \fBpostclean\fR hook and if \fB\-tc\fR or \fB\-\-post\-clean\fR is specified, it will call \fBfakeroot debian/rules clean\fR again. .IP \fB9.\fR 4 .IX Item "9." It calls \fBdpkg-source \-\-after\-build\fR. .IP \fB10.\fR 4 .IX Item "10." It runs the \fBcheck\fR hook and calls a package checker for the \&\fB.changes\fR file (if a command is specified in \fBDEB_CHECK_COMMAND\fR or with \fB\-\-check\-command\fR). .IP \fB11.\fR 4 .IX Item "11." It runs the \fBsign\fR hook and signs using the OpenPGP backend (as long as it is not an UNRELEASED build, or \fB\-\-no\-sign\fR is specified) to sign the \&\fB.dsc\fR file (if any, unless \&\fB\-us\fR or \fB\-\-unsigned\-source\fR is specified), the \fB.buildinfo\fR file (unless \fB\-ui\fR, \fB\-\-unsigned\-buildinfo\fR, \&\fB\-uc\fR or \fB\-\-unsigned\-changes\fR is specified) and the \fB.changes\fR file (unless \fB\-uc\fR or \fB\-\-unsigned\-changes\fR is specified). .IP \fB12.\fR 4 .IX Item "12." It runs the \fBdone\fR hook. .SH OPTIONS .IX Header "OPTIONS" All long options can be specified both on the command line and in the \&\fBdpkg-buildpackage\fR system and user configuration files. Each line in the configuration file is either an option (exactly the same as the command line option but without leading hyphens) or a comment (if it starts with a \(oq\fB#\fR\(cq). .IP \fB\-\-build=\fR\fItype\fR 4 .IX Item "--build=type" Specifies the build \fItype\fR from a comma-separated list of components (since dpkg 1.18.5). All the specified components get combined to select the single build type to use, which implies a single build run with a single \fI.changes\fR file generated. Passed to \fBdpkg-genchanges\fR. .Sp The allowed values are: .RS 4 .IP \fBsource\fR 4 .IX Item "source" Builds the source package. .Sp \&\fBNote\fR: When using this value standalone and if what you want is simply to (re\-)build the source package from a clean source tree, using \&\fBdpkg-source\fR directly is always a better option as it does not require any build dependencies to be installed which are otherwise needed to be able to call the \fBclean\fR target. .IP \fBany\fR 4 .IX Item "any" Builds the architecture specific binary packages. .IP \fBall\fR 4 .IX Item "all" Builds the architecture independent binary packages. .IP \fBbinary\fR 4 .IX Item "binary" Builds the architecture specific and independent binary packages. This is an alias for \fBany,all\fR. .IP \fBfull\fR 4 .IX Item "full" Builds everything. This is an alias for \fBsource,any,all\fR, and the same as the default case when no build option is specified. .RE .RS 4 .RE .IP \fB\-g\fR 4 .IX Item "-g" Equivalent to \fB\-\-build=source,all\fR (since dpkg 1.17.11). .IP \fB\-G\fR 4 .IX Item "-G" Equivalent to \fB\-\-build=source,any\fR (since dpkg 1.17.11). .IP \fB\-b\fR 4 .IX Item "-b" Equivalent to \fB\-\-build=binary\fR or \fB\-\-build=any,all\fR. .IP \fB\-B\fR 4 .IX Item "-B" Equivalent to \fB\-\-build=any\fR. .IP \fB\-A\fR 4 .IX Item "-A" Equivalent to \fB\-\-build=all\fR. .IP \fB\-S\fR 4 .IX Item "-S" Equivalent to \fB\-\-build=source\fR. .IP \fB\-F\fR 4 .IX Item "-F" Equivalent to \fB\-\-build=full\fR, \fB\-\-build=source,binary\fR or \&\fB\-\-build=source,any,all\fR (since dpkg 1.15.8). .IP \fB\-\-target=\fR\fItarget\fR[,...] 4 .IX Item "--target=target[,...]" .PD 0 .IP "\fB\-\-target\fR \fItarget\fR[,...]" 4 .IX Item "--target target[,...]" .IP "\fB\-T\fR, \fB\-\-rules\-target=\fR\fItarget\fR[,...]" 4 .IX Item "-T, --rules-target=target[,...]" .PD Calls \fBdebian/rules\fR \fItarget\fR once per target specified, after having setup the build environment (except for calling \&\fBdpkg-source \-\-before\-build\fR), and stops the package build process here (since dpkg 1.15.0, long option since dpkg 1.18.8, multi-target support since dpkg 1.18.16). If \fB\-\-as\-root\fR is also given, then the command is executed as root (see \fB\-\-root\-command\fR). Note that known targets that are required to be run as root do not need this option (i.e. the \fBclean\fR, \fBbinary\fR, \&\fBbinary-arch\fR and \fBbinary-indep\fR targets). .IP \fB\-\-as\-root\fR 4 .IX Item "--as-root" Only meaningful together with \fB\-\-target\fR (since dpkg 1.15.0). Requires that the target be run with root rights. .IP \fB\-si\fR 4 .IX Item "-si" .PD 0 .IP \fB\-sa\fR 4 .IX Item "-sa" .IP \fB\-sd\fR 4 .IX Item "-sd" .IP \fB\-v\fR\fIversion\fR 4 .IX Item "-vversion" .IP \fB\-C\fR\fIchanges-description\fR 4 .IX Item "-Cchanges-description" .IP \fB\-m\fR\fImaintainer-address\fR 4 .IX Item "-mmaintainer-address" .IP \fB\-e\fR\fImaintainer-address\fR 4 .IX Item "-emaintainer-address" .PD Passed unchanged to \fBdpkg-genchanges\fR. See its manual page. .IP \fB\-\-build\-by=\fR\fImaintainer-address\fR 4 .IX Item "--build-by=maintainer-address" .PD 0 .IP "\fB\-\-source\-by=\fR\fImaintainer-address\fR (since dpkg 1.21.10)" 4 .IX Item "--source-by=maintainer-address (since dpkg 1.21.10)" .PD Pass as \fB\-m\fR to \fBdpkg-genchanges\fR. See its manual page. .IP \fB\-\-release\-by=\fR\fImaintainer-address\fR 4 .IX Item "--release-by=maintainer-address" .PD 0 .IP "\fB\-\-changed\-by=\fR\fImaintainer-address\fR (since dpkg 1.21.10)" 4 .IX Item "--changed-by=maintainer-address (since dpkg 1.21.10)" .PD Pass as \fB\-e\fR to \fBdpkg-genchanges\fR. See its manual page. .IP "\fB\-a\fR, \fB\-\-host\-arch\fR \fIarchitecture\fR" 4 .IX Item "-a, --host-arch architecture" Specify the Debian architecture we build for (long option since dpkg 1.17.17). The architecture of the machine we build on is determined automatically, and is also the default for the host machine. .IP "\fB\-t\fR, \fB\-\-host\-type\fR \fIgnu-system-type\fR" 4 .IX Item "-t, --host-type gnu-system-type" Specify the GNU system type we build for (long option since dpkg 1.17.17). It can be used in place of \fB\-\-host\-arch\fR or as a complement to override the default GNU system type of the host Debian architecture. .IP "\fB\-\-target\-arch\fR \fIarchitecture\fR" 4 .IX Item "--target-arch architecture" Specify the Debian architecture the binaries built will build for (since dpkg 1.17.17). The default value is the host machine. .IP "\fB\-\-target\-type\fR \fIgnu-system-type\fR" 4 .IX Item "--target-type gnu-system-type" Specify the GNU system type the binaries built will build for (since dpkg 1.17.17). It can be used in place of \fB\-\-target\-arch\fR or as a complement to override the default GNU system type of the target Debian architecture. .IP "\fB\-P\fR, \fB\-\-build\-profiles=\fR\fIprofile\fR[\fB,\fR...]" 4 .IX Item "-P, --build-profiles=profile[,...]" Specify the profile(s) we build, as a comma-separated list (since dpkg 1.17.2, long option since dpkg 1.18.8). The default behavior is to build for no specific profile. Also sets them (as a space separated list) as the \fBDEB_BUILD_PROFILES\fR environment variable which allows, for example, \fBdebian/rules\fR files to use this information for conditional builds. .IP "\fB\-j\fR, \fB\-\-jobs\fR[=\fIjobs\fR|\fBauto\fR]" 4 .IX Item "-j, --jobs[=jobs|auto]" Specifies the number of jobs allowed to be run simultaneously (since dpkg 1.14.7, long option since dpkg 1.18.8). The number of jobs matching the number of online processors if \fBauto\fR is specified (since dpkg 1.17.10), or unlimited number if \fIjobs\fR is not specified. The default behavior is \fBauto\fR (since dpkg 1.18.11) in non-forced mode (since dpkg 1.21.10), and as such it is always safer to use with any package including those that are not parallel-build safe. Setting the number of jobs to \fB1\fR will restore serial execution. .Sp Will add \fBparallel=\fR\fIjobs\fR or \fBparallel\fR to the \fBDEB_BUILD_OPTIONS\fR environment variable which allows debian/rules files to opt-in to use this information for their own purposes. The \fIjobs\fR value will override the \fBparallel=\fR\fIjobs\fR or \&\fBparallel\fR option in the \fBDEB_BUILD_OPTIONS\fR environment variable. Note that the \fBauto\fR value will get replaced by the actual number of currently active processors, and as such will not get propagated to any child process. If the number of online processors cannot be inferred then the code will fallback to using serial execution (since dpkg 1.18.15), although this should only happen on exotic and unsupported systems. .IP "\fB\-J\fR, \fB\-\-jobs\-try\fR[=\fIjobs\fR|\fBauto\fR]" 4 .IX Item "-J, --jobs-try[=jobs|auto]" This option (since dpkg 1.18.2, long option since dpkg 1.18.8) is equivalent to the \fB\-j\fR above. .Sp Since the behavior for \fB\-j\fR changed in dpkg 1.21.10 to the opt-in mode, you can use this option instead if you need to guarantee semantics across dpkg release series. .IP \fB\-\-jobs\-force\fR[=\fIjobs\fR|\fBauto\fR] 4 .IX Item "--jobs-force[=jobs|auto]" This option (since dpkg 1.21.10) is equivalent to the \fB\-\-jobs\fR option except that it will enable forced parallel mode, by adding the \fBmake\fR \fB\-j\fR option with the computed number of parallel jobs to the \fBMAKEFLAGS\fR environment variable. .Sp This should cause all subsequent make invocations to inherit the option, thus forcing the parallel setting on the packaging (and possibly the upstream build system if that uses \fBmake\fR\|(1)) regardless of their support for parallel builds, which might cause build failures. .Sp \&\fBNote\fR: Any Makefile that is not parallel-safe should be considered to be buggy. These should either be made parallel-safe, or marked as not being safe with the \fBmake\fR\|(1) \fB.NOTPARALLEL\fR target. .IP "\fB\-D\fR, \fB\-\-check\-builddeps\fR" 4 .IX Item "-D, --check-builddeps" Check build dependencies and conflicts; abort if unsatisfied (long option since dpkg 1.18.8). This is the default behavior. .IP "\fB\-d\fR, \fB\-\-no\-check\-builddeps\fR" 4 .IX Item "-d, --no-check-builddeps" Do not check build dependencies and conflicts (long option since dpkg 1.18.8). .IP \fB\-\-ignore\-builtin\-builddeps\fR 4 .IX Item "--ignore-builtin-builddeps" Do not check built-in build dependencies and conflicts (since dpkg 1.18.2). These are the distribution specific implicit build dependencies usually required in a build environment, the so called Build-Essential package set. .IP \fB\-\-rules\-requires\-root\fR 4 .IX Item "--rules-requires-root" Do not honor the \fBRules-Requires-Root\fR field, falling back to its legacy default value (since dpkg 1.19.1). .IP "\fB\-nc\fR, \fB\-\-no\-pre\-clean\fR" 4 .IX Item "-nc, --no-pre-clean" Do not clean the source tree before building (long option since dpkg 1.18.8). Implies \fB\-b\fR if nothing else has been selected among \fB\-F\fR, \&\fB\-g\fR, \fB\-G\fR, \fB\-B\fR, \fB\-A\fR or \fB\-S\fR. Implies \fB\-d\fR with \fB\-S\fR (since dpkg 1.18.0). .IP \fB\-\-pre\-clean\fR 4 .IX Item "--pre-clean" Clean the source tree before building (since dpkg 1.18.8). This is the default behavior. .IP "\fB\-tc\fR, \fB\-\-post\-clean\fR" 4 .IX Item "-tc, --post-clean" Clean the source tree (using \&\fIgain-root-command\fR \&\fBdebian/rules clean\fR) after the package has been built (long option since dpkg 1.18.8). .IP \fB\-\-no\-post\-clean\fR 4 .IX Item "--no-post-clean" Do not clean the source tree after the package has been built (since dpkg 1.19.1). This is the default behavior. .IP \fB\-\-sanitize\-env\fR 4 .IX Item "--sanitize-env" Sanitize the build environment (since dpkg 1.20.0). This will reset or remove environment variables, umask, and any other process attributes that might otherwise adversely affect the build of packages. Because the official entry point to build packages is \fBdebian/rules\fR, packages cannot rely on these settings being in place, and thus should work even when they are not. What to sanitize is vendor specific. .IP "\fB\-r\fR, \fB\-\-root\-command=\fR\fIgain-root-command\fR" 4 .IX Item "-r, --root-command=gain-root-command" When \&\fBdpkg-buildpackage\fR needs to execute part of the build process as root, it prefixes the command it executes with \&\fIgain-root-command\fR if one has been specified (long option since dpkg 1.18.8). Otherwise, if none has been specified, \&\fBfakeroot\fR will be used by default, if the command is present. \&\fIgain-root-command\fR should start with the name of a program on the \&\fBPATH\fR and will get as arguments the name of the real command to run and the arguments it should take. \&\fIgain-root-command\fR can include parameters (they must be space-separated) but no shell metacharacters. \&\fIgain-root-command\fR might typically be \&\fBfakeroot\fR, \fBsudo\fR, \fBsuper\fR or \fBreally\fR. \&\fBsu\fR is not suitable, since it can only invoke the user's shell with \&\fB\-c\fR instead of passing arguments individually to the command to be run. .IP "\fB\-R\fR, \fB\-\-rules\-file=\fR\fIrules-file\fR" 4 .IX Item "-R, --rules-file=rules-file" Building a Debian package usually involves invoking \&\fBdebian/rules\fR as a command with several standard parameters (since dpkg 1.14.17, long option since dpkg 1.18.8). With this option it's possible to use another program invocation to build the package (it can include space separated parameters). Alternatively it can be used to execute the standard rules file with another make program (for example by using \&\fB/usr/local/bin/make \-f debian/rules\fR as \fIrules-file\fR). .IP \fB\-\-check\-command=\fR\fIcheck-command\fR 4 .IX Item "--check-command=check-command" Command used to check the \fB.changes\fR file itself and any artifact built referenced in the file (since dpkg 1.17.6). The command should take the \fB.changes\fR pathname as an argument. This command will usually be \fBlintian\fR. .IP \fB\-\-check\-option=\fR\fIopt\fR 4 .IX Item "--check-option=opt" Pass option \fIopt\fR to the \fIcheck-command\fR specified with \&\fBDEB_CHECK_COMMAND\fR or \fB\-\-check\-command\fR (since dpkg 1.17.6). Can be used multiple times. .IP \fB\-\-hook\-\fR\fIhook-name\fR\fB=\fR\fIhook-command\fR 4 .IX Item "--hook-hook-name=hook-command" Set the specified shell code \fIhook-command\fR as the hook \fIhook-name\fR, which will run at the times specified in the run steps (since dpkg 1.17.6). The hooks will always be executed even if the following action is not performed (except for the \fBbinary\fR hook). All the hooks will run in the unpacked source directory. .Sp Some hooks can receive addition information through environment variables (since dpkg 1.22.0). All hooks get the hook name in the \fBDPKG_BUILDPACKAGE_HOOK_NAME\fR environment variable (since dpkg 1.22.0). .Sp \&\fBNote\fR: Hooks can affect the build process, and cause build failures if their commands fail, so watch out for unintended consequences. .Sp The current \fIhook-name\fR supported are: .RS 4 .IP \fBpreinit\fR 4 .IX Item "preinit" .PD 0 .IP \fBinit\fR 4 .IX Item "init" .IP \fBpreclean\fR 4 .IX Item "preclean" .IP \fBsource\fR 4 .IX Item "source" .PD Gets \fBDPKG_BUILDPACKAGE_HOOK_SOURCE_OPTIONS\fR with the space-separated lists of options that will passed to the \fBdpkg-source\fR call. .IP \fBbuild\fR 4 .IX Item "build" Gets \fBDPKG_BUILDPACKAGE_HOOK_BUILD_TARGET\fR with the name of the \&\fBdebian/rules\fR build target called, but only if called. .IP \fBbinary\fR 4 .IX Item "binary" Gets \fBDPKG_BUILDPACKAGE_HOOK_BINARY_TARGET\fR with the name of the \&\fBdebian/rules\fR binary target called, but only if called. .IP \fBbuildinfo\fR 4 .IX Item "buildinfo" Gets \fBDPKG_BUILDPACKAGE_HOOK_BUILDINFO_OPTIONS\fR with the space-separated lists of options that will passed to the \fBdpkg-genbuildinfo\fR call. .IP \fBchanges\fR 4 .IX Item "changes" Gets \fBDPKG_BUILDPACKAGE_HOOK_CHANGES_OPTIONS\fR with the space-separated lists of options that will passed to the \fBdpkg-genchanges\fR call. .IP \fBpostclean\fR 4 .IX Item "postclean" .PD 0 .IP \fBcheck\fR 4 .IX Item "check" .PD Gets \fBDPKG_BUILDPACKAGE_HOOK_CHECK_OPTIONS\fR with the space-separated lists of options that will passed to the check command call. .IP \fBsign\fR 4 .IX Item "sign" .PD 0 .IP \fBdone\fR 4 .IX Item "done" .RE .RS 4 .PD .Sp The \fIhook-command\fR supports the following substitution format string, which will get applied to it before execution: .IP \fB%%\fR 4 .IX Item "%%" A single % character. .ie n .IP \fR\fB%a\fR\fB\fR 4 .el .IP \fR\f(CB%a\fR\fB\fR 4 .IX Item "%a" A boolean value (0 or 1), representing whether the following action is being performed. .ie n .IP \fR\fB%p\fR\fB\fR 4 .el .IP \fR\f(CB%p\fR\fB\fR 4 .IX Item "%p" The source package name. .ie n .IP \fR\fB%v\fR\fB\fR 4 .el .IP \fR\f(CB%v\fR\fB\fR 4 .IX Item "%v" The source package version. .ie n .IP \fR\fB%s\fR\fB\fR 4 .el .IP \fR\f(CB%s\fR\fB\fR 4 .IX Item "%s" The source package version (without the epoch). .ie n .IP \fR\fB%u\fR\fB\fR 4 .el .IP \fR\f(CB%u\fR\fB\fR 4 .IX Item "%u" The upstream version. .RE .RS 4 .RE .IP \fB\-\-buildinfo\-file=\fR\fIfilename\fR 4 .IX Item "--buildinfo-file=filename" Set the \fIfilename\fR for the generated \fB.buildinfo\fR file (since dpkg 1.21.0). .IP \fB\-\-buildinfo\-option=\fR\fIopt\fR 4 .IX Item "--buildinfo-option=opt" Pass option \fIopt\fR to \fBdpkg-genbuildinfo\fR (since dpkg 1.18.11). Can be used multiple times. .IP \fB\-\-sign\-backend=\fR\fIsign-backend\fR 4 .IX Item "--sign-backend=sign-backend" Specify an OpenPGP backend interface to use when invoking the \fIsign-command\fR (since dpkg 1.21.10). .Sp The default is \fBauto\fR, where the best current backend available will be used. The specific OpenPGP backends supported in order of preference are: .RS 4 .IP \fBsop\fR 4 .IX Item "sop" (any conforming Stateless OpenPGP implementation) .IP \fBsq\fR 4 .IX Item "sq" (from Sequoia-PGP) .IP \fBgpg\fR 4 .IX Item "gpg" (from GnuPG) .RE .RS 4 .RE .IP "\fB\-p\fR, \fB\-\-sign\-command=\fR\fIsign-command\fR" 4 .IX Item "-p, --sign-command=sign-command" When \fBdpkg-buildpackage\fR needs to execute an OpenPGP backend command to sign a source control (\fB.dsc\fR) file, a \fB.buildinfo\fR file or a \fB.changes\fR file it will run \&\fIsign-command\fR (searching the \fBPATH\fR if necessary) instead of the default or auto-detected backend command (long option since dpkg 1.18.8). \&\fIsign-command\fR will get all the backend specific arguments according to the \fB\-\-sign\-backend\fR selected. \&\fIsign-command\fR should not contain spaces or any other shell metacharacters. .IP "\fB\-k\fR, \fB\-\-sign\-keyid=\fR\fIkey-id\fR" 4 .IX Item "-k, --sign-keyid=key-id" .PD 0 .IP \fB\-\-sign\-key=\fR\fIkey-id\fR 4 .IX Item "--sign-key=key-id" .PD Specify an OpenPGP key-ID (either a fingerprint or a user-ID) for the secret key to use when signing packages (\fB\-\-sign\-key\fR since dpkg 1.18.8, \&\fB\-\-sign\-keyid\fR since dpkg 1.21.10). .IP \fB\-\-sign\-keyfile=\fR\fIkey-file\fR 4 .IX Item "--sign-keyfile=key-file" Specify an OpenPGP \fIkey-file\fR containing the secret key to use when signing packages (since dpkg 1.21.10). .Sp \&\fBNote\fR: For security reasons the \fIkey-file\fR is best kept locked with a password. .IP "\fB\-us\fR, \fB\-\-unsigned\-source\fR" 4 .IX Item "-us, --unsigned-source" Do not sign the source package (long option since dpkg 1.18.8). .IP "\fB\-ui\fR, \fB\-\-unsigned\-buildinfo\fR" 4 .IX Item "-ui, --unsigned-buildinfo" Do not sign the \fB.buildinfo\fR file (since dpkg 1.18.19). .IP "\fB\-uc\fR, \fB\-\-unsigned\-changes\fR" 4 .IX Item "-uc, --unsigned-changes" Do not sign the \fB.buildinfo\fR and \fB.changes\fR files (long option since dpkg 1.18.8). .IP \fB\-\-no\-sign\fR 4 .IX Item "--no-sign" Do not sign any file, this includes the source package, the \fB.buildinfo\fR file and the \fB.changes\fR file (since dpkg 1.18.20). .IP \fB\-\-force\-sign\fR 4 .IX Item "--force-sign" Force the signing of the resulting files (since dpkg 1.17.0), regardless of \&\fB\-us\fR, \fB\-\-unsigned\-source\fR, \&\fB\-ui\fR, \fB\-\-unsigned\-buildinfo\fR, \&\fB\-uc\fR, \fB\-\-unsigned\-changes\fR or other internal heuristics. .IP \fB\-sn\fR 4 .IX Item "-sn" .PD 0 .IP \fB\-ss\fR 4 .IX Item "-ss" .IP \fB\-sA\fR 4 .IX Item "-sA" .IP \fB\-sk\fR 4 .IX Item "-sk" .IP \fB\-su\fR 4 .IX Item "-su" .IP \fB\-sr\fR 4 .IX Item "-sr" .IP \fB\-sK\fR 4 .IX Item "-sK" .IP \fB\-sU\fR 4 .IX Item "-sU" .IP \fB\-sR\fR 4 .IX Item "-sR" .IP "\fB\-i\fR, \fB\-\-diff\-ignore\fR[=\fIregex\fR]" 4 .IX Item "-i, --diff-ignore[=regex]" .IP "\fB\-I\fR, \fB\-\-tar\-ignore\fR[=\fIpattern\fR]" 4 .IX Item "-I, --tar-ignore[=pattern]" .IP "\fB\-z\fR, \fB\-\-compression\-level=\fR\fIlevel\fR" 4 .IX Item "-z, --compression-level=level" .IP "\fB\-Z\fR, \fB\-\-compression=\fR\fIcompressor\fR" 4 .IX Item "-Z, --compression=compressor" .PD Passed unchanged to \fBdpkg-source\fR. See its manual page. .IP \fB\-\-source\-option=\fR\fIopt\fR 4 .IX Item "--source-option=opt" Pass option \fIopt\fR to \fBdpkg-source\fR (since dpkg 1.15.6). Can be used multiple times. .IP \fB\-\-changes\-file=\fR\fIfilename\fR 4 .IX Item "--changes-file=filename" Set the \fIfilename\fR for the generated \fB.changes\fR file (since dpkg 1.21.0). .IP \fB\-\-changes\-option=\fR\fIopt\fR 4 .IX Item "--changes-option=opt" Pass option \fIopt\fR to \fBdpkg-genchanges\fR (since dpkg 1.15.6). Can be used multiple times. .IP \fB\-\-admindir=\fR\fIdir\fR 4 .IX Item "--admindir=dir" .PD 0 .IP "\fB\-\-admindir\fR \fIdir\fR" 4 .IX Item "--admindir dir" .PD Change the location of the \fBdpkg\fR database (since dpkg 1.14.0). The default location is \fI/var/lib/dpkg\fR. .IP "\fB\-?\fR, \fB\-\-help\fR" 4 .IX Item "-?, --help" Show the usage message and exit. .IP \fB\-\-version\fR 4 .IX Item "--version" Show the version and exit. .SH ENVIRONMENT .IX Header "ENVIRONMENT" .SS "External environment" .IX Subsection "External environment" .IP \fBDEB_CHECK_COMMAND\fR 4 .IX Item "DEB_CHECK_COMMAND" If set, it will be used as the command to check the \fB.changes\fR file (since dpkg 1.17.6). Overridden by the \fB\-\-check\-command\fR option. .IP \fBDEB_SIGN_KEYID\fR 4 .IX Item "DEB_SIGN_KEYID" If set, it will be used to sign the \fB.changes\fR, \fB.buildinfo\fR and \fB.dsc\fR files (since dpkg 1.17.2). Overridden by the \fB\-\-sign\-key\fR option. .IP \fBDEB_SIGN_KEYFILE\fR 4 .IX Item "DEB_SIGN_KEYFILE" If set, it will be used to sign the \fB.changes\fR, \fB.buildinfo\fR and \fB.dsc\fR files (since dpkg 1.21.10). Overridden by the \fB\-\-sign\-keyfile\fR option. .IP \fBDEB_BUILD_OPTIONS\fR 4 .IX Item "DEB_BUILD_OPTIONS" If set, it will contain a space-separated list of options that affect the behavior of some dpkg tools involved in package building, and might affect the package build process if the code in \fIdebian/rules\fR honors them. .Sp The following are the options known and supported by dpkg tools, other options honored by \fIdebian/rules\fR might be defined by distribution specific policies. .RS 4 .IP \fBparallel=\fR\fIN\fR 4 .IX Item "parallel=N" The \fIdebian/rules\fR in the packaging might use this option to set up the build process to use \fIN\fR parallel jobs. It is overridden by the \fB\-\-jobs\fR and \fB\-\-jobs\-force\fR options. .IP \fBnocheck\fR 4 .IX Item "nocheck" \&\fBdpkg-buildpackage\fR will ignore the \fBDEB_CHECK_COMMAND\fR variable. The \fIdebian/rules\fR in the packaging is not expected to run test suites during the build. .IP \fBnoopt\fR 4 .IX Item "noopt" If \fIdebian/rules\fR calls \fBdpkg-buildflags\fR to set up the build flags, those will be set to not enable any optimizations. .IP \fBnostrip\fR 4 .IX Item "nostrip" The \fIdebian/rules\fR in the packaging should ensure that objects do not get the debugging information stripped. If \fIdebian/rules\fR includes the \fBmk/buildtools.mk\fR make fragment the \&\fBSTRIP\fR make variable will respect this option. .IP \fBterse\fR 4 .IX Item "terse" \&\fBdpkg-buildpackage\fR will append the \fB\-\-no\-print\-directory\fR \fBmake\fR\|(1) flag to the \fBMAKEFLAGS\fR environment variable. The \fIdebian/rules\fR in the packaging should reduce verbosity, while not being completely quiet. .RE .RS 4 .RE .IP \fBDEB_BUILD_PROFILES\fR 4 .IX Item "DEB_BUILD_PROFILES" If set, it will be used as the active build profile(s) for the package being built (since dpkg 1.17.2). It is a space separated list of profile names. Overridden by the \fB\-P\fR option. .IP \fBDPKG_COLORS\fR 4 .IX Item "DPKG_COLORS" Sets the color mode (since dpkg 1.18.5). The currently accepted values are: \fBauto\fR (default), \fBalways\fR and \&\fBnever\fR. .IP \fBDPKG_NLS\fR 4 .IX Item "DPKG_NLS" If set, it will be used to decide whether to activate Native Language Support, also known as internationalization (or i18n) support (since dpkg 1.19.0). The accepted values are: \fB0\fR and \fB1\fR (default). .SS "Internal environment" .IX Subsection "Internal environment" Even if \fBdpkg-buildpackage\fR exports some variables, \fBdebian/rules\fR should not rely on their presence and should instead use the respective interface to retrieve the needed values, because that file is the main entry point to build packages and running it standalone should be supported. .IP \fBDEB_BUILD_*\fR 4 .IX Item "DEB_BUILD_*" .PD 0 .IP \fBDEB_HOST_*\fR 4 .IX Item "DEB_HOST_*" .IP \fBDEB_TARGET_*\fR 4 .IX Item "DEB_TARGET_*" .PD \&\fBdpkg-architecture\fR is called with the \fB\-a\fR and \fB\-t\fR parameters forwarded. Any variable that is output by its \fB\-s\fR option is integrated in the build environment. .IP \fBDEB_RULES_REQUIRES_ROOT\fR 4 .IX Item "DEB_RULES_REQUIRES_ROOT" This variable is set to the value obtained from the \fBRules-Requires-Root\fR field, the dpkg-build-api level or from the command-line. When set, it will be a valid value for the \fBRules-Requires-Root\fR field. It is used to notify \fBdebian/rules\fR whether the \fBrootless\-builds.txt\fR specification is supported. .IP \fBDEB_GAIN_ROOT_CMD\fR 4 .IX Item "DEB_GAIN_ROOT_CMD" This variable is set to \fIgain-root-command\fR when the field \&\fBRules-Requires-Root\fR is set to a value different to \fBno\fR and \&\fBbinary-targets\fR. .IP \fBSOURCE_DATE_EPOCH\fR 4 .IX Item "SOURCE_DATE_EPOCH" This variable is set to the Unix timestamp since the epoch of the latest entry in \fIdebian/changelog\fR, if it is not already defined. .SH FILES .IX Header "FILES" .IP \fI/etc/dpkg/buildpackage.conf\fR 4 .IX Item "/etc/dpkg/buildpackage.conf" System wide configuration file .ie n .IP "\fR\fI$XDG_CONFIG_HOME\fR\fI/dpkg/buildpackage.conf\fR or" 4 .el .IP "\fR\f(CI$XDG_CONFIG_HOME\fR\fI/dpkg/buildpackage.conf\fR or" 4 .IX Item "$XDG_CONFIG_HOME/dpkg/buildpackage.conf or" .PD 0 .ie n .IP \fR\fI$HOME\fR\fI/.config/dpkg/buildpackage.conf\fR 4 .el .IP \fR\f(CI$HOME\fR\fI/.config/dpkg/buildpackage.conf\fR 4 .IX Item "$HOME/.config/dpkg/buildpackage.conf" .PD User configuration file. .SH NOTES .IX Header "NOTES" .SS "Compiler flags are no longer exported" .IX Subsection "Compiler flags are no longer exported" Between dpkg 1.14.17 and 1.16.1, \fBdpkg-buildpackage\fR exported compiler flags (\fBCFLAGS\fR, \fBCXXFLAGS\fR, \fBFFLAGS\fR, \&\fBCPPFLAGS\fR and \fBLDFLAGS\fR) with values as returned by \fBdpkg-buildflags\fR. This is no longer the case. .SS "Default build targets" .IX Subsection "Default build targets" \&\fBdpkg-buildpackage\fR is using the \fBbuild-arch\fR and \&\fBbuild-indep\fR targets since dpkg 1.16.2. Those targets are thus mandatory. But to avoid breakages of existing packages, and ease the transition, if the source package does not build both architecture independent and dependent binary packages (since dpkg 1.18.8) it will fallback to use the \fBbuild\fR target if \fBmake \-f debian/rules \-qn\fR \&\fIbuild-target\fR returns 2 as exit code. .SH SECURITY .IX Header "SECURITY" Building binary or source packages should only be performed over trusted source data. .SH BUGS .IX Header "BUGS" It should be possible to specify spaces and shell metacharacters and initial arguments for \&\fIgain-root-command\fR and \fIsign-command\fR. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fI/usr/share/doc/dpkg/spec/rootless\-builds.txt\fR, \&\fBdpkg\-source\fR\|(1), \&\fBdpkg\-architecture\fR\|(1), \&\fBdpkg\-buildflags\fR\|(1), \&\fBdpkg\-genbuildinfo\fR\|(1), \&\fBdpkg\-genchanges\fR\|(1), \&\fBfakeroot\fR\|(1), \&\fBlintian\fR\|(1), , \&\fBsq\fR\|(1), \&\fBgpg\fR\|(1).