From: hertzog Date: Sun, 3 Jan 2010 23:28:42 +0000 (+0000) Subject: Update several sections to take into account the new source formats “3.0 (quilt)... X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=developers-reference.git;a=commitdiff_plain;h=f5e816ccb9b3f7134c12b82c3388b586e29c7676 Update several sections to take into account the new source formats “3.0 (quilt)” and “3.0 (native)” * Update several sections to take into account the new source formats “3.0 (quilt)” and “3.0 (native)”. Closes: #561952 * Drop reference to “dbs” in the section about including binary files. git-svn-id: svn://anonscm.debian.org/ddp/manuals/trunk/developers-reference@7031 313b444b-1b9f-4f58-a734-7bb04f332e8d --- diff --git a/best-pkging-practices.dbk b/best-pkging-practices.dbk index 77ae40d..32d5115 100644 --- a/best-pkging-practices.dbk +++ b/best-pkging-practices.dbk @@ -96,18 +96,24 @@ diffs (e.g., from .diff.gz) and work out which patch sets to back out as a unit as bugs are fixed upstream. -Unfortunately, the packaging system as such currently doesn't provide for -separating the patches into several files. Nevertheless, there are ways to -separate patches: the patch files are shipped within the Debian patch file -(.diff.gz), usually within the -debian/ directory. The only difference is that they -aren't applied immediately by dpkg-source, -but by the build -rule of debian/rules, -through a dependency on the patch rule. -Conversely, they are reverted in -the clean rule, -through a dependency on the unpatch rule. +Fortunately, with the source format “3.0 (quilt)” it is now possible to +keep patches separate without having to modify debian/rules +to setup a patch system. Patches are stored in debian/patches/ +and when the source package is unpacked patches listed in +debian/patches/series are automatically applied. +As the name implies, patches can be managed with quilt. + + +When using the older source “1.0”, it's also possible to separate patches +but a dedicated patch system must be used: the patch files are shipped +within the Debian patch file (.diff.gz), usually +within the debian/ directory. The only difference is +that they aren't applied immediately by dpkg-source, +but by the build rule of +debian/rules, through a dependency on the +patch rule. Conversely, they are reverted in the +clean rule, through a dependency on the +unpatch rule. quilt is the recommended tool for this. @@ -1661,7 +1667,7 @@ upstream source. Pristine source The defining characteristic of a pristine source tarball is that the -.orig.tar.gz file is byte-for-byte identical to a tarball officially +.orig.tar.{gz,bz2} file is byte-for-byte identical to a tarball officially distributed by the upstream author. We cannot prevent upstream authors from changing the tarball they distribute without also incrementing the version number, so there can be no guarantee that a pristine @@ -1671,7 +1677,7 @@ identical to something that upstream once did distribute. If a difference arises later (say, if upstream notices that he wasn't using maximal compression in his original distribution and then re-gzips it), that's just too bad. Since there is no good -way to upload a new .orig.tar.gz for the same version, there is not even any +way to upload a new .orig.tar.{gz,bz2} for the same version, there is not even any point in treating this situation as a bug. This makes it possible to use checksums to easily verify that all changes between Debian's version and upstream's are contained in the Debian diff. Also, if the original @@ -1725,11 +1731,11 @@ gzipped tar at all, or if upstream's tarball contains non-DFSG-free material that you must remove before uploading. -In these cases the developer must construct a suitable .orig.tar.gz +In these cases the developer must construct a suitable .orig.tar.{gz,bz2} file himself. We refer to such a tarball as a repackaged upstream source. Note that a repackaged upstream source is different from a Debian-native package. A repackaged source still comes with Debian-specific -changes in a separate .diff.gz and still has a version +changes in a separate .diff.gz or .debian.tar.{gz,bz2} and still has a version number composed of <upstream-version> and <debian-revision>. @@ -1743,7 +1749,7 @@ archive. Use your own discretion here, but be prepared to defend your decision if you repackage source that could have been pristine. -A repackaged .orig.tar.gz +A repackaged .orig.tar.{gz,bz2} @@ -1798,47 +1804,24 @@ distinguish pristine tarballs from repackaged ones. -should be gzipped with maximal compression. +should be gzipped or bzipped with maximal compression. - -The canonical way to meet the latter two points is to let dpkg-source --b construct the repackaged tarball from an unpacked directory. -
-Changing binary files in <literal>diff.gz</literal> +Changing binary files Sometimes it is necessary to change binary files contained in the original -tarball, or to add binary files that are not in it. If this is done by simply -copying the files into the debianized source tree, -dpkg-source will not be able to handle this. On the other -hand, according to the guidelines given above, you cannot include such a -changed binary file in a repackaged orig.tar.gz. Instead, -include the file in the debian directory in -uuencoded (or similar) form The file should -have a name that makes it clear which binary file it encodes. Usually, some -postfix indicating the encoding should be appended to the original filename. -Note that you don't need to depend on sharutils to get the uudecode -program if you use perl's pack function. -The code could look like - -&example-uu; -. The file would then be -decoded and copied to its place during the build process. Thus the change will -be visible quite easy. - - -Some packages use dbs to manage patches to their upstream -source, and always create a new orig.tar.gz file that -contains the real orig.tar.gz in its toplevel directory. -This is questionable with respect to the preference for pristine source. On -the other hand, it is easy to modify or add binary files in this case: Just put -them into the newly created orig.tar.gz file, besides the -real one, and copy them to the right place during the build process. +tarball, or to add binary files that are not in it. This is fully supported +when using source packages in “3.0 (quilt)” format, see the +dpkg-source1 +manual page for details. When using the older format “1.0”, binary files +can't be stored in the .diff.gz so you must store +an uuencoded (or similar) version of the file(s) +and decode it at build time in debian/rules (and move +it in its official location).
diff --git a/debian/changelog b/debian/changelog index d9c172f..6066808 100644 --- a/debian/changelog +++ b/debian/changelog @@ -26,6 +26,9 @@ developers-reference (3.4.4) UNRELEASED; urgency=low * Mention docbook, POD and reST as convenient formats to write new manual pages. Thanks to Charles Plessy and the debian-mentors list for the idea and the patch. Closes: #557298 + * Update several sections to take into account the new source formats “3.0 + (quilt)” and “3.0 (native)”. Closes: #561952 + * Drop reference to “dbs” in the section about including binary files. -- Lucas Nussbaum Tue, 22 Dec 2009 22:49:40 +0900 diff --git a/pkgs.dbk b/pkgs.dbk index 3dc249e..8dd84be 100644 --- a/pkgs.dbk +++ b/pkgs.dbk @@ -223,23 +223,25 @@ distinction between the original sources and the patches applied for Debian the (more common) packages where there's an original source tarball file -accompanied by another file that contains the patches applied for Debian +accompanied by another file that contains the changes made by Debian For the native packages, the source package includes a Debian source control file (.dsc) and the source tarball -(.tar.gz). A source package of a non-native package +(.tar.{gz,bz2,lzma}). A source package of a non-native package includes a Debian source control file, the original source tarball -(.orig.tar.gz) and the Debian patches -(.diff.gz). +(.orig.tar.{gz,bz2,lzma}) and the Debian changes +(.diff.gz for the source format “1.0” or +.debian.tar.{gz,bz2,lzma} for the source format “3.0 (quilt)”). -Whether a package is native or not is determined when it is built by - dpkg-buildpackage -1 . The rest of this section relates -only to non-native packages. +With source format “1.0”, whether a package is native or not was determined +by dpkg-source at build time. Nowadays it is recommended +to be explicit about the desired source format by putting either “3.0 (quilt)” +or “3.0 (native)” in debian/source/format. +The rest of this section relates only to non-native packages. The first time a version is uploaded which corresponds to a particular upstream @@ -251,8 +253,8 @@ will not need to be re-uploaded. By default, dpkg-genchanges and dpkg-buildpackage will include the original source tar file -if and only if the Debian revision part of the source version number is 0 or 1, -indicating a new upstream version. This behavior may be modified by using +if and only if the current changelog entry has a different upstream version +from the preceding entry. This behavior may be modified by using -sa to always include it or -sd to always leave it out. @@ -265,8 +267,10 @@ the archive. Please notice that, in non-native packages, permissions on files that are not -present in the .orig.tar.gz will not be preserved, as diff does not store file -permissions in the patch. +present in the .orig.tar.{gz,bz2} will not be preserved, as diff does not store file +permissions in the patch. However when using source format “3.0 (quilt)”, +permissions of files inside the debian directory are +preserved since they are stored in a tar archive. @@ -1158,7 +1162,7 @@ upload without upstream source ( dpkg-buildpackage -sd). Be sure to use the exact same -*.orig.tar.gz as used in the +*.orig.tar.{gz,bz2} as used in the normal archive, otherwise it is not possible to move the security fix into the main archives later. @@ -1244,7 +1248,7 @@ control information to place the package in the desired section, and re-upload the package (see the Debian Policy Manual for details). You must ensure that you include the -.orig.tar.gz in your upload (even if you are not uploading +.orig.tar.{gz,bz2} in your upload (even if you are not uploading a new upstream version), or it will not appear in the new section together with the rest of the package. If your new section is valid, it will be moved automatically. If it does not, then contact the ftpmasters in order to @@ -1393,9 +1397,10 @@ Note that this applies to each part of your package, including the sources: if you wish to replace the upstream source tarball of your package, you will need to upload it with a different version. An easy possibility is to replace foo_1.00.orig.tar.gz with -foo_1.00+0.orig.tar.gz. This restriction gives each file -on the ftp site a unique name, which helps to ensure consistency across the -mirror network. +foo_1.00+0.orig.tar.gz or +foo_1.00.orig.tar.bz2. This restriction gives each +file on the ftp site a unique name, which helps to ensure consistency +across the mirror network. diff --git a/resources.dbk b/resources.dbk index 936bef2..1ff6c94 100644 --- a/resources.dbk +++ b/resources.dbk @@ -571,20 +571,33 @@ There are two types of Debian packages, namely source and binary packages. -Source packages consist of either two or three files: a -.dsc file, and either a .tar.gz file -or both an .orig.tar.gz and a -.diff.gz file. - - -If a package is developed specially for Debian and is not distributed outside -of Debian, there is just one .tar.gz file which contains -the sources of the program. If a package is distributed elsewhere too, the -.orig.tar.gz file stores the so-called upstream -source code, that is the source code that's distributed by the -upstream maintainer (often the author of the software). -In this case, the .diff.gz contains the changes made by -the Debian maintainer. +Depending on the format of the source package, it will consist +of one or more files in addition to the mandatory .dsc +file: + +with format “1.0”, it has either a .tar.gz +file or both an .orig.tar.gz and a +.diff.gz file; +with format “3.0 (quilt)”, it has a mandatory +.orig.tar.{gz,bz2,lzma} upstream tarball, +muliple optional .orig-component.tar.{gz,bz2,lzma} additional upstream tarballs and a +mandatory debian.tar.{gz,bz2,lzma} debian tarball; +with format “3.0 (native)”, it has only +a single .tar.{gz,bz2,lzma} tarball. + + + +If a package is developed specially for Debian and is not distributed +outside of Debian, there is just one +.tar.{gz,bz2,lzma} file which contains the sources of +the program, it's called a “native” source package. If a package is +distributed elsewhere too, the +.orig.tar.{gz,bz2,lzma} file stores the so-called +upstream source code, that is the source code that's +distributed by the upstream maintainer (often the +author of the software). In this case, the .diff.gz +or the debian.tar.{gz,bz2,lzma} contains the changes +made by the Debian maintainer. The .dsc file lists all the files in the source package