3.3. Source packages as archives
As it exists on the FTP site, a Debian source package consists of three related files. You must have the right versions of all three to be able to use them.
Debian source control file - .dsc
This file is a control file used by dpkg-source
to extract a source package. See Debian source control files – .dsc.
Original source archive - package_upstream-version.orig.tar.gz
This is a compressed (with gzip -9
) tar
file containing the source code from the upstream authors of the program.
Debian package diff - package_upstream_version-revision.diff.gz
This is a unified context diff (diff -u
) giving the changes which are required to turn the original source into the Debian source. These changes may only include editing and creating plain files. The permissions of files, the targets of symbolic links and the characteristics of special files or pipes may not be changed and no files may be removed or renamed.
All the directories in the diff must exist, except the debian
subdirectory of the top of the source tree, which will be created by dpkg-source
if necessary when unpacking.
The dpkg-source
program will automatically make the debian/rules
file executable (see below).
If there is no original source code - for example, if the package is specially prepared for Debian or the Debian maintainer is the same as the upstream maintainer - the format is slightly different: then there is no diff, and the tarfile is named package_version.tar.gz
, and preferably contains a directory named package-version
.