View file File name : ap-pkg-sourcepkg.html Content : <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <title>3. Source packages (from old Packaging Manual) — Debian Policy Manual v4.6.0.1</title> <link rel="stylesheet" type="text/css" href="_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="_static/nature.css" /> <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> <script src="_static/jquery.js"></script> <script src="_static/underscore.js"></script> <script src="_static/doctools.js"></script> <link rel="index" title="Index" href="genindex.html" /> <link rel="search" title="Search" href="search.html" /> <link rel="next" title="4. Control files and their fields (from old Packaging Manual)" href="ap-pkg-controlfields.html" /> <link rel="prev" title="2. Binary packages (from old Packaging Manual)" href="ap-pkg-binarypkg.html" /> </head><body> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="ap-pkg-controlfields.html" title="4. Control files and their fields (from old Packaging Manual)" accesskey="N">next</a> |</li> <li class="right" > <a href="ap-pkg-binarypkg.html" title="2. Binary packages (from old Packaging Manual)" accesskey="P">previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">Debian Policy Manual v4.6.0.1</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">3. </span>Source packages (from old Packaging Manual)</a></li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="source-packages-from-old-packaging-manual"> <h1><span class="section-number">3. </span>Source packages (from old Packaging Manual)<a class="headerlink" href="#source-packages-from-old-packaging-manual" title="Permalink to this headline">¶</a></h1> <p>The Debian binary packages in the distribution are generated from Debian sources, which are in a special format to assist the easy and automatic building of binaries.</p> <section id="tools-for-processing-source-packages"> <span id="s-pkg-sourcetools"></span><h2><span class="section-number">3.1. </span>Tools for processing source packages<a class="headerlink" href="#tools-for-processing-source-packages" title="Permalink to this headline">¶</a></h2> <p>Various tools are provided for manipulating source packages; they pack and unpack sources and help build of binary packages and help manage the distribution of new versions.</p> <p>They are introduced and typical uses described here; see <em class="manpage">dpkg-source(1)</em> for full documentation about their arguments and operation.</p> <p>For examples of how to construct a Debian source package, and how to use those utilities that are used by Debian source packages, please see the <code class="docutils literal notranslate"><span class="pre">hello</span></code> example package.</p> <section id="dpkg-source-packs-and-unpacks-debian-source-packages"> <span id="s-pkg-dpkg-source"></span><h3><span class="section-number">3.1.1. </span><code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> - packs and unpacks Debian source packages<a class="headerlink" href="#dpkg-source-packs-and-unpacks-debian-source-packages" title="Permalink to this headline">¶</a></h3> <p>This program is frequently used by hand, and is also called from package-independent automated building scripts such as <code class="docutils literal notranslate"><span class="pre">dpkg-buildpackage</span></code>.</p> <p>To unpack a package it is typically invoked with</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dpkg</span><span class="o">-</span><span class="n">source</span> <span class="o">-</span><span class="n">x</span> <span class="o">.../</span><span class="n">path</span><span class="o">/</span><span class="n">to</span><span class="o">/</span><span class="n">filename</span><span class="o">.</span><span class="n">dsc</span> </pre></div> </div> <p>with the <code class="docutils literal notranslate"><span class="pre">filename.tar.gz</span></code> and <code class="docutils literal notranslate"><span class="pre">filename.diff.gz</span></code> (if applicable) in the same directory. It unpacks into <code class="docutils literal notranslate"><span class="pre">package-version</span></code>, and if applicable <code class="docutils literal notranslate"><span class="pre">package-version.orig</span></code>, in the current directory.</p> <p>To create a packed source archive it is typically invoked:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dpkg</span><span class="o">-</span><span class="n">source</span> <span class="o">-</span><span class="n">b</span> <span class="n">package</span><span class="o">-</span><span class="n">version</span> </pre></div> </div> <p>This will create the <code class="docutils literal notranslate"><span class="pre">.dsc</span></code>, <code class="docutils literal notranslate"><span class="pre">.tar.gz</span></code> and <code class="docutils literal notranslate"><span class="pre">.diff.gz</span></code> (if appropriate) in the current directory. <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> does not clean the source tree first - this must be done separately if it is required.</p> <p>See also <a class="reference internal" href="#s-pkg-sourcearchives"><span class="std std-ref">Source packages as archives</span></a>.</p> </section> <section id="dpkg-buildpackage-overall-package-building-control-script"> <span id="s-pkg-dpkg-buildpackage"></span><h3><span class="section-number">3.1.2. </span><code class="docutils literal notranslate"><span class="pre">dpkg-buildpackage</span></code> - overall package-building control script<a class="headerlink" href="#dpkg-buildpackage-overall-package-building-control-script" title="Permalink to this headline">¶</a></h3> <p>See <em class="manpage">dpkg-buildpackage(1)</em>.</p> </section> <section id="dpkg-gencontrol-generates-binary-package-control-files"> <span id="s-pkg-dpkg-gencontrol"></span><h3><span class="section-number">3.1.3. </span><code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> - generates binary package control files<a class="headerlink" href="#dpkg-gencontrol-generates-binary-package-control-files" title="Permalink to this headline">¶</a></h3> <p>This program is usually called from <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> (see <a class="reference external" href="#s-pkg-sourcetree">section_title</a>) in the top level of the source tree.</p> <p>This is usually done just before the files and directories in the temporary directory tree where the package is being built have their permissions and ownerships set and the package is constructed using <code class="docutils literal notranslate"><span class="pre">dpkg-deb/</span></code>. <a class="footnote-reference brackets" href="#id6" id="id1">1</a></p> <p><code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> must be called after all the files which are to go into the package have been placed in the temporary build directory, so that its calculation of the installed size of a package is correct.</p> <p>It is also necessary for <code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> to be run after <code class="docutils literal notranslate"><span class="pre">dpkg-shlibdeps</span></code> so that the variable substitutions created by <code class="docutils literal notranslate"><span class="pre">dpkg-shlibdeps</span></code> in <code class="docutils literal notranslate"><span class="pre">debian/substvars</span></code> are available.</p> <p>For a package which generates only one binary package, and which builds it in <code class="docutils literal notranslate"><span class="pre">debian/tmp</span></code> relative to the top of the source package, it is usually sufficient to call <code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code>.</p> <p>Sources which build several binaries will typically need something like:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dpkg</span><span class="o">-</span><span class="n">gencontrol</span> <span class="o">-</span><span class="n">Pdebian</span><span class="o">/</span><span class="n">pkg</span> <span class="o">-</span><span class="n">ppackage</span> </pre></div> </div> <p>The <code class="docutils literal notranslate"><span class="pre">-P</span></code> tells <code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> that the package is being built in a non-default directory, and the <code class="docutils literal notranslate"><span class="pre">-p</span></code> tells it which package’s control file should be generated.</p> <p><code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> also adds information to the list of files in <code class="docutils literal notranslate"><span class="pre">debian/files</span></code>, for the benefit of (for example) a future invocation of <code class="docutils literal notranslate"><span class="pre">dpkg-genchanges</span></code>.</p> </section> <section id="dpkg-shlibdeps-calculates-shared-library-dependencies"> <span id="s-pkg-dpkg-shlibdeps"></span><h3><span class="section-number">3.1.4. </span><code class="docutils literal notranslate"><span class="pre">dpkg-shlibdeps</span></code> - calculates shared library dependencies<a class="headerlink" href="#dpkg-shlibdeps-calculates-shared-library-dependencies" title="Permalink to this headline">¶</a></h3> <p>See <em class="manpage">dpkg-shlibdeps(1)</em>.</p> </section> <section id="dpkg-distaddfile-adds-a-file-to-debian-files"> <span id="s-pkg-dpkg-distaddfile"></span><h3><span class="section-number">3.1.5. </span><code class="docutils literal notranslate"><span class="pre">dpkg-distaddfile</span></code> - adds a file to <code class="docutils literal notranslate"><span class="pre">debian/files</span></code><a class="headerlink" href="#dpkg-distaddfile-adds-a-file-to-debian-files" title="Permalink to this headline">¶</a></h3> <p>Some packages’ uploads need to include files other than the source and binary package files.</p> <p><code class="docutils literal notranslate"><span class="pre">dpkg-distaddfile</span></code> adds a file to the <code class="docutils literal notranslate"><span class="pre">debian/files</span></code> file so that it will be included in the <code class="docutils literal notranslate"><span class="pre">.changes</span></code> file when <code class="docutils literal notranslate"><span class="pre">dpkg-genchanges</span></code> is run.</p> <p>It is usually invoked from the <code class="docutils literal notranslate"><span class="pre">binary</span></code> target of <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code>:</p> <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dpkg</span><span class="o">-</span><span class="n">distaddfile</span> <span class="n">filename</span> <span class="n">section</span> <span class="n">priority</span> </pre></div> </div> <p>The filename is relative to the directory where <code class="docutils literal notranslate"><span class="pre">dpkg-genchanges</span></code> will expect to find it - this is usually the directory above the top level of the source tree. The <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> target should put the file there just before or just after calling <code class="docutils literal notranslate"><span class="pre">dpkg-distaddfile</span></code>.</p> <p>The section and priority are passed unchanged into the resulting <code class="docutils literal notranslate"><span class="pre">.changes</span></code> file.</p> </section> <section id="dpkg-genchanges-generates-a-changes-upload-control-file"> <span id="s-pkg-dpkg-genchanges"></span><h3><span class="section-number">3.1.6. </span><code class="docutils literal notranslate"><span class="pre">dpkg-genchanges</span></code> - generates a <code class="docutils literal notranslate"><span class="pre">.changes</span></code> upload control file<a class="headerlink" href="#dpkg-genchanges-generates-a-changes-upload-control-file" title="Permalink to this headline">¶</a></h3> <p>See <em class="manpage">dpkg-genchanges(1)</em>.</p> </section> <section id="dpkg-parsechangelog-produces-parsed-representation-of-a-changelog"> <span id="s-pkg-dpkg-parsechangelog"></span><h3><span class="section-number">3.1.7. </span><code class="docutils literal notranslate"><span class="pre">dpkg-parsechangelog</span></code> - produces parsed representation of a changelog<a class="headerlink" href="#dpkg-parsechangelog-produces-parsed-representation-of-a-changelog" title="Permalink to this headline">¶</a></h3> <p>See <em class="manpage">dpkg-parsechangelog(1)</em>.</p> </section> <section id="dpkg-architecture-information-about-the-build-and-host-system"> <span id="s-pkg-dpkg-architecture"></span><h3><span class="section-number">3.1.8. </span><code class="docutils literal notranslate"><span class="pre">dpkg-architecture</span></code> - information about the build and host system<a class="headerlink" href="#dpkg-architecture-information-about-the-build-and-host-system" title="Permalink to this headline">¶</a></h3> <p>See <em class="manpage">dpkg-architecture(1)</em>.</p> </section> </section> <section id="the-debian-package-source-tree"> <span id="s-pkg-sourcetree"></span><h2><span class="section-number">3.2. </span>The Debian package source tree<a class="headerlink" href="#the-debian-package-source-tree" title="Permalink to this headline">¶</a></h2> <p>The source archive scheme described later is intended to allow a Debian package source tree with some associated control information to be reproduced and transported easily. The Debian package source tree is a version of the original program with certain files added for the benefit of the packaging process, and with any other changes required made to the rest of the source code and installation scripts.</p> <p>The extra files created for Debian are in the subdirectory <code class="docutils literal notranslate"><span class="pre">debian</span></code> of the top level of the Debian package source tree. They are described below.</p> <section id="debian-rules-the-main-building-script"> <span id="s-pkg-debianrules"></span><h3><span class="section-number">3.2.1. </span><code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> - the main building script<a class="headerlink" href="#debian-rules-the-main-building-script" title="Permalink to this headline">¶</a></h3> <p>See <a class="reference internal" href="ch-source.html#s-debianrules"><span class="std std-ref">Main building script: debian/rules</span></a>.</p> </section> <section id="debian-substvars-and-variable-substitutions"> <span id="s-pkg-srcsubstvars"></span><h3><span class="section-number">3.2.2. </span><code class="docutils literal notranslate"><span class="pre">debian/substvars</span></code> and variable substitutions<a class="headerlink" href="#debian-substvars-and-variable-substitutions" title="Permalink to this headline">¶</a></h3> <p>See <a class="reference internal" href="ch-source.html#s-substvars"><span class="std std-ref">Variable substitutions: debian/substvars</span></a>.</p> </section> <section id="debian-files"> <span id="s-sc-2-3"></span><h3><span class="section-number">3.2.3. </span><code class="docutils literal notranslate"><span class="pre">debian/files</span></code><a class="headerlink" href="#debian-files" title="Permalink to this headline">¶</a></h3> <p>See <a class="reference internal" href="ch-source.html#s-debianfiles"><span class="std std-ref">Generated files list: debian/files</span></a>.</p> </section> <section id="debian-tmp"> <span id="s-sc-2-4"></span><h3><span class="section-number">3.2.4. </span><code class="docutils literal notranslate"><span class="pre">debian/tmp</span></code><a class="headerlink" href="#debian-tmp" title="Permalink to this headline">¶</a></h3> <p>This is the default temporary location for the construction of binary packages by the <code class="docutils literal notranslate"><span class="pre">binary</span></code> target. The directory <code class="docutils literal notranslate"><span class="pre">tmp</span></code> serves as the root of the file system tree as it is being constructed (for example, by using the package’s upstream makefiles install targets and redirecting the output there), and it also contains the <code class="docutils literal notranslate"><span class="pre">DEBIAN</span></code> subdirectory. See <a class="reference internal" href="ap-pkg-binarypkg.html#s-pkg-bincreating"><span class="std std-ref">Creating package files - dpkg-deb</span></a>.</p> <p>This is only a default and can be easily overridden. Most packaging tools no longer use <code class="docutils literal notranslate"><span class="pre">debian/tmp</span></code>, instead preferring <code class="docutils literal notranslate"><span class="pre">debian/pkg</span></code> for the common case of a source package building only one binary package. Such tools usually only use <code class="docutils literal notranslate"><span class="pre">debian/tmp</span></code> as a temporary staging area for built files and do not construct packages from it.</p> <p>If several binary packages are generated from the same source tree, it is usual to use a separate <code class="docutils literal notranslate"><span class="pre">debian/pkg</span></code> directory for each binary package as the temporary construction locations.</p> <p>Whatever temporary directories are created and used by the <code class="docutils literal notranslate"><span class="pre">binary</span></code> target must of course be removed by the <code class="docutils literal notranslate"><span class="pre">clean</span></code> target.</p> </section> </section> <section id="source-packages-as-archives"> <span id="s-pkg-sourcearchives"></span><h2><span class="section-number">3.3. </span>Source packages as archives<a class="headerlink" href="#source-packages-as-archives" title="Permalink to this headline">¶</a></h2> <p>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.</p> <dl> <dt>Debian source control file - <code class="docutils literal notranslate"><span class="pre">.dsc</span></code></dt><dd><p>This file is a control file used by <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> to extract a source package. See <a class="reference internal" href="ch-controlfields.html#s-debiansourcecontrolfiles"><span class="std std-ref">Debian source control files – .dsc</span></a>.</p> </dd> <dt>Original source archive - <code class="docutils literal notranslate"><span class="pre">package_upstream-version.orig.tar.gz</span></code></dt><dd><p>This is a compressed (with <code class="docutils literal notranslate"><span class="pre">gzip</span> <span class="pre">-9</span></code>) <code class="docutils literal notranslate"><span class="pre">tar</span></code> file containing the source code from the upstream authors of the program.</p> </dd> <dt>Debian package diff - <code class="docutils literal notranslate"><span class="pre">package_upstream_version-revision.diff.gz</span></code></dt><dd><p>This is a unified context diff (<code class="docutils literal notranslate"><span class="pre">diff</span> <span class="pre">-u</span></code>) 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.</p> <p>All the directories in the diff must exist, except the <code class="docutils literal notranslate"><span class="pre">debian</span></code> subdirectory of the top of the source tree, which will be created by <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> if necessary when unpacking.</p> <p>The <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> program will automatically make the <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> file executable (see below).</p> </dd> </dl> <p>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 <code class="docutils literal notranslate"><span class="pre">package_version.tar.gz</span></code>, and preferably contains a directory named <code class="docutils literal notranslate"><span class="pre">package-version</span></code>.</p> </section> <section id="unpacking-a-debian-source-package-without-dpkg-source"> <span id="s-sc-4"></span><h2><span class="section-number">3.4. </span>Unpacking a Debian source package without <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code><a class="headerlink" href="#unpacking-a-debian-source-package-without-dpkg-source" title="Permalink to this headline">¶</a></h2> <p><code class="docutils literal notranslate"><span class="pre">dpkg-source</span> <span class="pre">-x</span></code> is the recommended way to unpack a Debian source package. However, if it is not available it is possible to unpack a Debian source archive as follows:</p> <ol class="arabic simple"> <li><p>Untar the tarfile, which will create a <code class="docutils literal notranslate"><span class="pre">.orig</span></code> directory.</p></li> <li><p>Rename the <code class="docutils literal notranslate"><span class="pre">.orig</span></code> directory to <code class="docutils literal notranslate"><span class="pre">package-version</span></code>.</p></li> <li><p>Create the subdirectory <code class="docutils literal notranslate"><span class="pre">debian</span></code> at the top of the source tree.</p></li> <li><p>Apply the diff using <code class="docutils literal notranslate"><span class="pre">patch</span> <span class="pre">-p0</span></code>.</p></li> <li><p>Untar the tarfile again if you want a copy of the original source code alongside the Debian version.</p></li> </ol> <p>It is not possible to generate a valid Debian source archive without using <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code>. In particular, attempting to use <code class="docutils literal notranslate"><span class="pre">diff</span></code> directly to generate the <code class="docutils literal notranslate"><span class="pre">.diff.gz</span></code> file will not work.</p> <section id="restrictions-on-objects-in-source-packages"> <span id="s-sc-4-1"></span><h3><span class="section-number">3.4.1. </span>Restrictions on objects in source packages<a class="headerlink" href="#restrictions-on-objects-in-source-packages" title="Permalink to this headline">¶</a></h3> <p>The source package may not contain any hard links, <a class="footnote-reference brackets" href="#id7" id="id2">2</a> <a class="footnote-reference brackets" href="#id8" id="id3">3</a> device special files, sockets or setuid or setgid files. <a class="footnote-reference brackets" href="#id9" id="id4">4</a></p> <p>The source packaging tools manage the changes between the original and Debian source using <code class="docutils literal notranslate"><span class="pre">diff</span></code> and <code class="docutils literal notranslate"><span class="pre">patch</span></code>. Turning the original source tree as included in the <code class="docutils literal notranslate"><span class="pre">.orig.tar.gz</span></code> into the Debian package source must not involve any changes which cannot be handled by these tools. Problematic changes which cause <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> to halt with an error when building the source package are:</p> <ul class="simple"> <li><p>Adding or removing symbolic links, sockets or pipes.</p></li> <li><p>Changing the targets of symbolic links.</p></li> <li><p>Creating directories, other than <code class="docutils literal notranslate"><span class="pre">debian</span></code>.</p></li> <li><p>Changes to the contents of binary files.</p></li> </ul> <p>Changes which cause <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> to print a warning but continue anyway are:</p> <ul class="simple"> <li><p>Removing files, directories or symlinks. <a class="footnote-reference brackets" href="#id10" id="id5">5</a></p></li> <li><p>Changed text files which are missing the usual final newline (either in the original or the modified source tree).</p></li> </ul> <p>Changes which are not represented, but which are not detected by <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code>, are:</p> <ul class="simple"> <li><p>Changing the permissions of files (other than <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code>) and directories.</p></li> </ul> <p>The <code class="docutils literal notranslate"><span class="pre">debian</span></code> directory and <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> are handled specially by <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> - before applying the changes it will create the <code class="docutils literal notranslate"><span class="pre">debian</span></code> directory, and afterwards it will make <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> world-executable.</p> <dl class="footnote brackets"> <dt class="label" id="id6"><span class="brackets"><a class="fn-backref" href="#id1">1</a></span></dt> <dd><p>This is so that the control file which is produced has the right permissions</p> </dd> <dt class="label" id="id7"><span class="brackets"><a class="fn-backref" href="#id2">2</a></span></dt> <dd><p>This is not currently detected when building source packages, but only when extracting them.</p> </dd> <dt class="label" id="id8"><span class="brackets"><a class="fn-backref" href="#id3">3</a></span></dt> <dd><p>Hard links may be permitted at some point in the future, but would require a fair amount of work.</p> </dd> <dt class="label" id="id9"><span class="brackets"><a class="fn-backref" href="#id4">4</a></span></dt> <dd><p>Setgid directories are allowed.</p> </dd> <dt class="label" id="id10"><span class="brackets"><a class="fn-backref" href="#id5">5</a></span></dt> <dd><p>Renaming a file is not treated specially - it is seen as the removal of the old file (which generates a warning, but is otherwise ignored), and the creation of the new one.</p> </dd> </dl> </section> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="index.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">3. Source packages (from old Packaging Manual)</a><ul> <li><a class="reference internal" href="#tools-for-processing-source-packages">3.1. Tools for processing source packages</a><ul> <li><a class="reference internal" href="#dpkg-source-packs-and-unpacks-debian-source-packages">3.1.1. <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code> - packs and unpacks Debian source packages</a></li> <li><a class="reference internal" href="#dpkg-buildpackage-overall-package-building-control-script">3.1.2. <code class="docutils literal notranslate"><span class="pre">dpkg-buildpackage</span></code> - overall package-building control script</a></li> <li><a class="reference internal" href="#dpkg-gencontrol-generates-binary-package-control-files">3.1.3. <code class="docutils literal notranslate"><span class="pre">dpkg-gencontrol</span></code> - generates binary package control files</a></li> <li><a class="reference internal" href="#dpkg-shlibdeps-calculates-shared-library-dependencies">3.1.4. <code class="docutils literal notranslate"><span class="pre">dpkg-shlibdeps</span></code> - calculates shared library dependencies</a></li> <li><a class="reference internal" href="#dpkg-distaddfile-adds-a-file-to-debian-files">3.1.5. <code class="docutils literal notranslate"><span class="pre">dpkg-distaddfile</span></code> - adds a file to <code class="docutils literal notranslate"><span class="pre">debian/files</span></code></a></li> <li><a class="reference internal" href="#dpkg-genchanges-generates-a-changes-upload-control-file">3.1.6. <code class="docutils literal notranslate"><span class="pre">dpkg-genchanges</span></code> - generates a <code class="docutils literal notranslate"><span class="pre">.changes</span></code> upload control file</a></li> <li><a class="reference internal" href="#dpkg-parsechangelog-produces-parsed-representation-of-a-changelog">3.1.7. <code class="docutils literal notranslate"><span class="pre">dpkg-parsechangelog</span></code> - produces parsed representation of a changelog</a></li> <li><a class="reference internal" href="#dpkg-architecture-information-about-the-build-and-host-system">3.1.8. <code class="docutils literal notranslate"><span class="pre">dpkg-architecture</span></code> - information about the build and host system</a></li> </ul> </li> <li><a class="reference internal" href="#the-debian-package-source-tree">3.2. The Debian package source tree</a><ul> <li><a class="reference internal" href="#debian-rules-the-main-building-script">3.2.1. <code class="docutils literal notranslate"><span class="pre">debian/rules</span></code> - the main building script</a></li> <li><a class="reference internal" href="#debian-substvars-and-variable-substitutions">3.2.2. <code class="docutils literal notranslate"><span class="pre">debian/substvars</span></code> and variable substitutions</a></li> <li><a class="reference internal" href="#debian-files">3.2.3. <code class="docutils literal notranslate"><span class="pre">debian/files</span></code></a></li> <li><a class="reference internal" href="#debian-tmp">3.2.4. <code class="docutils literal notranslate"><span class="pre">debian/tmp</span></code></a></li> </ul> </li> <li><a class="reference internal" href="#source-packages-as-archives">3.3. Source packages as archives</a></li> <li><a class="reference internal" href="#unpacking-a-debian-source-package-without-dpkg-source">3.4. Unpacking a Debian source package without <code class="docutils literal notranslate"><span class="pre">dpkg-source</span></code></a><ul> <li><a class="reference internal" href="#restrictions-on-objects-in-source-packages">3.4.1. Restrictions on objects in source packages</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="ap-pkg-binarypkg.html" title="previous chapter"><span class="section-number">2. </span>Binary packages (from old Packaging Manual)</a></p> <h4>Next topic</h4> <p class="topless"><a href="ap-pkg-controlfields.html" title="next chapter"><span class="section-number">4. </span>Control files and their fields (from old Packaging Manual)</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="_sources/ap-pkg-sourcepkg.rst.txt" rel="nofollow">Show Source</a></li> </ul> </div> <div id="searchbox" style="display: none" role="search"> <h3 id="searchlabel">Quick search</h3> <div class="searchformwrapper"> <form class="search" action="search.html" method="get"> <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> <input type="submit" value="Go" /> </form> </div> </div> <script>$('#searchbox').show(0);</script> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="ap-pkg-controlfields.html" title="4. Control files and their fields (from old Packaging Manual)" >next</a> |</li> <li class="right" > <a href="ap-pkg-binarypkg.html" title="2. Binary packages (from old Packaging Manual)" >previous</a> |</li> <li class="nav-item nav-item-0"><a href="index.html">Debian Policy Manual v4.6.0.1</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">3. </span>Source packages (from old Packaging Manual)</a></li> </ul> </div> <div class="footer" role="contentinfo"> Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.2.0. </div> </body> </html>