.\" Authors: Ian Jackson .TH DPKG\-SOURCE 1 "Januari 2000" "Debian Project" "dpkg utilities" .SH NAME dpkg\-source, dpkg\-gencontrol, dpkg\-shlibdeps, dpkg\-genchanges, dpkg\-buildpackage, dpkg\-distaddfile, dpkg\-parsechangelog \- Debian source package tools .SH SYNOPSIS .B dpkg-source .BI "-x " filename .dsc .br .B dpkg-source -b .RI [ options "] " directory " [" orig-directory |''] .br .B dpkg-gencontrol .RI [ options ] .br .B dpkg-shlibdeps .IR options .br .B dpkg-genchanges .RI [ options ] .br .B dpkg-buildpackage .RI [ options ] .br .B dpkg-distaddfile .RI [ options ] " filename section priority" .br .B dpkg-parsechangelog .RI [ options ] .SH DESCRIPTION .B dpkg-source packs and unpacks Debian source archives. .B dpkg-gencontrol reads information from an unpacked Debian source tree and generates a binary package control file (which defaults to debian/tmp/DEBIAN/control); it also adds an entry for the binary package to .BR debian/files . .B dpkg-shlibdeps calculates shared library dependencies for executables named in its arguments. The dependencies are added to the substitution variables file .B debian/substvars as variable names .BI shlibs: dependencyfield where .I dependencyfield is a dependency field name. Any other variables starting .I shlibs: are removed from the file. .B dpkg-shlibdeps will read shared library dependency information from .BR debian/shlibs.local , .BR /etc/dpkg/shlibs.override , the .B shlibs control area file of the package containing the file which .B objdump reports as satisfying the library dependency, or .BR /etc/dpkg/shlibs.default . The first match will be used. See the .I Debian packaging manual for details of the format of shared library dependency files. .B dpkg-genchanges reads information from an unpacked and built Debian source tree and from the files it has generated and generates a Debian upload control file .RB ( .changes " file)." .B dpkg-buildpackage is a control script which can be used to help automate the building of a package. .B dpkg-distaddfile adds an entry for a named file to .BR debian/files . .B dpkg-parsechangelog reads and parses the changelog of an unpacked Debian source tree and outputs the information in it to standard output in a machine-readable form. None of these commands allow multiple options to be combined into one, and they do not allow the value for an option to be specified in a separate argument. .SH COMMON OPTIONS Many of these programs share options; these are described here, together with the programs that accept them. .TP .BI -h Display the particular program's version and usage message, including a synopsis of the options it understands. This option is understood by all the source package tools. .TP .BI -v version In .BR dpkg-buildpackage ", " dpkg-genchanges " and " dpkg-parsechangelog this causes changelog information from all versions strictly later than .I version (which must appear in the changelog file) to be used. In .BR dpkg-gencontrol it sets the version number of the binary package which will be generated. .TP .BI -C changesdescription Read the description of the changes from the file .I changesdescription rather than using the information from the source tree's changelog file. This is understood by .BR dpkg-buildpackage " and " dpkg-genchanges . .TP .BI -m maintaineraddress Use .I maintaineraddress as the name and email address of the maintainer for this package, rather than using the information from the source tree's control. This is understood by .BR dpkg-buildpackage " and " dpkg-genchanges . .TP .BI -e maintaineraddress Use .I maintaineraddress as the name and email address of the maintainer for this upload, rather than using the information from the source tree's changelog. This is understood by .BR dpkg-buildpackage " and " dpkg-genchanges . .TP .BR -si ", " -sa ", " -sd These options control whether the original source archive is included in the upload generated by .BR dpkg-buildpackage " and " dpkg-genchanges if any source is being generated (ie, .BR -b " or " -B haven't been used). By default, or if .B -si is specified, the original source will be included if the version number ends in .BR -0 " or " -1 , ie if the Debian revision part of the version number is .BR 0 " or " 1 . .B -sa forces the inclusion of the original source; .B -sd forces its exclusion and includes only the diff. .TP .BI -V name = value Set an output substitution variable. This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . See below for a discussion of output substitution. .TP .BI -T substvarsfile Read (or, for .BR dpkg-shlibdeps , write) substitution variables in .IR substvarsfile ; the default is .BR debian/substvars . This option is understood by .BR dpkg-source ", " dpkg-gencontrol ", " dpkg-shlibdeps " and " dpkg-genchanges . .TP .BI -D field = value Override or add an output control file field. This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . .TP .BI -U field Remove an output control file field. This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . .TP .BR -b | -B | -S For .BR dpkg-genchanges " and " dpkg-buildpackage .BR -b " and " -B specify that a binary-only build is taking place. .B -b indicates that no source files are to be built and/or distributed, and .B -B that no architecture-independent binary package files are to be distributed either. .B -S specifies that only the source should be uploaded and no binary packages need to be made. The distinction between .BR -b " and " -B is only used by .BR dpkg-buildpackage ; .B dpkg-genchanges just produces a .B .changes file for whatever files were produced by the .B binary-* target(s) of the package being built. .B -b tells .B dpkg-source to build a source package (rather than to extract one) - see below. .TP .BI -c controlfile Specifies the main source control file to read information from. The default is .BR debian/control . This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . .TP .BI -l changelogfile Specifies the change log file to read information from. The default is .BR debian/changelog . This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . .TP .BI -f fileslistfile Read or write the list of files to be uploaded here, rather than using .BR debian/files . This option is understood by .BR dpkg-gencontrol ", " dpkg-genchanges " and " dpkg-distaddfile . .TP .BI -F changelogformat Specifies the format of the changelog. By default the format is read from a special line near the bottom of the changelog (see the Debian packaging manual) or failing that defaults to .BR debian , the standard format described in the .IR "Debian packaging manual" . This option is understood by .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges . .TP .BI -W This option turns certain errors into warnings. Only dpkg-source uses this, but .BR dpkg-buildpackage recognizes it, and passes it thru to .BR dpkg-source "." .TP .BI -E This option negates a previously set .BR -W "." It is currently only understood by .BR dpkg-buildpackage " and " dpkg-source "." .SH DPKG-SOURCE OPTIONS When the common options .BR -c " and " -l are given with relative pathnames these are interpreted starting at the source tree's top level directory. .TP .B -x Extract a source package. One non-option argument should be supplied, the name of the Debian source control file .RB ( .dsc ). No options are useful with .BR "dpkg-source -x" . .B dpkg-source will read the names of the other file(s) making up the source package from the control file; they are assumed to be in the same directory as the .BR .dsc . The files in the extracted package will have their permissions and ownerships set to those which would have been expected if the files and directories had simply been created - directories and executable files will be 0777 and plain files will be 0666, both modified by the extractors' umask; if the parent directory is setgid then the extracted directories will be too, and all the files and directories will inherit its group ownership. .TP .B -b Build: pack up a source tree. One or two non-option arguments should be supplied. The first is taken as the name of the directory containing the unpacked source tree. If a second argument is supplied it should be the name of the original source directory or tarfile or the empty string if the package is a Debian-specific one and so has no Debianisation diffs. If no second argument is supplied then .B dpkg-source will look for the original source tarfile .IB package _ upstream-version .orig.tar.gz or the original source directory .IB directory .orig or the empty string (no original source, and so no diff) depending on the arguments. .TP .B -i[] You may specify a perl regular expression to match files you want filtered out of the list of files for the diff. (This list is generated by a find command.) \fB-i\fR by itself enables the option, with a default that will filter out CVS, RCS and libtool .deps subdirectories, and all files within them, as well as ~ suffixed backup files and DEADJOEs. This is very helpful in cutting out extraneous files that get included in the .diff.gz, (eg: "debian/BUGS_TODO/*" or "debian/RCS/*,v"). For instance, if you maintain a package that you track via remote CVS, where you don't have access permissions for commiting the debian control files and making tags for \fIcvs-buildpackage(1)\fR, it is necessary to perform an extra checkout/update into a directory you keep pristine, to generate the .orig.tar.gz from. That directory will have CVS/Entries files in it that will contain timestamps that differ from the ones in your working directory, thus causing them to be unnecessarily included in every .diff.gz, unless you use the \fB-i\fR switch. .TP .BR -sa , -sp , -su , -sk , -sA , -sP , -sU , -sK , -ss " with " -b If .BR -sk " or " -sp is specified .B dpkg-source expects the original source as a tarfile, by default .IB package _ upstream-version .orig.tar.gz\fR. It will leave this original source in place as a tarfile, or copy it to the current directory if it isn't already there If .B -sp is used rather than .B -sk it will remove it again afterwards. If .BR -su " or " -sr is specified the original source is expected as a directory, by default .IB package - upstream-version .orig and .B dpkg-source will create a new original source archive from it. If .B -sr is used .B dpkg-source will remove that directory after it has been used. If .B -ss is specified .B dpkg-source will expect that the original source is available both as a directory and as a tarfile. If will use the directory to create the diff, but the tarfile to create the .BR .dsc . This option must be used with care - if the directory and tarfile do not match a bad source archive will be generated. If .B -sn is specified .B dpkg-source will not look for any original source, and will not generate a diff. The second argument, if supplied, must be the empty string. This is used for Debian-specific packages which do not have a separate upstream source and therefore have no debianisation diffs. If .BR -sa " or " -sA is specified .B dpkg-source will look for the original source archive as a tarfile or as a directory - the second argument, if any, may be either, or the empty string (this is equivalent to using .BR -sn ). If a tarfile is found it will unpack it to create the diff and remove it afterwards (this is equivalent to .BR -sp ); if a directory is found it will pack it to create the original source and remove it afterwards (this is equivalent to .BR -sr ); if neither is found it will assume that the package has no debianisation diffs, only a straightforward source archive (this is equivalent to .BR -sn ). If both are found then dpkg-source will ignore the directory, overwriting it, if .B -sA was specified (this is equivalent to .BR -sP ) or raise an error if .B -sa was specified. .B -sA is the default. .BR -sa ", " -sp ", " -sk ", " -su " and " -sr will not overwrite existing tarfiles or directories. If this is desired then .BR -sA ", " -sP ", " -sK ", " -su " and " -sR should be used instead. .TP .BR -sp , -su , -sn " with " -x In all cases any existing original source tree will be removed. If .B -sp is used when extracting then the original source (if any) will be left as a tarfile. If it is not already located in the current directory or if an existing but different file is there it will be copied there. This is the default. .B -su unpacks the original source tree. .B -sn ensures that the original source is neither copied to the current directory nor unpacked. Any original source tree that was in the current directory is still removed. .SH DPKG-GENCONTROL OPTIONS .B dpkg-gencontrol does not take any non-option arguments. .TP .BI -p package Generate information for the binary package .IR package . If the source control file lists only one binary package then this option may be omitted; otherwise it is essential to select which binary package's information to generate. .TP .BI -n filename Assume the filename of the package will be .I filename instead of the normal package_version_arch.deb filename. .TP .BR -is ", " -ip ", " -isp Include the .BR Section " and " Priority fields for this package from the main source control file in the binary package control file being generated. Usually this information is not included here, but only in the .B .changes file. .B -isp includes both fields, .BR -is " only the " Section " and " -ip " only the " Priority . .TP .BI -P packagebuilddir Tells .B dpkg-source that the package is being built in .I packagebuilddir instead of .BR debian/tmp . This value is used to find the default value of the .B Installed-Size substitution variable and control file field (using .BR du ), and for the default location of the output file. .TP .B -O Causes the control file to be printed to standard output, rather than to .B debian/tmp/DEBIAN/control (or .IB packagebuilddir /DEBIAN/control if .B -P was used). .SH DPKG-SHLIBDEPS OPTIONS .B dpkg-shlibdeps interprets non-option arguments as executable names, just as if they'd been supplied as .BI -e executable\fR. .TP .BI -e executable Include dependencies appropriate for the shared libraries required by .IR executable . .TP .BI -d dependencyfield Add dependencies to be added to the control file dependency field .IR dependencyfield . (The dependencies for this field are placed in the variable .BI shlibs: dependencyfield\fR.) The .BI -d dependencyfield option takes effect for all executables after the option, until the next .BI -d dependencyfield\fR. The default .I dependencyfield is .BR Depends . If the same dependency entry (or set of alternatives) appears in more than one of the recognised dependency field names .BR Pre-Depends ", " Depends ", " Recommends ", " Enhances " or " Suggests then .B dpkg-shlibdeps will automatically remove the dependency from all fields except the one representing the most important dependencies. .TP .BI -p varnameprefix Causes substitution variables to start with .IB varnameprefix : instead of .BR shlibs: . Likewise, any existing substitution variables starting with .IB varnameprefix : (rather than .BR shlibs: ) are removed from the the substitution variables file. .TP .BI -L localshlibsfile Causes .B dpkg-shlibs to read overriding shared library dependency information from .I localshlibsfile instead of .BR debian/shlibs.local . .TP .B -O Causes the substitution variable settings to be printed to standard output, rather than being added to the substitution variables file .RB ( debian/substvars by default). .SH DPKG-GENCHANGES OPTIONS .B dpkg-genchanges does not take any non-option arguments. .TP .BI -u uploadfilesdir Look for the files to be uploaded in .I uploadfilesdir rather than .B .. .RB ( dpkg-genchanges needs to find these files so that it can include their sizes and checksums in the .B .changes file). .TP .B -q Usually .B dpkg-genchanges will produce informative messages on standard error, for example about how many of the package's source files are being uploaded. .B -q suppresses these messages. .SH DPKG-BUILDPACKAGE OPTIONS .B dpkg-buildpackage does not take any non-option arguments. .TP .BI -k key-id Specify a key-ID to use when signing packages. .TP .BI -r gain-root-command When .B dpkg-buildpackage needs to execute part of the build process as root, it prefixes the command it executes with .I gain-root-command if one has been specified. .I gain-root-command should be the name of a program on the .B PATH and will get as arguments the name of the real command to run and the arguments it should take. .I gain-root-command should not contain spaces or any other shell metacharacters. .\" what happens, if it contains spaces? (hs) .I gain-root-command might typically be .BR sudo ", " super " or " really . .B su is not suitable, since it requires a .B -c option to run a command and even then it can only invoke the user's shell with .B -c instead of passing arguments individually to the command to be run. .TP .BI -p sign-command When .B dpkg-buildpackage needs to execute GPG or PGP to sign a source control .RB ( .dsc ) file or a .B .changes file it will run .I sign-command (searching the .B PATH if necessary) instead of .BR pgp . .I sign-command will get all the arguments that .B pgp would have gotten. If .I sign-command takes its arguments in GPG rather than PGP style, you should give the .B -sgpg option. .I sign-command should not contain spaces or any other shell metacharacters. .TP .B -tc Clean the source tree (using .I gain-root-command .BR "debian/rules clean" ) after the package has been built. .TP .BR -us ", " -uc Do not sign the source package or the .changes file, respectively. .TP .BI -a architecture Specify the Debian architecture we build for. The architecture of the machine we build on is determined automatically, and is also the default for the host machine. .TP .B -i[] Passed unchanged to .BR dpkg-source . .TP .B -D Check build dependencies and conflicts; abort if unsatisfied. .TP .B -d Do not check build dependencies and conflicts. .TP .B -nc Do not clean the source tree(imlies -b). .SH DPKG-DISTADDFILE ARGUMENTS .B dpkg-distaddfile does not take any non-common options. It takes three non-option arguments, the filename and the section and priority for the .B .changes file. The filename should be specified relative to the directory where .B dpkg-genchanges will expect to find the files, usually .BR .. , rather than being a pathname relative to the current directory when .B dpkg-distaddfile is run. .SH DPKG-PARSECHANGELOG ARGUMENTS .B dpkg-parsechangelog does not take any non-common options or non-option arguments. .SH VARIABLE SUBSTITUTION Before .BR dpkg-source ", " dpkg-gencontrol " and " dpkg-genchanges write their control information (to the source control file .B .dsc for .B dpkg-source and to standard output for .BR dpkg-gencontrol " and " dpkg-genchanges ) they perform some variable substitutions on the output file. A variable substitution has the form .BI ${ variable-name }\fR. Variable names consist of alphanumerics, hyphens and colons and start with an alphanumeric. Variable substitutions are performed repeatedly until none are left; the full text of the field after the substitution is rescanned to look for more substitutions. After all the substitutions have been done each occurence of the string .B ${} (which is not a legal substitution) is replaced with a .B $ sign. Variables can be set using the .B -V common option. They can be also specified in the file .B debian/substvars (or whatever other file is specified using the .B -T option). This file consists of lines of the form .IB name = value\fR. Trailing whitespace on each line, blank lines, and lines starting with a .B # symbol (comments) are ignored. Additionally, the following standard variables are available: .TP .BI Arch The current build architecture (from .BR "dpkg \-\-print-architecture" ). .TP .B Source-Version The source package version (from the changelog file). .TP .B Installed-Size The total size of the package's installed files. This value is copied into the corresponding control file field; setting it will modify the value of that field. If this variable isn't set .B dpkg-gencontrol will use .B du -k debian/tmp to find the default value. .TP .B Extra-Size Additional disk space used when the package is installed. If this variable is set its value is added to that of the .B Installed-Size variable (whether set explicitly or using the default value) before it is copied into the .B Installed-Size control file field. .TP .BI F: fieldname The value of the output field .IR fieldname (which must be given in the canonical capitalisation). Setting these variables has no effect other than on places where they are expanded explicitly. .TP .B Format The .B .changes file format version generated by this version of the source packaging scripts. If you set this variable the contents of the .B Format field in the .B .changes file will change too. .TP .BR Newline ", " Space ", " Tab These variables each hold the corresponding character. .TP .BI shlibs: dependencyfield Variable settings with names of this form are generated by .B dpkg-shlibdeps - see above. .LP If a variable is referred to but not defined it generates a warning and an empty value is assumed. .SH FILES .TP .B debian/control The main source control information file, giving version-independent information about the source package and the binary packages it can produce. .TP .B debian/changelog The changelog file, used to obtain version-dependent information about the source package, such as the urgency and distribution of an upload, the changes made since a particular release, and the source version number itself. .TP .B debian/files The list of generated files which are part of the upload being prepared. .B dpkg-gencontrol adds the presumed filenames of binary packages whose control files it generates here; .B dpkg-distaddfile can be used to add additional files. .B dpkg-genchanges reads the data here when producing a .B .changes file. .TP .B debian/substvars List of substitution variables and values. .TP .B debian/shlibs.local Package-local overriding shared library dependency information. .TP .B /etc/dpkg/shlibs.override Per-system overriding shared library dependency information. .TP .B /etc/dpkg/shlibs.default Per-system default shared library dependency information. .SH BUGS The point at which field overriding occurs compared to certain standard output field settings is rather confused. The binary package entries in the .B debian/files file will be passed through variable substitution twice. This should not matter, since .BR $ ", " { " and " } are not legal in package names or version numbers. It should be possible to specify spaces and shell metacharacters in and initial arguments for .IR gain-root-command " and " sign-command . .SH SEE ALSO .IR "Debian packaging manual" , .br .IR "Debian policy manual" , .br .BR dpkg\-deb (1), .BR dpkg (8), .BR dselect (8), .BR gpg (1), .BR pgp (1). .SH AUTHOR The utilities and this manpage were written by Ian Jackson. .SH COPYRIGHT Copyright (C) 1995-1996 Ian Jackson .br Copyright (C) 2000 Wichert Akkerman .br This is free software; see the GNU General Public Licence version 2 or later for copying conditions. There is NO WARRANTY. See .B /usr/share/doc/dpkg/copyright and .B /usr/share/common-licenses/GPL for details.