maint-guide HEAD - en to zh_CN translation catalogue (962 entries)

note: type: Attribute 'lang' of: <book>
en: en
zh_CN: zh-cn

note: type: Content of: <book><title>
en: Debian New Maintainers' Guide
zh_CN: Debian 新维护者手册

note: type: Content of: <book><bookinfo><authorgroup><author><contrib>
en: original contents
zh_CN: 原始内容

note: type: Content of: <book><bookinfo><authorgroup><author><personname>
en: Osamu Aoki
zh_CN: Osamu Aoki（青木修）

note: type: Content of: <book><bookinfo><authorgroup><author><contrib>
en: updated contents
zh_CN: 更新内容

note: type: Content of: <book><bookinfo><releaseinfo>
en: version &docversion;
zh_CN: 版本 &docversion;

note: type: Content of: <book><bookinfo><legalnotice><para>
en: This document may be used under the terms of the GNU General Public License version 2 or higher.
zh_CN: 本文档可在 GNU 通用公共许可证第二版或更高版本的条款规定下使用。

note: type: Content of: <book><bookinfo><legalnotice><para>
en: This document was made using these two documents as examples:
zh_CN: 本文档在撰写过程中参考了以下两篇文档：

note: type: Content of: <book><chapter><title>
en: Getting started The Right Way
zh_CN: 正确的起点

note: type: Content of: <book><appendix><para>
en: The rewrite of this tutorial document with updated contents and more practical examples is available as <ulink url="&guidedeb;">Guide for Debian Maintainers</ulink>.  Please use this new tutorial as the primary tutorial document.
zh_CN: 本教程文档已被重写为另外的 <ulink url="&guidedeb;">Debian 维护者指导</ulink> 文档，其中包含了更新的内容与更多实际例子。请使用新的教程作为主要的教程文档。

note: type: Content of: <book><chapter><para>
en: This document tries to describe the building of a Debian package to ordinary Debian users and prospective developers.  It uses fairly non-technical language, and it's well covered with working examples.  There is an old Latin saying: <emphasis>Longum iter est per praecepta, breve et efficax per exempla</emphasis> (It's a long way by the rules, but short and efficient with examples).
zh_CN: 本文档致力于为普通 Debian 用户，和希望对 Debian 软件包有所了解的开发人员讲述如何制作 Debian 软件包。在这里，我们尽可能使用通俗的语言，并辅以实例来直观地展示每一个细节。有一句古罗马谚语说得好：<emphasis>一例胜千言！</emphasis>

note: type: Content of: <book><chapter><para><footnote><para>
en: The document assumes you are using a <literal>&base-release;</literal> or newer system.  If you need to follow this text in an older system (including an older Ubuntu system etc.), you must install backported <systemitem role="package">dpkg</systemitem> and <systemitem role="package">debhelper</systemitem> packages, at least.
zh_CN: 在写这份文档时，我们默认你使用 <literal>&base-release;</literal> 或者更新的操作系统。如果你需要在 <literal>更老版本的</literal> 系统上（包括老版本的 Ubuntu 等）使用本文所记述的方法，则至少必须安装 backports 仓库中的 <systemitem role="package">dpkg</systemitem> 和 <systemitem role="package">debhelper</systemitem> 软件包。

note: type: Content of: <book><chapter><para>
en: This document is made available for the Debian <literal>Buster</literal> release since this offers many translations.  This document will be dropped in the following releases since contents are getting outdated.  <placeholder type="footnote" id="0"/>
zh_CN: 该文档在 Debian <literal>Buster</literal> 发布时仍然可用，因为它已提供了许多语言的翻译版本。该文档会在之后的 Debian 版本中被移除，因为其内容正在逐渐过时。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><para><footnote><para>
en: You can learn about the basic handling of a Debian system from the <ulink url="&debref;">Debian Reference</ulink>.  It contains some pointers to learn about Unix programming, too.
zh_CN: 在 <ulink url="&debref;">Debian Reference</ulink> 中，你可以了解到使用 Debian 系统的一些基本方法和关于 Unix 编程的一些指引。

note: type: Content of: <book><chapter><para>
en: One of the things that makes Debian such a top-notch distribution is its package system.  While there is a vast quantity of software already in the Debian format, sometimes you need to install software that isn't.  You may be wondering how you can make your own packages; and perhaps you think it is a very difficult task.  Well, if you are a real novice on Linux, it is hard, but if you were a rookie, you wouldn't be reading this document now&nbsp;:-)  You do need to know a little about Unix programming but you certainly don't need to be a wizard.  <placeholder type="footnote" id="0"/>
zh_CN: Debian 的软件包系统是使它跻身顶级发行版行列的重要原因之一。尽管已经有相当数量的软件被打包成 Debian 的格式，但有时还是需要安装一些并非该格式的软件。可能你正为如何制作自己的软件包而感到迷惑，也可能认为这么做很难。如果你是一个刚刚接触 Debian 的初学者，那么是的，它的确很难；不过假如你真的只是一个初入此门的新手，现在大概也不会来读这篇文档了。:-) 你的确需要对 Unix 编程有所了解，但显然没必要是这方面的天才。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><para>
en: One thing is certain, though: to properly create and maintain Debian packages takes many hours.  Make no mistake, for our system to work the maintainers need to be both technically competent and diligent.
zh_CN: 对于 Debian 软件包维护人员来说，有一件事是非常明确的：创建并维护一个 Debian 软件包需要花费很多精力，所需的时间很可能远不只是几个小时。维护人员需要有良好的技术基础，同时也需要十分勤奋，这样才能保证我们的系统正常运行而不出现问题。

note: type: Content of: <book><chapter><para>
en: If you need some help with packaging, please read <xref linkend="helpme"/>.
zh_CN: 如果你在软件包制作方面需要他人帮助，请阅读 <xref linkend="helpme"/>。

note: type: Content of: <book><chapter><para>
en: Newer versions of this document should always be available online at <ulink url="&maint-guide;"/> and in the <systemitem role="package">maint-guide</systemitem> package.  The translations may be available in packages such as <systemitem role="package">maint-guide-es</systemitem>.  Please note that this documentation may be slightly outdated.
zh_CN: 本文的最新版随时都可以在 <ulink url="&maint-guide;"/> 上和 <systemitem role="package">maint-guide</systemitem> 软件包里找到。文档的简体中文翻译可以在 <systemitem role="package">maint-guide-zh-cn</systemitem> 软件包里找到。还有一点需要注意的是，这篇文档的内容相对于当前的开发情况可能会有略微的延迟。

note: type: Content of: <book><chapter><para>
en: Since this is a tutorial, I choose to explain each detailed step for some important topics.  Some of them may look irrelevant to you.  Please be patient.  I have also intentionally skipped some corner cases and provided only pointers to keep this document simple.
zh_CN: 由于这是一份手把手的教程，所以在一些重要的话题上会对每个步骤都做详细的解释。虽然你可能觉得它们之中有一些与你的想法毫不相干，但也请准备好足够的耐心来学习。另外，我也有意地省略了某些不必要的细节，以使这篇文档尽可能保持简洁。

note: type: Content of: <book><chapter><section><title>
en: Social dynamics of Debian
zh_CN: Debian 的社会驱动力

note: type: Content of: <book><chapter><section><para>
en: Here are some observations of Debian's social dynamics, presented in the hope that it will prepare you for interactions with Debian:
zh_CN: 以下是一些有关 Debian 的社会动力学报告，希望它们能够帮助你做好准备，以与 Debian 进行交互：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: We all are volunteers.
zh_CN: 大家都是志愿者。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You cannot impose on others what to do.
zh_CN: 任何人都不能把事情强加给他人。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You should be motivated to do things by yourself.
zh_CN: 你应该主动地做自己想做的事情。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Friendly cooperation is the driving force.
zh_CN: 友好的合作是我们前行的动力。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Your contribution should not overstrain others.
zh_CN: 你的贡献不应致使他人增加负担。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Your contribution is valuable only when others appreciate it.
zh_CN: 只有当别人欣赏和感激你的贡献时，它才有真正的价值。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Debian is not your school where you get automatic attention of teachers.
zh_CN: Debian 并不是一所学校，在这里没有所谓的老师会自动地注意到你。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You should be able to learn many things by yourself.
zh_CN: 你需要有自学大量知识和技能的能力。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Attention from other volunteers is a very scarce resource.
zh_CN: 其他志愿者的关注是非常稀缺的资源。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Debian is constantly improving.
zh_CN: Debian 一直在不断进步。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You are expected to make high quality packages.
zh_CN: Debian 期望你制作出高质量的软件包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You should adapt yourself to change.
zh_CN: 你应该随时调整自己来适应世界的变化。

note: type: Content of: <book><chapter><section><para>
en: There are several types of people interacting around Debian with different roles:
zh_CN: 在 Debian 社区中有这几类常见的角色：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">upstream author</emphasis>: the person who made the original program.
zh_CN: <emphasis role="strong">Upstream author</emphasis> (上游作者)：程序的原始作者。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">upstream maintainer</emphasis>: the person who currently maintains the program.
zh_CN: <emphasis role="strong">Upstream maintainer</emphasis> (上游维护者)：目前在上游维护程序代码的人。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">maintainer</emphasis>: the person making the Debian package of the program.
zh_CN: <emphasis role="strong">Maintainer</emphasis> (软件包维护者)：制作并维护该程序 Debian 软件包的人。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">sponsor</emphasis>: a person who helps maintainers to upload packages to the official Debian package archive (after checking their contents).
zh_CN: <emphasis role="strong">Sponsor</emphasis> (赞助者)：帮助维护者上传软件包到 Debian 官方仓库的人（在通过内容检查之后）。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">mentor</emphasis>: a person who helps novice maintainers with packaging etc.
zh_CN: <emphasis role="strong">Mentor</emphasis> (导师)：帮助新手维护者熟悉和深入打包的人。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Debian Developer</emphasis> (DD): a member of the Debian project with full upload rights to the official Debian package archive.
zh_CN: <emphasis role="strong">Debian Developer</emphasis> (DD，Debian开发者)：Debian 社区的官方成员。DD 拥有向 Debian 官方仓库上传的全部权限。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <emphasis role="strong">Debian Maintainer</emphasis> (DM): a person with limited upload rights to the official Debian package archive.
zh_CN: <emphasis role="strong">Debian Maintainer</emphasis> (DM，Debian维护者)：拥有对 Debian 官方仓库部分上传权限的人。

note: type: Content of: <book><chapter><section><para>
en: Please note that you cannot become an official <emphasis role="strong">Debian Developer</emphasis> (DD) overnight, because it takes more than technical skill.  Please do not be discouraged by this.  If it is useful to others, you can still upload your package either as a <emphasis role="strong">maintainer</emphasis> through a <emphasis role="strong">sponsor</emphasis> or as a <emphasis role="strong">Debian Maintainer</emphasis>.
zh_CN: 注意，你不可能在一夜之间成为 <emphasis role="strong">Debian Developer</emphasis>，因为成为 DD 所需要的远不只是技术技巧。不过别因此而气馁，如果你的软件包对其他人有用，你可以当这个软件包的 <emphasis role="strong">Maintainer</emphasis>，然后通过一位 <emphasis role="strong">Sponsor</emphasis> 来上传这份软件，或者你可以申请成为 <emphasis role="strong">Debian Maintainer</emphasis>。

note: type: Content of: <book><chapter><section><para>
en: Please note that you do not need to create any new package to become an official Debian Developer.  Contributing to the existing packages can provide a path to becoming an official Debian Developer too.  There are many packages waiting for good maintainers (see <xref linkend="choose"/>).
zh_CN: 还有，要成为 Debian Developer 不一定要创建新软件包。对已有软件做出贡献也是成为 Debian Developer 的理想途径。眼下正有很多软件包等着好的维护者来接手(参看 <xref linkend="choose"/>)。

note: type: Content of: <book><chapter><section><para>
en: Since we focus only on technical aspects of packaging in this document, please refer to the following to learn how Debian functions and how you can get involved:
zh_CN: 在这篇文档里，我们的重点在于制作软件包的技术细节。有关 Debian 是如何运转的，以及如何才能参与到其中之类的话题，请参考下边的文档：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&logiciellibre;">Debian: 17 years of Free Software, "do-ocracy", and democracy</ulink> (Introductory slides)
zh_CN: <ulink url="&logiciellibre;">Debian: 17 years of Free Software, "do-ocracy", and democracy</ulink> (幻灯片介绍)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debianorghelp;">How can you help Debian?</ulink> (official)
zh_CN: <ulink url="&debianorghelp;">How can you help Debian?</ulink> (官方文档)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - "Contributing to the Debian Project"</ulink> (semi-official)
zh_CN: <ulink url="&debianfaqhelp;">The Debian GNU/Linux FAQ, Chapter 13 - "Contributing to the Debian Project"</ulink> (半官方文档)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (supplemental)
zh_CN: <ulink url="&debianwikihelp;">Debian Wiki, HelpDebian</ulink> (补充材料)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&nm-do;">Debian New Member site</ulink> (official)
zh_CN: <ulink url="&nm-do;">Debian New Member site</ulink> (官方站点)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (supplemental)
zh_CN: <ulink url="&debianmentorfaq;">Debian Mentors FAQ</ulink> (补充文档)

note: type: Content of: <book><chapter><section><title>
en: Programs needed for development
zh_CN: 需要的开发工具

note: type: Content of: <book><chapter><section><para>
en: Before you start anything, you should make sure that you have properly installed some additional packages needed for development.  Note that the list doesn't contain any packages marked <literal>essential</literal> or <literal>required</literal> - we expect that you have those installed already.
zh_CN: 在开始之前，请确认你是否已经正确安装了开发所需要的工具集。注意这些软件包中没有任何一个会被标记为 <literal>essential</literal> 或 <literal>required</literal> —— 这里假设你已经安装了它们。

note: type: Content of: <book><chapter><section><para>
en: The following packages come with the standard Debian installation, so you probably have them already (along with any additional packages they depend on).  Still, you should check them with <literal>aptitude show <replaceable>package</replaceable></literal> or with <literal>dpkg -s <replaceable>package</replaceable></literal>.
zh_CN: 以下这些软件包已经随标准的 Debian 安装过程进入了系统，所以你可能不需要再动手安装它们（以及任何附加的依赖软件包）。然而，你还是应该用 <literal>aptitude show <replaceable>package</replaceable></literal> 或者 <literal>dpkg -s <replaceable>package</replaceable></literal> 来检查一下。（译注：apt show PACKAGE 亦可）

note: type: Content of: <book><chapter><section><para>
en: The most important package to install on your development system is the <systemitem role="package">build-essential</systemitem> package.  Once you try to install that, it will <emphasis>pull in</emphasis> other packages required to have a basic build environment.
zh_CN: 在你的开发环境中，最重要的软件包是 <systemitem role="package">build-essential</systemitem>。一旦你尝试安装该包，它将 <emphasis>拉取</emphasis> 其他基本构建环境所需的工具链。

note: type: Content of: <book><chapter><section><para>
en: For some types of packages, that is all you will require; however, there is another set of packages that while not essential for all package builds are useful to have installed or may be required by your package:
zh_CN: 对于某些类型的软件，以上的就是所需要的全部。然而还有一组工具虽不是对于所有软件包都必须，却可能对你有用，或者你的软件包制作过程中会需要它们：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">autoconf</systemitem>, <systemitem role="package">automake</systemitem>, and <systemitem role="package">autotools-dev</systemitem> - many newer programs use configure scripts and <filename>Makefile</filename> files preprocessed with the help of programs like these (see <literal>info autoconf</literal>, <literal>info automake</literal>).  <systemitem role="package">autotools-dev</systemitem> keeps up-to-date versions of certain auto files and has documentation about the best way to use those files.
zh_CN: <systemitem role="package">autoconf</systemitem>、<systemitem role="package">automake</systemitem> 和 <systemitem role="package">autotools-dev</systemitem> - 很多新程序使用 configure 脚本和 <filename>Makefile</filename> 文件来帮助预处理程序。(参看 <literal>info autoconf</literal>、<literal>info automake</literal>)。 <systemitem role="package">autotools-dev</systemitem> 则用于保持指定的自动配置文件为最新，并带有关于使用那些文件的最佳方法的文档。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: There are also some more specialized but similar packages such as <systemitem role="package">dh-make-perl</systemitem>, <systemitem role="package">dh-make-php</systemitem>, etc.
zh_CN: 还有几个类似但更针对某一类软件的工具，如 <systemitem role="package">dh-make-perl</systemitem>、<systemitem role="package">dh-make-php</systemitem> 等。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">debhelper</systemitem> and <systemitem role="package">dh-make</systemitem> - <systemitem role="package">dh-make</systemitem> is necessary to create the skeleton of our example package, and it will use some of the <systemitem role="package">debhelper</systemitem> tools for creating packages.  They are not essential for this purpose, but are <emphasis>highly</emphasis> recommended for new maintainers.  It makes the whole process very much easier to start, and to control afterwards.  (See <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>debhelper</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.) <placeholder type="footnote" id="0"/>
zh_CN: <systemitem role="package">debhelper</systemitem> 和 <systemitem role="package">dh-make</systemitem> - <systemitem role="package">dh-make</systemitem> 是用于创建我们示例软件包骨架所必须的，它会使用 <systemitem role="package">debhelper</systemitem> 中的一些工具来创建软件包。他们不是创建软件包所必须的，但对新维护人员而言，我们 <emphasis>强烈推荐</emphasis>。它可以使整个过程极为简化，并易于在将来维护。(参看 <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>debhelper</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>、<filename>/usr/share/doc/debhelper/README</filename>)  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The new <systemitem role="package">debmake</systemitem> may be used as the alternative to the standard <systemitem role="package">dh-make</systemitem>.  It does more and comes with HTML documentation with extensive packaging examples in <systemitem role="package">debmake-doc</systemitem>.
zh_CN: 新的 <systemitem role="package">debmake</systemitem> 可以作为标准 <systemitem role="package">dh-make</systemitem> 的代替品。debmake 能做的事情更多，并且拥有包含非常多打包实例的 HTML 文档。文档可以通过 <systemitem role="package">debmake-doc</systemitem> 软件包获取。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">devscripts</systemitem> - this package contains some useful scripts that can be helpful for maintainers, but they are also not necessary for building packages.  Packages recommended and suggested by this package are worth looking into.  (See <filename>&devscripts-readme;</filename>.)
zh_CN: <systemitem role="package">devscripts</systemitem> - 此软件包提供了一些非常好且有用的脚本来帮助维护者，不过这写脚本并非制作软件包所必须。此软件包所推荐或建议的软件包都值得一看。(参看 <filename>&devscripts-readme;</filename>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">fakeroot</systemitem> - this utility lets you emulate being root, which is necessary for some parts of the build process.  (See <citerefentry> <refentrytitle>fakeroot</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">fakeroot</systemitem> - 这个工具使你可以在编译过程中必要的时候以普通用户来模拟 root 用户环境。 (参看 <citerefentry> <refentrytitle>fakeroot</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">file</systemitem> - this handy program can determine what type a file is.  (See <citerefentry> <refentrytitle>file</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">file</systemitem> - 这个小程序可以检测文件的类型。(参看 <citerefentry> <refentrytitle>file</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">gfortran</systemitem> - the GNU Fortran 95 compiler, necessary if your program is written in Fortran.  (See <citerefentry> <refentrytitle>gfortran</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">gfortran</systemitem> - GNU Fortran 95 编译器，如果你的程序是用 Fortran 编写的则必须用此工具完成编译。(参看 <citerefentry> <refentrytitle>gfortran</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">git</systemitem> - this package provides a popular version control system designed to handle very large projects with speed and efficiency; it is used for many high profile open source projects, most notably the Linux kernel.  (See <citerefentry> <refentrytitle>git</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, git Manual (<filename>&git-doc;</filename>).)
zh_CN: <systemitem role="package">git</systemitem> - 此软件包提供了用于快捷处理大型项目的著名版本控制系统 - git。它被广泛用于各种开源项目，其中最著名的是 Linux 内核项目。(参见 <citerefentry> <refentrytitle>git</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, git Manual (<filename>&git-doc;</filename>).)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">gnupg</systemitem> - a tool that enables you to digitally <emphasis>sign</emphasis> packages.  This is especially important if you want to distribute packages to other people, and you will certainly be doing that when your work gets included in the Debian distribution.  (See <citerefentry> <refentrytitle>gpg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">gnupg</systemitem> - 让你可以使用 <emphasis>数字签名</emphasis> 签署你的软件包。当你想把它分发给其他人时这一点特别重要。如果你要把你的成果加入到 Debian 发行版中，那这是必须的步骤。(参看 <citerefentry> <refentrytitle>gpg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">gpc</systemitem> - the GNU Pascal compiler, necessary if your program is written in Pascal.  Worthy of note here is <systemitem role="package">fp-compiler</systemitem>, the Free Pascal Compiler, which is also good at this task.  (See <citerefentry> <refentrytitle>gpc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>ppc386</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">gpc</systemitem> - GNU Pascal 编译器。如果你的程序是用 Pascal 写的则需要此工具。值得一提的是 <systemitem role="package">fp-compiler</systemitem>，Free Pascal 编译器(FPC)，也能够很好地胜任编译任务。(参见 <citerefentry> <refentrytitle>gpc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>ppc386</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">lintian</systemitem> - this is the Debian package checker, which lets you know of any common mistakes after you build the package and explains the errors found.  (See <citerefentry> <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <ulink url="&lintian-doc;">Lintian User's Manual</ulink>.)
zh_CN: <systemitem role="package">lintian</systemitem> - Debian 软件包检查工具，使你可以在编译软件包后知道它是否犯了常见的错误，并对其找到的错误进行解释。 (参见 <citerefentry> <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <ulink url="&lintian-doc;">Lintian User's Manual</ulink>.)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">patch</systemitem> - this very useful utility will take a file containing a difference listing (produced by the <command>diff</command> program) and apply it to the original file, producing a patched version.  (See <citerefentry> <refentrytitle>patch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">patch</systemitem> - 这是一个非常有用的工具，它可以把 <command>diff</command> 程序生成的差异清单文件应用到原先的文件上，从而生成一个打了补丁的版本。(参看 <citerefentry> <refentrytitle>patch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">patchutils</systemitem> - this package contains some utilities to work with patches such as the <command>lsdiff</command>, <command>interdiff</command> and <command>filterdiff</command> commands.
zh_CN: <systemitem role="package">patchutils</systemitem> - 此软件包提供了一些帮助处理补丁的工具，如 <command>lsdiff</command>、<command>interdiff</command> 和 <command>filterdiff</command> 命令。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">pbuilder</systemitem> - this package contains programs which are used for creating and maintaining a <command>chroot</command> environment.  Building a Debian package in this <command>chroot</command> environment verifies the proper build dependency and avoids FTBFS (Fails To Build From Source) bugs.  (see <citerefentry> <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> and <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)
zh_CN: <systemitem role="package">pbuilder</systemitem> - 此软件包提供了创建和维护 <command>chroot</command> 环境的工具。在它的 <command>chroot</command> 环境中编译 Debian 软件包可以检查编译依赖是否合适，并避免 FTBFS (Fails To Build From Source，源代码编译失败)的 Bug。(参看 <citerefentry> <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> 和 <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">perl</systemitem> - Perl is one of the most used interpreted scripting languages on today's Unix-like systems, often referred to as Unix's Swiss Army Chainsaw. (See <citerefentry> <refentrytitle>perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">perl</systemitem> - Perl 是现今类Unix系统中使用最普遍的解释型脚本语言，它常被称作Unix的瑞士军刀。(参看 <citerefentry> <refentrytitle>perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">python</systemitem> - Python is another of the most used interpreted scripting languages on the Debian system, combining remarkable power with very clear syntax. (See <citerefentry> <refentrytitle>python</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">python</systemitem> - Python 是 Debian 系统中另一个最常用的解释型脚本语言，它拥有着可圈可点的强大功能和十分清晰的语法。(参看 <citerefentry> <refentrytitle>python</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">quilt</systemitem> - this package helps you to manage large numbers of patches by keeping track of the changes each patch makes. Patches can be applied, un-applied, refreshed, and more.  (See <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum></citerefentry>, and <filename>&quilt-pdf;</filename>.)
zh_CN: <systemitem role="package">quilt</systemitem> - 此软件包帮助你管理一系列的补丁。它们被以逻辑栈的方式组织在一起。你可以 apply (=push)、un-apply (=pop)  或简单地刷新它们然后再放入栈内。(参看 <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum></citerefentry>, and <filename>&quilt-pdf;</filename>.)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">xutils-dev</systemitem> - some programs, usually those made for X11, also use these programs to generate <filename>Makefile</filename> files from sets of macro functions.  (See <citerefentry> <refentrytitle>imake</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>xmkmf</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.)
zh_CN: <systemitem role="package">xutils-dev</systemitem> - 一些通常用于 X11 的程序，使用其宏功能可以生成 <filename>Makefile</filename> 文件。(参看 <citerefentry> <refentrytitle>imake</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>xmkmf</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)

note: type: Content of: <book><chapter><section><para>
en: The short descriptions that are given above only serve to introduce you to what each package does.  Before continuing please read the documentation of each relevant program including ones installed through the package dependency such as <command>make</command>, at least, for the standard usage.  It may seem like heavy going now, but later on you'll be <emphasis>very</emphasis> glad you read it.  If you have specific questions later, I would suggest re-reading the documents mentioned above.
zh_CN: 以上给出的简短描述仅仅是为了使你对这些工具有一个基本的印象。在继续前请详细阅读每个程序（包括通过依赖关系安装的程序，比如<command>make</command>）的文档，至少了解其一般的用途和用法。现在看来这是一项耗时巨大的任务，但在接下来的工作中你将为你阅读了它们而感觉到 <emphasis>非常</emphasis> 愉快。如果一会你遇到一些特定的问题，我会建议你重新阅读上面提到的文档。

note: type: Content of: <book><chapter><section><title>
en: Documentation needed for development
zh_CN: 需要的开发文档

note: type: Content of: <book><chapter><section><para>
en: The following is the <emphasis>very important</emphasis> documentation which you should read along with this document:
zh_CN: 以下是 <emphasis>非常重要</emphasis> 的文档，你应该在读本文档时同时参看它们：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy Manual</ulink> includes explanations of the structure and contents of the Debian archive, several OS design issues, the <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink> (FHS, which says where each file and directory should be), etc.  For you, the most important thing is that it describes requirements that each package must satisfy to be included in the distribution. (See the local copies of <filename>&policy-pdf;</filename> and <filename>&fhs-pdf;</filename>.)
zh_CN: <systemitem role="package">debian-policy</systemitem> - the <ulink url="&debian-policy;">Debian Policy Manual</ulink> 包含了对 Debian 软件仓库、操作系统设计问题、文件系统层级标准(FHS，<ulink url="&fhs;">Filesystem Hierarchy Standard</ulink>，讲述每个文件和目录应该放在哪里)等的描述。对于你而言，最重要的是它描述了软件包进入官方仓库前必须满足的条件。(请参见 <filename>&policy-pdf;</filename> 和 <filename>&fhs-pdf;</filename> 的本地副本)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">developers-reference</systemitem> - the <ulink url="&developers-reference;">Debian Developer's Reference</ulink> describes all matters not specifically about the technical details of packaging, like the structure of the archive, how to rename, orphan, or adopt packages, how to do NMUs, how to manage bugs, best packaging practices, when and where to upload, etc.  (See the local copy of <filename>&developers-refpdf;</filename>.)
zh_CN: <systemitem role="package">developers-reference</systemitem> - <ulink url="&developers-reference;">Debian 开发者参考</ulink> 描述了打包所需的包含技术细节在内的全部详细信息，如仓库结构、如何重命名/丢弃/接手软件包、如何进行 NMU(非维护者上传)、如何管理 Bug 以及打包最佳实践、何时向何处上传等。(参见 <filename>&developers-refpdf;</filename> 的本地副本)

note: type: Content of: <book><chapter><section><para>
en: The following is the <emphasis>important</emphasis> documentation which you should read along with this document:
zh_CN: 以下是 <emphasis>重要</emphasis> 的文档，你应该在读本文档时同时参看它们：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> provides a very good tutorial for <ulink url="&gnu-build-system;">the GNU Build System known as the GNU Autotools</ulink>, whose most important components are Autoconf, Automake, Libtool, and gettext.
zh_CN: <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> 为 <ulink url="&gnu-build-system;">the GNU Build System known as the GNU Autotools</ulink> 中最重要的工具 —— Autoconf、Automake、Libtool 和 gettext 提供了很好的文档。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">gnu-standards</systemitem> - this package contains two pieces of documentation from the GNU project: <ulink url="&gnu-standard;">GNU Coding Standards</ulink>, and <ulink url="&gnu-maintainer;">Information for Maintainers of GNU Software</ulink>.  Although Debian does not require these to be followed, these are still helpful as guidelines and common sense.  (See the local copies of <filename>&gnu-standard-pdf;</filename> and <filename>&gnu-maintainer-pdf;</filename>.)
zh_CN: <systemitem role="package">gnu-standards</systemitem> - 此软件包包含了 GNU 项目中的两篇文档： <ulink url="&gnu-standard;">GNU Coding Standards</ulink> 和 <ulink url="&gnu-maintainer;">Information for Maintainers of GNU Software</ulink>。尽管 Debian 不要求遵守这些规范，但它们作为纲领和共识仍然很有帮助。(参见 <filename>&gnu-standard-pdf;</filename> 和 <filename>&gnu-maintainer-pdf;</filename> 的本地副本)

note: type: Content of: <book><chapter><section><para>
en: If this document contradicts any of the documents mentioned above, they are correct.  Please file a bug report on the <systemitem role="package">maint-guide</systemitem> package using <command>reportbug</command>.
zh_CN: 若本文档所叙述的内容与 Debian Policy Manual 或 Debian Developer's Reference 有不符，则按照后两者的要求为准，并向 <systemitem role="package">maint-guide</systemitem> 软件包提交 Bug 报告。

note: type: Content of: <book><chapter><section><para>
en: The following is an alternative tutorial document that you may read along with this document:
zh_CN: 以下是替代性的教程文档，你可以在读本文档时同时参看它们：

note: type: Content of: <book><chapter><section><title>
en: Where to ask for help
zh_CN: 到何处求助

note: type: Content of: <book><chapter><section><para>
en: Before you decide to ask your question in some public place, please read this fine documentation:
zh_CN: 在你决定到公共场合提问之前，请先阅读这些（个）不错的文档：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: files in <filename>/usr/share/doc/<replaceable>package</replaceable></filename> for all pertinent packages
zh_CN: 所有相关软件包的 <filename>/usr/share/doc/<replaceable>package</replaceable></filename> 目录之中的文件

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: contents of <literal><command>man</command> <replaceable>command</replaceable></literal> for all pertinent commands
zh_CN: 所有相关命令的 <literal><command>man</command> <replaceable>command</replaceable></literal> 手册页

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: contents of <literal><command>info</command> <replaceable>command</replaceable></literal> for all pertinent commands
zh_CN: 所有相关命令的 <literal><command>info</command> <replaceable>command</replaceable></literal> info 页

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: contents of <ulink url="&debian-mentors-ldo;">debian-mentors@lists.debian.org mailing list archive</ulink>
zh_CN: 邮件列表档案 <ulink url="&debian-mentors-ldo;">debian-mentors@lists.debian.org</ulink>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: contents of <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org mailing list archive</ulink>
zh_CN: 邮件列表档案 <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org </ulink>

note: type: Content of: <book><chapter><section><para>
en: You can use web search engines more effectively by including search strings such as <literal>site:lists.debian.org</literal> to limit the domain.
zh_CN: 在搜索时你可以在搜索引擎中使用类似这样的字符串 :<literal>site:lists.debian.org</literal> ，以此限制域名从而提高效率。

note: type: Content of: <book><chapter><section><para>
en: Making a small test package is a good way to learn details of packaging.  Inspecting existing well maintained packages is the best way to learn how other people make packages.
zh_CN: 制作小的测试软件包是学习打包细节的好方法，仔细查看维护较好的软件包则是了解他人如何制作软件包的最佳办法。

note: type: Content of: <book><chapter><section><para>
en: If you still have questions about packaging that you couldn't find answers to in the available documentation and web resources, you can ask them interactively:
zh_CN: 如果你仍然对打包存有疑问，并且在文档和WEB资源中都不能找到答案，你可以交互式地向他们提问：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debian-mentors-ldo;">debian-mentors@lists.debian.org mailing list</ulink>. (This mailing list is for the novice.)
zh_CN: <ulink url="&debian-mentors-ldo;">&debian-mentors-ldo;</ulink>邮件 <ulink url="&debian-mentors-ldo;">debian-mentors@lists.debian.org </ulink>. (该邮件列表是新手专区。)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org mailing list</ulink>. (This mailing list is for the expert.)
zh_CN: <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org </ulink>. (该邮件列表汇集各路神仙。)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&irc-debian;">IRC</ulink> such as <literal>#debian-mentors</literal>.
zh_CN: <ulink url="&irc-debian;">IRC</ulink> 比如 <literal>#debian-mentors</literal>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Teams focusing on a specific set of packages. (Full list at <ulink url="&wikiteams;">https://wiki.debian.org/Teams</ulink>)
zh_CN: 专注于某个软件包集合的团队。 (完整列表参见 <ulink url="&wikiteams;">https://wiki.debian.org/Teams</ulink>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Language-specific mailing lists such as debian-devel-{french,italian,portuguese,spanish}@lists.debian.org or debian-devel@debian.or.jp. (Full listing at <ulink url="&listdevel;">https://lists.debian.org/devel.html</ulink> and <ulink url="&listusers;">https://lists.debian.org/users.html</ulink>)
zh_CN: 特定语言的邮件列表，比如 debian-devel-{french,italian,portuguese,spanish}@lists.debian.org 或 debian-devel@debian.or.jp. (完整列表参见 <ulink url="&listdevel;">https://lists.debian.org/devel.html</ulink> 和 <ulink url="&listusers;">https://lists.debian.org/users.html</ulink>)

note: type: Content of: <book><chapter><section><para>
en: The more experienced Debian developers will gladly help you, if you ask properly after making your required efforts.
zh_CN: 如果你付出了一定的努力并且提问得当，那么有经验的 Debian 开发者会很乐意帮助你的。

note: type: Content of: <book><chapter><section><para>
en: When you receive a bug report (yes, actual bug reports!), you will know that it is time for you to dig into the <ulink url="&bts;">Debian Bug Tracking System</ulink> and read the documentation there, to be able to deal with the reports efficiently.  I highly recommend reading the <ulink url="&devref-bug-handling;">Debian Developer's Reference, 5.8.  "Handling bugs"</ulink>.
zh_CN: 当你收到一个 Bug 报告后 (没错，真正的 Bug 报告！)，你需要研究 <ulink url="&bts;">Debian Bug Tracking System</ulink> (Debian Bug 追踪系统，BTS)并阅读相关的文档以便高效处理这些报告。我在此强烈推荐阅读 <ulink url="&devref-bug-handling;">Developer's Reference, 5.8.  "Handling bugs"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: Even if it all worked well, it's time to start praying.  Why? Because in just a few hours (or days) users from all around the world will start to use your package, and if you made some critical error you'll get mailbombed by numerous angry Debian users&#x2026; Just kidding.  :-)
zh_CN: 即使上边的那些问题都解决了，也不能高兴得太早。为什么？因为几个小时或几天内就会有人开始使用你的软件包，如果你犯了某些严重的错误，将会被无数生气的 Debian 用户进行邮件轰炸…… 哦，当然这只是开个玩笑。:-)

note: type: Content of: <book><chapter><section><para>
en: Relax and be ready for bug reports, because there is a lot more work to be done before your package will be fully in line with Debian policies and its best practice guidelines (once again, read the <emphasis>real documentation</emphasis> for details).  Good luck!
zh_CN: 放松一点并准备好处理 Bug 报告，在你的软件包完全符合 Debian 的各项规范前你还需要付出很多努力，处理 Bug 对你也是很好的锻炼 (再一次提醒，阅读那些 <emphasis>必须的文档</emphasis> 来了解详情)。祝你好运！

note: type: Content of: <book><chapter><title>
en: First steps
zh_CN: 第一步

note: type: Content of: <book><chapter><para>
en: Let's start by creating a package of your own (or, even better, adopting an existing one).
zh_CN: 让我们来创建一个自己的软件包 (更好的是，“领养”一个已存在的软件包)。

note: type: Content of: <book><chapter><section><title>
en: Debian package building workflow
zh_CN: Debian 软件包制作流程

note: type: Content of: <book><chapter><section><para>
en: If you are making a Debian package with an upstream program, the typical workflow of Debian package building involves generating several specifically named files for each step as follows:
zh_CN: 如果你的工作基于某个上游程序，那么典型的 Debian 软件包制作流程就会需要如下几个特定的文件：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Get a copy of the upstream software, usually in a compressed tar format.
zh_CN: 获取一份上游软件的拷贝，它通常为压缩过的 tar 格式。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Add Debian-specific packaging modifications to the upstream program under the <filename>debian</filename> directory, and create a non-native source package (that is, the set of input files used for Debian package building) in <literal>3.0 (quilt)</literal> format.
zh_CN: 在上游源码的 <filename>debian</filename> 目录下添加 Debian 打包的专用文件 （构建 Debian 软件包它们会被读取），同时以 <literal>3.0 (quilt)</literal> 格式创建一个非本地源码包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><footnote><para>
en: For the older style of non-native Debian source packages in <literal>1.0</literal> format, <literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal> is used instead.
zh_CN: 对于老式的 <literal>1.0</literal> 格式非本地 Debian 源码包，应当使用 <literal><replaceable>package</replaceable>_<replaceable>version</replaceable>-<replaceable>revision</replaceable>.diff.gz</literal> 这个命名规则。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Build Debian binary packages, which are ordinary installable package files in <literal>.deb</literal> format (or <literal>.udeb</literal> format, used by the Debian Installer) from the Debian source package.
zh_CN: 用 Debian 源码包构建 Debian 二进制包；这些二进制包的格式通常是<literal>.deb</literal> (或者 <literal>.udeb</literal>，Debian Installer 专用)

note: type: Content of: <book><chapter><section><para>
en: Please note that the character separating <literal><replaceable>package</replaceable></literal> and <literal><replaceable>version</replaceable></literal> was changed from <literal>-</literal> (hyphen) in the tarball name to <literal>_</literal> (underscore) in the Debian package filenames.
zh_CN: 请注意一个细节，在 Debian 软件包的文件名中，分隔 <literal><replaceable>package</replaceable></literal> 和 <literal><replaceable>version</replaceable></literal> 的字符从 tarball 名称中的 <literal>-</literal> (连字符)换成了 <literal>_</literal> (下划线)。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-source;">5.6.1 "Source"</ulink>, <ulink url="&policy-package;">5.6.7 "Package"</ulink>, and <ulink url="&policy-version;">5.6.12 "Version"</ulink>.  The <emphasis role="strong">package architecture</emphasis> follows the <ulink url="&policy-architecture;">Debian Policy Manual, 5.6.8 "Architecture"</ulink> and is automatically assigned by the package build process.
zh_CN: 参见 <ulink url="&policy-source;">5.6.1 "Source"</ulink>, <ulink url="&policy-package;">5.6.7 "Package"</ulink>, 以及 <ulink url="&policy-version;">5.6.12 "Version"</ulink>。 <emphasis role="strong">package architecture</emphasis> 遵循 <ulink url="&policy-architecture;">Debian Policy Manual, 5.6.8 "Architecture"</ulink> 并且会在软件包构建的过程中被自动分配。

note: type: Content of: <book><chapter><section><para>
en: In the file names above, replace the <literal><replaceable>package</replaceable></literal> part with the <emphasis role="strong">package name</emphasis>, the <literal><replaceable>version</replaceable></literal> part with the <emphasis role="strong">upstream version</emphasis>, the <literal><replaceable>revision</replaceable></literal> part with the <emphasis role="strong">Debian revision</emphasis>, and the <literal><replaceable>arch</replaceable></literal> part with the <emphasis role="strong">package architecture</emphasis>, as defined in the Debian Policy Manual.  <placeholder type="footnote" id="0"/>
zh_CN: 在上述的文件名中，请根据 Debian Policy，将 <literal><replaceable>package</replaceable></literal> 这个部分替换为 <emphasis role="strong">package name</emphasis>， 将 <literal><replaceable>version</replaceable></literal> 这个部分替换为 <emphasis role="strong">upstream version</emphasis>， 将<literal><replaceable>revision</replaceable></literal> 这个部分替换为 <emphasis role="strong">Debian revision</emphasis>，以及将 <literal><replaceable>arch</replaceable></literal> 这个部分替换为 <emphasis role="strong">package architecture</emphasis>。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: Each step of this outline is explained with detailed examples in later sections.
zh_CN: 本概要中的每一步，我们都会在后续的章节中辅以详细的例子进行解释。

note: type: Content of: <book><chapter><section><title>
en: Choose your program
zh_CN: 挑一个你喜欢的程序

note: type: Content of: <book><chapter><section><para>
en: You have probably chosen the package you want to create.  The first thing you need to do is check if the package is in the distribution archive already by using the following:
zh_CN: 可能你已经想好了要制作的软件包。那此时第一件要做的事，就是检查它是否已经被别人打包，并已经安置于发行版仓库中。这里有几种检查方法供您参考：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: the <command>aptitude</command> command
zh_CN: <command>aptitude</command> 命令

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: the <ulink url="&packages-do;">Debian packages</ulink> web page
zh_CN: the <ulink url="&packages-do;">Debian packages</ulink> 页面

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: the <ulink url="&debtrack;">Debian Package Tracker</ulink> web page
zh_CN: <ulink url="&debtrack;">Debian 软件包追踪系统</ulink> 网页

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&devref-adopt;">Debian Developer's Reference 5.9.5 "Adopting a package"</ulink>.
zh_CN: 参见 <ulink url="&devref-adopt;">Debian Developer's Reference 5.9.5.  "Adopting a package"</ulink>.

note: type: Content of: <book><chapter><section><para>
en: If the package already exists, well, install it! :-) If it happens to be <emphasis role="strong">orphaned</emphasis> (that is, if its maintainer is set to <ulink url="&qa-do;">Debian QA Group</ulink>), you may be able to pick it up if it's still available.  You may also adopt a package whose maintainer has filed a Request for Adoption (<emphasis role="strong">RFA</emphasis>).<placeholder type="footnote" id="0"/>
zh_CN: 如果软件包已经存在于仓库中，那直接装上它就可以了呀！:-) 如果它是被 <emphasis role="strong">甩掉了(orphaned)</emphasis> 的 —— 也就是说它的维护者被设置为 <ulink url="&qa-do;">Debian QA Group</ulink>，这时候你可以尝试接手维护它。另外，你也可以“领养”那些维护者发送过“Request for Adoption”(<emphasis role="strong">RFA</emphasis>)请求的软件包。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: There are several package ownership status resources:
zh_CN: 软件包归属状态有这几种：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The <command>wnpp-alert</command> command from the <systemitem role="package">devscripts</systemitem> package
zh_CN: <command>wnpp-alert</command> 命令，来自 <systemitem role="package">devscripts</systemitem> 软件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <ulink url="&wnpp-bts;">Debian Bug report logs: Bugs in pseudo-package <systemitem role="package">wnpp</systemitem> in <literal>unstable</literal></ulink>
zh_CN: <ulink url="&wnpp-bts;">Debian Bug report logs: Bugs in pseudo-package <systemitem role="package">wnpp</systemitem> 位于 <literal>unstable</literal></ulink>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Having said that, there will of course always be new programs that are worth packaging.
zh_CN: 当然了，无论何时，总会有一些值得打包，而且并未进入 Debian 仓库的新软件。

note: type: Content of: <book><chapter><section><para>
en: As a side note, it's important to point out that Debian already has packages for most kinds of programs, and the number of packages already in the Debian archive is much larger than that of contributors with upload rights.  Thus, contributions to packages already in the archive are far more appreciated (and more likely to receive sponsorship) by other developers <placeholder type="footnote" id="0"/>.  You can contribute in various ways:
zh_CN: 作为旁注必须指出，Debian 已经拥有了海量各种类型的软件包，而且处在仓库中软件包的数量也远远超过了拥有上传权限的贡献者数量。因此，为已经在仓库中的软件包贡献力量是非常受其他开发者欢迎的 (且更容易获得 sponsorship)<placeholder type="footnote" id="0"/>。有非常多的方式可以实现这一目的：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: taking over orphaned, yet actively used, packages
zh_CN: 接手那些已经被甩掉，而仍然有很多人在使用的软件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: joining <ulink url="&teams;">packaging teams</ulink>
zh_CN: 加入一些 <ulink url="&teams;">打包小组</ulink>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: triaging bugs of very popular packages
zh_CN: 帮忙为某些常用软件分类 Bug

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: preparing <ulink url="&devref-nmu;">QA or NMU uploads</ulink>
zh_CN: 在必要时，帮忙准备 <ulink url="&devref-nmu;">QA 或 NMU 上传</ulink>

note: type: Content of: <book><chapter><section><para>
en: If you are able to adopt the package, get the sources (with something like <literal>apt-get source <replaceable>packagename</replaceable></literal>) and examine them.  This document unfortunately doesn't include comprehensive information about adopting packages.  Thankfully you shouldn't have a hard time figuring out how the package works since someone has already done the initial setup for you.  Keep reading, though; a lot of the advice below will still be applicable to your case.
zh_CN: 如果你有能力“领养”那个软件包，那就先下载 (使用 <literal>apt-get source <replaceable>packagename</replaceable></literal> 或其他类似的工具)并分析它的源代码。这篇文档不会详细说明如何领养软件包，不过幸运的是，领养软件包时，打包的起始工作已经有人完成，接手的工作应比从头开始轻松得多。尽管如此也请您不要轻敌，请继续阅读，下面给出的建议会对你很有帮助。

note: type: Content of: <book><chapter><section><para>
en: If the package is new, and you decide you'd like to see it in Debian, proceed as follows:
zh_CN: 如果您要制作的软件包是完全崭新的，而您又希望它出现在 Debian 中，那请遵循以下的步骤：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: First, you must know that the program works, and have tried it for some time to confirm its usefulness.
zh_CN: 首先，你必须知道这个软件能不能干活，而且你需要亲自试用一段时间来确保其可用性。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: You must check that no one else is already working on the package on the <ulink url="&wnpp-do;">Work-Needing and Prospective Packages</ulink> site.  If no one else is working on it, file an ITP (Intent To Package) bug report to the <systemitem role="package">wnpp</systemitem> pseudo-package using <command>reportbug</command>.  If someone's already on it, contact them if you feel you need to.  If not &#x2014; find another interesting program that nobody is maintaining.
zh_CN: 一定要在 <ulink url="&wnpp-do;being_packaged">Work-Needing and Prospective Packages</ulink> 上仔细查看，以确定并没有其他人已经开始相关的工作。如果没有的话，则可以提交一份 ITP (Intent To Package，打包意向) Bug 报告给 <systemitem role="package">wnpp</systemitem> 虚包 (可以使用 <command>reportbug</command>)。如果你看到已经有人在处理相关事宜，则在有需要的情况下再联系他(们)。如果他(们)不需要你的帮助，那就寻找其他你感兴趣，而且没有人维护的软件包咯。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The software <emphasis role="strong">must have a license</emphasis>.
zh_CN: 软件 <emphasis role="strong">必须有许可证</emphasis>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: For the <literal>main</literal> section, Debian Policy requires it <emphasis role="strong">to be fully compliant with the Debian Free Software Guidelines</emphasis> (<ulink url="&dfsg;">DFSG</ulink>)  and <emphasis role="strong">not to require a package outside of <literal>main</literal></emphasis> for compilation or execution.  This is the desired case.
zh_CN: 对于仓库中 <literal>main</literal> 区的软件， Debian Policy 要求其 <emphasis role="strong"> 完全兼容 Debian Free Software Guidelines （Debian 自由软件准则）</emphasis> (<ulink url="&dfsg;">DFSG</ulink>) 并且它 <emphasis role="strong"> 不能要求使用 <literal>main</literal></emphasis> 区以外的软件来编译或执行。这即是最理想的状况。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: For the <literal>contrib</literal> section, it must comply with the DFSG but it may require a package outside of <literal>main</literal> for compilation or execution.
zh_CN: 对于仓库中 <literal>contrib</literal> 区的软件，其许可证必须满足 DFSG 的全部条件，不同于 main 区软件的一点是，它们可以依赖于 <literal>main</literal> 之外的软件包来完成编译或运行。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: For the <literal>non-free</literal> section, it may be non-compliant with the DFSG but it <emphasis role="strong">must be distributable</emphasis>.
zh_CN: 对于仓库中 <literal>non-free</literal> 区的软件，其许可证可以不满足 DFSG 中的一部分条件。其中坚决不能违背的一点是，该软件 <emphasis role="strong">必须是可分发的</emphasis>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: If you are unsure about where it should go, post the license text on <ulink url="&debian-legal-ldo;">debian-legal@lists.debian.org</ulink> and ask for advice.
zh_CN: 如果你不确定你的软件应该归入仓库的哪一个区，那你可以把许可证文本发送到 <ulink url="&debian-legal-ldo;">debian-legal@lists.debian.org</ulink> 邮件列表上寻求意见。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The program should <emphasis role="strong">not</emphasis> introduce security and maintenance concerns into the Debian system.
zh_CN: 程序 <emphasis role="strong">不能</emphasis> 给 Debian 系统带来安全或维护问题。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: The program should be well documented and its code needs to be understandable (i.e., not obfuscated).
zh_CN: 程序应当带有良好的文档，最好是源代码也容易理解 （比如，不混乱）。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: You should contact the program's author(s) to check if they agree with packaging it and are amicable to Debian.  It is important to be able to consult with the author(s)  in case of any problems with the program, so don't try to package unmaintained software.
zh_CN: 你应该与程序的作者取得联系，问问他是否认为程序应当被打包，以及他是否对 Debian 持友好态度。能够询问作者关于程序的任何问题都非常重要，所以千万不要尝试打包一个无人维护的软件 （遇到麻烦找谁去呢）。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: The program certainly should <emphasis role="strong">not</emphasis> run setuid root, or even better, it shouldn't need to be setuid or setgid to anything.
zh_CN: 程序一定 <emphasis role="strong">不能</emphasis> setuid 到 root 。如果它不 setuid 或 setgid 到任何用户或组的话，那就再好不过了。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: The program should not be a daemon, or go in an <filename>*/sbin</filename> directory, or open a port as root.
zh_CN: 程序不应该是守护进程，也不应该进入任何一个 <filename>*/sbin</filename> 目录，不应该以 root 权限打开任何端口。

note: type: Content of: <book><chapter><section><para>
en: Of course, the last one is just a safety measure, and is intended to save you from enraging users if you do something wrong in some setuid daemon&#x2026; When you gain more experience in packaging, you'll be able to package such software.
zh_CN: 当然，这些都是为了安全，并试图避免你在，比如 setuid 守护进程等问题上犯错误而激怒了用户 ...  当你在打包方面有了更多经验时，就能够处理这样的软件包了，不必着急。

note: type: Content of: <book><chapter><section><para>
en: As a new maintainer, you are encouraged to get some experience in packaging with easier packages and discouraged from creating complicated packages.
zh_CN: 我们鼓励你，作为一个新维护者，选择易于打包和维护的软件，而不鼓励选择复杂的软件包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Simple packages
zh_CN: 简单软件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: single binary package, arch = all (collection of data such as wallpaper graphics)
zh_CN: 生成单个二进制包，arch = all （比如像壁纸那样的资料集）

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: single binary package, arch = all (executables written in an interpreted language such as POSIX shell)
zh_CN: 生成单个二进制包，arch = all （用解释型语言编写的可执行脚本文件，比如 POSIX shell 语言）

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Intermediate complexity packages
zh_CN: 中等复杂软件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: single binary package, arch = any (ELF binary executables compiled from languages such as C and C++)
zh_CN: 生成单个二进制包，arch = any （用C/C++等语言编写的 ELF 二进制可执行文件）

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: multiple binary packages, arch = any + all (packages for ELF binary executables + documentation)
zh_CN: 生成多个二进制包，arch = any + all （包含ELF二进制可执行程序+文档）

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: upstream source in a format other than <filename>tar.gz</filename> or <filename>tar.bz2</filename>
zh_CN: 既不是 <filename>tar.gz</filename> 也不是 <filename>tar.bz2</filename> 格式的上游源代码包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: upstream source containing undistributable contents
zh_CN: 包含不可分发的内容物的源码包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: High complexity packages
zh_CN: 高复杂度软件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: interpreter module package used by other packages
zh_CN: 被其他软件包使用的解释器模块包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: generic ELF library package used by other packages
zh_CN: 被其他软件包使用的ELF库文件包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: multiple binary packages including an ELF library package
zh_CN: 生成多个二进制包，其中包含括ELF库文件

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: source package with multiple upstream sources
zh_CN: 有多个上游的源码包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: kernel module packages
zh_CN: 内核模块包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: kernel patch packages
zh_CN: 内核补丁包

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: any package with non-trivial maintainer scripts
zh_CN: 含有关键维护者脚本的软件包

note: type: Content of: <book><chapter><section><para>
en: Packaging high complexity packages is not too hard, but it requires a bit more knowledge. You should seek specific guidance for every complex feature. For example, some languages have their own sub-policy documents:
zh_CN: 打包高复杂软件包并非难如登天，但这个过程需要用到更多知识。你应该针对每一个所谓的复杂特性来搜寻相应的指南。比如，一些语言有它们自己的子策略文档：

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Do not worry about the missing <filename>Makefile</filename>.  You can install the <command>hello</command> command by simply using <command>debhelper</command> as in <xref linkend="install"/>, or by modifying the upstream source to add a new <filename>Makefile</filename> with the <literal>install</literal> target as in <xref linkend="modify"/>.
zh_CN: 不用担心失踪的 <filename>Makefile</filename>。你可以参照 <xref linkend="install"/> ，简单地通过 <command>debhelper</command> 来安装 <command>hello</command> 程序，或者修改上游源代码来添加带有<literal>install</literal>目标的新<filename>Makefile</filename>，参照<xref linkend="modify"/>。

note: type: Content of: <book><chapter><section><para>
en: There is another old Latin saying: <emphasis>fabricando fit faber</emphasis> (practice makes perfect).  It is <emphasis>highly</emphasis> recommended to practice and experiment with all the steps of Debian packaging with simple packages while reading this tutorial.  A trivial upstream tarball, <filename>hello-sh-1.0.tar.gz</filename>, created as follows may offer a good starting point:<placeholder type="footnote" id="0"/>
zh_CN: 还有一句拉丁谚语：<emphasis>fabricando fit faber</emphasis> （熟能生巧）。我们 <emphasis>强烈</emphasis> 建议你在阅读这篇教程的时候，用一个简单的软件包来对所有的 Debian 打包步骤进行实验。跟随下边的步骤您就可以创建一个微不足道的软件包 <filename>hello-sh-1.0.tar.gz</filename> ，而且这会是一个非常好的开端：<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><title>
en: Get the program, and try it out
zh_CN: 获取程序并试用

note: type: Content of: <book><chapter><section><para>
en: So the first thing to do is to find and download the original source code.  Presumably you already have the source file that you picked up at the author's homepage.  Sources for free Unix programs usually come in <command>tar</command>+<command>gzip</command> format with the extension <filename>.tar.gz</filename>, <command>tar</command>+<command>bzip2</command> format with the extension <filename>.tar.bz2</filename>, or <command>tar</command>+<command>xz</command> format with the extension <filename>.tar.xz</filename>.  These usually contain a directory called <filename><replaceable>package</replaceable>-<replaceable>version</replaceable></filename> with all the sources inside.
zh_CN: 这里第一件事是找到并下载原始的源代码。我们假定你已经在作者的主页上找到了程序的源代码。一般来说，Unix 下的自由软件源代码是以 <command>tar</command>+<command>gzip</command> 格式(扩展名为 <filename>.tar.gz</filename>)或 <command>tar</command>+<command>bzip2</command> 格式(扩展名为 <filename>.tar.bz2</filename>)或<command>tar</command>+<command>xz</command> (扩展名为<filename>.tar.xz</filename>) 的文件格式提供的。有时候，归档文件中包含了一个名为 <filename><replaceable>package</replaceable>-<replaceable>version</replaceable></filename> 的子目录，在那里边有全部的源代码。

note: type: Content of: <book><chapter><section><para>
en: If the latest version of the source is available through a Version Control System (VCS) such as Git, Subversion, or CVS, you need to get it with <literal>git clone</literal>, <literal>svn co</literal>, or <literal>cvs co</literal> and repack it into <command>tar</command>+<command>gzip</command> format yourself by using the <literal>--exclude-vcs</literal> option.
zh_CN: 如果最新版本的源代码可通过像 Git，Subversion，CVS 这样的版本控制系统获得的话，你可以用 <literal>git clone</literal> ， <literal>svn co</literal>, 或 <literal>cvs co</literal> 来下载它，然后将它重新打包压缩为 <command>tar</command>+<command>gzip</command> 格式， 同时别忘了 <literal>--exclude-vcs</literal> 选项哟。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: You can identify the archive format using the <command>file</command> command when the file extension is not enough.
zh_CN: 当通过文件扩展名不足以判断文件类型时，可以使用 <command>file</command> 命令来判断。

note: type: Content of: <book><chapter><section><para>
en: If your program's source comes as some other sort of archive (for instance, the filename ends in <filename>.Z</filename> or <filename>.zip</filename><placeholder type="footnote" id="0"/>), you should also unpack it with the appropriate tools and repack it.
zh_CN: 如果你的程序源代码是以其他文件格式提供的 (比如文件名以 <filename>.Z</filename> 或 <filename>.zip</filename> 结尾 <placeholder type="footnote" id="0"/>)，则应当使用对应和合适的工具将其解压，再重新归档为 Tarball。

note: type: Content of: <book><chapter><section><para>
en: If your program's source comes with some contents which do not comply with DFSG, you should also unpack it to remove such contents and repack it with a modified upstream version containing <literal>dfsg</literal>.
zh_CN: 如果你挑选的程序的源代码中包含一些不符合 DFSG 的内容，你应当解压后移除它们，然后将删减过的源码重新归档。因为 DFSG 而进行删减过的源码归档的上游版本号中，需要添加 <literal>dfsg</literal> 这个标识。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This program is already packaged. The <ulink url="&gentoo-package;">current version</ulink> uses Autotools as its build structure and is substantially different from the following examples, which were based on version 0.9.12.
zh_CN: 这个程序已经被打包好了。<ulink url="&gentoo-package;">当前的版本</ulink> 使用 Autotools 作为其编译系统(build structure)，并且已经和下边的例子不一样了。下边的例子基于老的版本 0.9.12 。

note: type: Content of: <book><chapter><section><para>
en: As an example, I'll use a program called <command>gentoo</command>, a GTK+ file manager.  <placeholder type="footnote" id="0"/>
zh_CN: 作为示例，本教程在这里使用一个名为 <command>gentoo</command> 的程序，它是一个 GTK+ 文件管理器。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: Create a subdirectory under your home directory named <filename>debian</filename> or <filename>deb</filename> or anything you find appropriate (e.g.  just <filename>~/gentoo</filename> would do fine in this case).  Place the downloaded archive in it, and extract it (with <literal>tar xzf gentoo-0.9.12.tar.gz</literal>).  Make sure there are no warning messages, even <emphasis>irrelevant</emphasis> ones, because other people's unpacking tools may or may not ignore these anomalies, so they may have problems unpacking them.  Your shell command line may look something like this:
zh_CN: 在你的家目录下创建一个子目录，命名为 <filename>debian</filename> 或 <filename>deb</filename> 或者依你的喜好。(本例中使用 <filename>~/gentoo</filename>)。把下载好的归档文件放在其中并解压 (使用 <literal>tar xzf gentoo-0.9.12.tar.gz</literal> 命令)。你需要确定这个归档在解压过程中没有任何发生错误，即便是有一点 <emphasis>小小小问题</emphasis> 也是不行的。因为在别人的系统上解压这些归档时，可能他们的工具并不会忽略这些非正常现象，于是就出问题了。一般的预期是，在你的终端屏幕上，应该能看到如下的情形。

note: type: Content of: <book><chapter><section><para>
en: Now you have another subdirectory, called <filename>gentoo-0.9.12</filename>.  Change to that directory and <emphasis>thoroughly</emphasis> read the provided documentation.  Usually there are files named <filename>README*</filename>, <filename>INSTALL*</filename>, <filename>*.lsm</filename> or <filename>*.html</filename>.  You must find instructions on how to compile and install the program (most probably they'll assume you want to install to the <filename>/usr/local/bin</filename> directory; you won't be doing that, but more on that later in <xref linkend="destdir"/>).
zh_CN: 现在解压缩工具创建了一个新的子目录，名为 <filename>gentoo-0.9.12</filename>。接下来你需要进入该目录并 <emphasis>彻底</emphasis> 读完其中的文档。通常情况下文档会被命名为 <filename>README*</filename>、<filename>INSTALL*</filename>、<filename>*.lsm</filename> 或 <filename>*.html</filename>。同时，你需要学会正确编译和安装这个程序 (最可能出现的一种情况是，软件会被默认安装到 <filename>/usr/local/bin</filename> 目录；但在 Debian 软件包制作过程中不可以那样做。详细的原因在 <xref linkend="destdir"/> 中说明)。

note: type: Content of: <book><chapter><section><para>
en: You should start packaging with a completely clean (pristine) source directory, or simply with freshly unpacked sources.
zh_CN: 开始打包时的源代码目录应当是绝对干净原始，没有做过任何修改的。一般来说直接使用刚刚解压得到的源代码即可。

note: type: Content of: <book><chapter><section><title>
en: Simple build systems
zh_CN: 简单的编译系统

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Many modern programs come with a script named <filename>configure</filename>, which when executed creates a <filename>Makefile</filename> customized for your system.
zh_CN: 许多新时代的程序都配有一个叫做 <filename>configure</filename> 的脚本。执行它的时候会生成一个为你的计算机专门定制的 <filename>Makefile</filename> 。

note: type: Content of: <book><chapter><section><para>
en: Simple programs usually come with a <filename>Makefile</filename> and can be compiled just by invoking <literal>make</literal>.<placeholder type="footnote" id="0"/> Some of them support <literal>make check</literal>, which runs included self-tests.  Installation to the destination directories is usually done with <literal>make install</literal>.
zh_CN: 有些比较简单的程序源码自己带有 <filename>Makefile</filename>, 这时你可以很容易地使用 <literal>make</literal> 命令来编译它。<placeholder type="footnote" id="0"/> 有一些软件的 Makefile 还支持 <literal>make check</literal>，这个命令可以完成一系列程序检验和测试。当程序编译好后即可用 <literal>make install</literal> 命令，将程序安装到目标目录。

note: type: Content of: <book><chapter><section><para>
en: Now try to compile and run your program, to make sure it works properly and doesn't break something else while it's installing or running.
zh_CN: 现在尝试编译和运行你的程序，你需要确保它能正常工作，以及它在安装和运行时不会破坏别的东西。

note: type: Content of: <book><chapter><section><para>
en: Also, you can usually run <literal>make clean</literal> (or better <literal>make distclean</literal>) to clean up the build directory.  Sometimes there's even a <literal>make uninstall</literal> which can be used to remove all the installed files.
zh_CN: 你还可以运行 <literal>make clean</literal> (或更好的 <literal>make distclean</literal>) 来清理编译目录。Makefile 中有时还会支持 <literal>make uninstall</literal> ，它被用来卸载已经安装了的程序文件。

note: type: Content of: <book><chapter><section><title>
en: Popular portable build systems
zh_CN: 常见的可移植编译系统

note: type: Content of: <book><chapter><section><para>
en: A lot of free software programs are written in the <ulink url="&c-program;">C</ulink> and <ulink url="&cxx;">C++</ulink> languages.  Many of these use Autotools or CMake to make them portable across different platforms.  These build tools need to be used to generate the <filename>Makefile</filename> and other required source files first.  Then, such programs are built using the usual <literal>make; make install</literal>.
zh_CN: 有非常非常多的自由软件是使用 <ulink url="&c-program;">C</ulink> 和 <ulink url="&cxx;">C++</ulink> 语言编写的。其中又有很多程序使用了 Autotools 或 CMake 来使其可以移植到不同平台上。这些工具被用于生成 <filename>Makefile</filename> 和其他必须的源文件。然后程序就可以使用正常的 <literal>make; make install</literal> 来编译和安装。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Autotools is too big to deal with in this small tutorial. This section is meant to provide keywords and references only.  Please make sure to read the <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> and the local copy of <filename>&autotools-readme;</filename>, if you need to use it.
zh_CN: Autotools 这个庞然大物显然已经超出本教程的讨论范围，毕竟本文主要提供关键字和提示。如果你需要使用 Autotools ，请认真研读 <ulink url="&autotools-tutorial;">Autotools Tutorial</ulink> 以及 <filename>&autotools-readme;</filename> 的本地副本。

note: type: Content of: <book><chapter><section><para>
en: <ulink url="&gnu-build-system;">Autotools</ulink> is the GNU build system comprising <ulink url="&autoconf;">Autoconf</ulink>, <ulink url="&automake;">Automake</ulink>, <ulink url="&libtool;">Libtool</ulink>, and <ulink url="&gettext;">gettext</ulink>.  You can recognize such sources by the <filename>configure.ac</filename>, <filename>Makefile.am</filename>, and <filename>Makefile.in</filename> files.  <placeholder type="footnote" id="0"/>
zh_CN: <ulink url="&gnu-build-system;">Autotools</ulink> 是 GNU 编译系统工具集，包括 <ulink url="&autoconf;">Autoconf</ulink>、<ulink url="&automake;">Automake</ulink>、<ulink url="&libtool;">Libtool</ulink> 和 <ulink url="&gettext;">gettext</ulink>。你可以通过 <filename>configure.ac</filename>、<filename>Makefile.am</filename> 和 <filename>Makefile.in</filename> 等特征文件来识别使用 Autotools 作为编译系统的源代码。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: The first step of the Autotools workflow is usually that upstream runs <literal>autoreconf -i -f</literal> in the source directory and distributes the generated files along with the source.
zh_CN: Autotools 工作流程的第一步是在上游作者在代码中运行 <literal>autoreconf -i -f</literal> ，然后把生成的文件同源代码一起分发。

note: type: Content of: <book><chapter><section><para>
en: Editing <filename>configure.ac</filename> and <filename>Makefile.am</filename> files requires some knowledge of <command>autoconf</command> and <command>automake</command>.  See <literal>info autoconf</literal> and <literal>info automake</literal>.
zh_CN: 编辑 <filename>configure.ac</filename> 和 <filename>Makefile.am</filename> 等文件前，你需要一些关于 <command>autoconf</command> 和 <command>automake</command> 的知识。请参看 <literal>info autoconf</literal> 和 <literal>info automake</literal>。

note: type: Content of: <book><chapter><section><para>
en: The second step of the Autotools workflow is usually that the user obtains this distributed source and runs <literal>./configure &amp;&amp; make</literal> in the source directory to compile the program into an executable command <command><replaceable>binary</replaceable></command>.
zh_CN: Autotools 工作流程的第二步是，用户获得分发的源代码后在源码目录下运行 <literal>./configure &amp;&amp; make</literal> 来将其编译成为 <command><replaceable>binary</replaceable></command> (二进制文件)。

note: type: Content of: <book><chapter><section><para>
en: You can change many things in the <filename>Makefile</filename>; for instance you can change the default location for file installation using the option <literal>./configure --prefix=/usr</literal>.
zh_CN: 你可以改变 <filename>Makefile</filename> 文件的许多设置，比如你可以修改默认的文件安装路径(使用 <literal>./configure --prefix=/usr</literal>)。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: You can automate this by using <systemitem role="package">dh-autoreconf</systemitem> package.  See <xref linkend="customrules"/>.
zh_CN: 软件包 <systemitem role="package">dh-autoreconf</systemitem> 可以帮助你将这个过程自动化。参见 <xref linkend="customrules"/>.

note: type: Content of: <book><chapter><section><para>
en: Although it is not required, updating the <filename>configure</filename> and other files with <literal>autoreconf -i -f</literal> may improve the compatibility of the source.  <placeholder type="footnote" id="0"/>
zh_CN: 可选：若使用 <literal>autoreconf -i -f</literal> 来更新 <filename>configure</filename> 和其他相关文件，则有可能可以提高源代码的兼容性。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: <ulink url="&cmake;">CMake</ulink> is an alternative build system.  You can recognize such sources by the <filename>CMakeLists.txt</filename> file.
zh_CN: <ulink url="&cmake;">CMake</ulink> 是另一个备选的编译系统，你可以通过 <filename>CMakeLists.txt</filename> 这个特征文件来识别使用 CMake 的源代码。

note: type: Content of: <book><chapter><section><title>
en: Package name and version
zh_CN: 软件包名称和版本

note: type: Content of: <book><chapter><section><para>
en: If the upstream source comes as <filename>gentoo-0.9.12.tar.gz</filename>, you can take <literal>gentoo</literal> as the (source) <emphasis role="strong">package name</emphasis> and <literal>0.9.12</literal> as the <emphasis role="strong">upstream version</emphasis>.  These are used in the <filename>debian/changelog</filename> file described later in <xref linkend="changelog"/>, too.
zh_CN: 如果上游源代码以 <filename>gentoo-0.9.12.tar.gz</filename> 这样的文件名来分发，你就可以用 <literal>gentoo</literal> 作为 <emphasis role="strong">软件包名</emphasis> ，并用 <literal>0.9.12</literal> 作为 <emphasis role="strong">上游版本</emphasis>。 它们会被 <filename>debian/changelog</filename> 这个文件用到；<xref linkend="changelog"/> 部分会详细描述这个文件。

note: type: Content of: <book><chapter><section><para>
en: Although this simple approach works most of the time, you may need to adjust <emphasis role="strong">package name</emphasis> and <emphasis role="strong">upstream version</emphasis> by renaming the upstream source to follow Debian Policy and existing convention.
zh_CN: 虽然此法在大部分情况下能显灵，但你仍需要根据 Debian 政策（Debian Policy）以及约定俗成的做法来调整 <emphasis role="strong">软件包名</emphasis> 和 <emphasis role="strong">上游版本</emphasis> 。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The default package name field length of <command>aptitude</command> is 30.  For more than 90% of packages, the package name is less than 24 characters.
zh_CN: 在 <command>aptitude</command> 工具中，软件包名字段的默认最大长度为 30。  而 90% 以上的软件包包名都少于 24 个字符。

note: type: Content of: <book><chapter><section><para>
en: You must choose the <emphasis role="strong">package name</emphasis> to consist only of lower case letters (<literal>a-z</literal>), digits (<literal>0-9</literal>), plus (<literal>+</literal>) and minus (<literal>-</literal>) signs, and periods (<literal>.</literal>). It must be at least two characters long, must start with an alphanumeric character, and must not be the same as existing packages.  It is a good idea to keep its length within 30 characters.  <placeholder type="footnote" id="0"/>
zh_CN: 在 <emphasis role="strong">软件包名</emphasis> 里只能含有 小写字母 (<literal>a-z</literal>), 数字 (<literal>0-9</literal>), 加号 (<literal>+</literal>) 和 减号 (<literal>-</literal>) ， 以及 点号 (<literal>.</literal>)。 软件包名最短长度两个字符；它必须以字母开头；它不能与仓库软件包名发生冲突。还有，把软件包名的长度控制在 30 字符以内是明智之举。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If you follow the <ulink url="&devref-newpackage;">Debian Developer's Reference 5.1. "New packages"</ulink>, the ITP process will usually catch this kind of issue.
zh_CN: 如果你遵循 <ulink url="&devref-newpackage;">Debian Developer's Reference 5.1. "New packages"</ulink>， 那么在 ITP 过程中很容易遇到这样的问题。

note: type: Content of: <book><chapter><section><para>
en: If upstream uses some generic term such as <literal>test-suite</literal> for its name, it is a good idea to rename it to identify its contents explicitly and avoid namespace pollution.  <placeholder type="footnote" id="0"/>
zh_CN: 如果上游代码在它的名称中使用了一些通用术语比如 <literal>test-suite</literal>， 那么你应当将其重命名，显式地说明其内容并避免污染命名空间。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This stricter rule should help you avoid confusing file names.
zh_CN: 这一条更严格的规则能帮助你避免混淆文件名。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The default version field length of <command>aptitude</command> is 10.  The Debian revision with preceding hyphen usually consumes 2.  For more than 80% of packages, the upstream version is less than 8 characters and the Debian revision is less than 2 characters.  For more than 90% of packages, the upstream version is less than 10 characters and the Debian revision is less than 3 characters.
zh_CN: <command>aptitude</command> 的版本字段默认长度为10。通常其中的 Debian 修订号和前置的连字符会消耗2个字符位置。对 80% 以上的软件包来说，上游版本小于8字符，Debian 修订号小于2字符。对 90% 以上的软件包来说，上游版本小于10字符，Debian 修订号小于3字符。

note: type: Content of: <book><chapter><section><para>
en: You should choose the <emphasis role="strong">upstream version</emphasis> to consist only of alphanumerics (<literal>0-9A-Za-z</literal>), plus signs (<literal>+</literal>), tildes (<literal>~</literal>), and periods (<literal>.</literal>). It must start with a digit (<literal>0-9</literal>).  <placeholder type="footnote" id="0"/> It is good idea to keep its length within 8 characters if possible.  <placeholder type="footnote" id="1"/>
zh_CN: 你应该让 <emphasis role="strong">upstream version（上游版本号）</emphasis> 只包含字母和数字 (<literal>0-9A-Za-z</literal>), 以及加号 (<literal>+</literal>), 波浪号 (<literal>~</literal>), 还有 点号(<literal>.</literal>)。它必须以数字开头 (<literal>0-9</literal>)。  <placeholder type="footnote" id="0"/> 如果可能的话，最好把它的长度控制在8字符以内。 <placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><para>
en: If upstream does not use a normal versioning scheme such as <literal>2.30.32</literal> but uses some kind of date such as <literal>11Apr29</literal>, a random codename string, or a VCS hash value as part of the version, make sure to remove them from the <emphasis role="strong">upstream version</emphasis>.  Such information can be recorded in the <filename>debian/changelog</filename> file.  If you need to invent a version string, use the <literal>YYYYMMDD</literal> format such as <literal>20110429</literal> as upstream version.  This ensures that <command>dpkg</command> interprets later versions correctly as upgrades.  If you need to ensure smooth transition to the normal version scheme such as <literal>0.1</literal> in the future, use the <literal>0~YYMMDD</literal> format such as <literal>0~110429</literal> as the upstream version.
zh_CN: 如果上游不使用像 <literal>2.30.32</literal> 这样的常规版本格式，而是用类似 <literal>11Apr29</literal> 这样的日期作为版本，类似于随机的代号字符串，或者以VCS的哈希值作为版本号的一部分，那么请确认将其从 <emphasis role="strong">upstream version</emphasis> 中移除。 为此作出的改动信息可以记录在 <filename>debian/changelog</filename> 文件中。 如果你需要发明一个版本字符串，请使用 <literal>YYYYMMDD</literal> 这个格式作为上游版本，比如 <literal>20110429</literal> 。这会确保 <command>dpkg</command> 在升级软件包时能够正确解读新版本。 如果需要确保未来能够平滑过渡到类似 <literal>0.1</literal> 这样的版本号的话，那就请使用 <literal>0~YYMMDD</literal> 格式作为上游版本，例如 <literal>0~110429</literal> 。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Version strings may be <emphasis role="strong">upstream version</emphasis> (<literal><replaceable>version</replaceable></literal>), <emphasis role="strong">Debian revision</emphasis> (<literal><replaceable>revision</replaceable></literal>), or <emphasis role="strong">version</emphasis> (<literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>).  See <xref linkend="newrevision"/> for how the <emphasis role="strong">Debian revision</emphasis> is incremented.
zh_CN: 版本字符串可以是 <emphasis role="strong">upstream version</emphasis> (<literal><replaceable>version</replaceable></literal>), <emphasis role="strong">Debian revision</emphasis> (<literal><replaceable>revision</replaceable></literal>), 或者 <emphasis role="strong">version</emphasis> (<literal><replaceable>version</replaceable>-<replaceable>revision</replaceable></literal>)。 关于 Debian 修订号如何增长，请参见  <xref linkend="newrevision"/><emphasis role="strong">Debian revision</emphasis> 。

note: type: Content of: <book><chapter><section><para>
en: Version strings <placeholder type="footnote" id="0"/> can be compared using <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as follows:
zh_CN: 版本字符串 <placeholder type="footnote" id="0"/> 可以用 <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来进行比较：

note: type: Content of: <book><chapter><section><para>
en: The version comparison rule can be summarized as:
zh_CN: 版本比较规则可总结为以下几点：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Strings are compared from the head to the tail.
zh_CN: 字符串要从头到尾进行比较。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Letters are larger than digits.
zh_CN: 字母比数字大。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Numbers are compared as integers.
zh_CN: 数字作为整数进行比较。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Letters are compared in ASCII code order.
zh_CN: 字母按照 ASCII 编码顺序进行比较。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: There are special rules for period (<literal>.</literal>), plus (<literal>+</literal>), and tilde (<literal>~</literal>) characters, as follows:
zh_CN: 对于点号 (<literal>.</literal>)，加号 (<literal>+</literal>)，以及波浪号 (<literal>~</literal>) 则有对应的特殊规则，具体如下：

note: type: Content of: <book><chapter><section><para>
en: One tricky case occurs when upstream releases <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> as the pre-release of <filename>gentoo-0.9.12.tar.gz</filename>.  You need to make sure that the upgrade works properly by renaming the upstream source to <filename>gentoo-0.9.12~rc99.tar.gz</filename>.
zh_CN: 有一种比较棘手的情况，当上游释出 <filename>gentoo-0.9.12-ReleaseCandidate-99.tar.gz</filename> 作为 <filename>gentoo-0.9.12.tar.gz</filename> 的预发布版本时，就需要确保升级工作妥当进行：重命名该上游源代码为 <filename>gentoo-0.9.12~rc99.tar.gz</filename>.

note: type: Content of: <book><chapter><section><title>
en: Setting up <command>dh_make</command>
zh_CN: 设置 <command>dh_make</command>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The following text assumes you are using Bash as your login shell.  If you use some other login shell such as Z shell, use their corresponding configuration files instead of <filename>~/.bashrc</filename>.
zh_CN: 以下内容默认你以 Bash 作为登陆 shell。如果你使用其他的 shell，例如 Z shell，那就使用它们的配置文件代替这里提到的 <filename>~/.bashrc</filename>。

note: type: Content of: <book><chapter><section><para>
en: Set up the shell environment variables <literal>$DEBEMAIL</literal> and <literal>$DEBFULLNAME</literal> so that various Debian maintenance tools recognize your email address and name to use for packages. <placeholder type="footnote" id="0"/>
zh_CN: 首先设置两个 环境变量，<literal>$DEBEMAIL</literal> 和 <literal>$DEBFULLNAME</literal>，这样大多数 Debian 维护工具就能够正确识别你用于维护软件包的姓名和电子邮件地址。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><title>
en: Initial non-native Debian package
zh_CN: 初始化外来 Debian 软件包

note: type: Content of: <book><chapter><section><para>
en: Normal Debian packages are non-native Debian packages made from upstream programs.  If you wish to create a non-native Debian package of an upstream source <filename>gentoo-0.9.12.tar.gz</filename>, you can create an initial non-native Debian package for it by issuing the <command>dh_make</command> command as follows:
zh_CN: 一般来说，由上游程序产生的 Debian 软件包都是 外来 的。 若你想要用上游源代码 <filename>gentoo-0.9.12.tar.gz</filename> 创建一个外来 Debian 软件包，你可以在它的基础上进行外来软件包初始化，这只需要调用 <command>dh_make</command> 命令：

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If the upstream source provides the <filename>debian</filename> directory and its contents, run the <command>dh_make</command> command with the extra option <literal>--addmissing</literal>.  The new source <literal>3.0 (quilt)</literal> format is robust enough not to break even for these packages.  You may need to update the contents provided by the upstream version for your Debian package.
zh_CN: 如果上游源代码已经提供了有内容的 <filename>debian</filename> 目录，那么带上参数 <literal>--addmissing</literal> 来执行<command>dh_make</command> 命令。 新的源码包格式 <literal>3.0 (quilt)</literal> 的鲁棒性(Robust)已经足够优秀，以不至于轻易损坏。 另外，你可能需要修改上游提供的内容，以满足你的 Debian 软件包之需。

note: type: Content of: <book><chapter><section><para>
en: Of course, replace the filename with the name of your original source archive.  <placeholder type="footnote" id="0"/> See <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> for details.
zh_CN: 当然，这里请用你原版源码归档的名字来替换 filename (文件名)。  <placeholder type="footnote" id="0"/> 详情请参见 <citerefentry> <refentrytitle>dh_make</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> 。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: There are several choices here: <literal>s</literal> for Single binary package, <literal>i</literal> for arch-Independent package, <literal>m</literal> for Multiple binary packages, <literal>l</literal> for Library package, <literal>k</literal> for Kernel module package, <literal>n</literal> for kernel patch package, and <literal>b</literal> for <systemitem role="package">cdbs</systemitem> package.  This document focuses on the use of the <command>dh</command> command (from the package <systemitem role="package">debhelper</systemitem>) to create a single binary package, but also touches on how to use it for arch-independent or multiple binary packages.  The package <systemitem role="package">cdbs</systemitem> offers an alternative packaging script infrastructure to the <command>dh</command> command and is outside the scope of this document.
zh_CN: 这里有这几种选择： <literal>s</literal> 代表单一二进制包， <literal>i</literal> 代表独立于体系结构的软件包， <literal>m</literal> 代表多个二进制包， <literal>l</literal> 代表共享库文件包，<literal>k</literal> 代表内核模块包， <literal>n</literal> 代表内核补丁包， <literal>b</literal> 代表 <systemitem role="package">cdbs</systemitem> 软件包。本教程专注于使用 <command>dh</command> 命令 (来自 <systemitem role="package">debhelper</systemitem> 软件包) 来创建单一二进制包，但也会涉及到创建 独立于体系结构 或 多个二进制软件包 相关的内容。软件包 <systemitem role="package">cdbs</systemitem> 提供了 另一套可以代替 <command>dh</command> 命令的基础打包脚本，不过这个家伙已经超出了我们的讨论范围。

note: type: Content of: <book><chapter><section><para>
en: You should see some output asking you what sort of package you want to create.  Gentoo is a single binary package &#x2014; it creates only one binary package, i.e., one <filename>.deb</filename> file &#x2014; so we will select the first option (with the <literal>s</literal> key), check the information on the screen, and confirm by pressing <literal><replaceable>ENTER</replaceable></literal>.  <placeholder type="footnote" id="0"/>
zh_CN: 你会看到一些输出，询问你想要创建什么类型的软件包。这里的 Gentoo 被规划为一个单一二进制包——它仅仅产生一个二进制包， 亦即单个 <filename>.deb</filename> 文件——于是我们就选择第一项 (按 <literal>s</literal> 键)， 认真阅读屏幕上的输出信息， 然后按 <literal><replaceable>ENTER</replaceable></literal> 键来确认。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: This execution of <command>dh_make</command> creates a copy of the upstream tarball as <filename>gentoo_0.9.12.orig.tar.gz</filename> in the parent directory to accommodate the creation of the non-native Debian source package with the name <filename>debian.tar.gz</filename> later:
zh_CN: 执行 <command>dh_make</command> 后，上级目录中自动创建了一份上游 tarball 的副本，名为 <filename>gentoo_0.9.12.orig.tar.gz</filename>，这个文件和稍后要介绍的 <filename>debian.tar.gz</filename> 合在一起便满足了一部分 Debian 非本土源码包的要求。

note: type: Content of: <book><chapter><section><para>
en: Please note two key features of this filename <filename>gentoo_0.9.12.orig.tar.gz</filename>:
zh_CN: 请注意在 <filename>gentoo_0.9.12.orig.tar.gz</filename> 这个文件名中有两个关键点：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Package name and version are separated by the character <literal>_</literal> (underscore).
zh_CN: 软件包名称 和 版本 中间以字符 <literal>_</literal> （下划线）来分隔。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The string <filename>.orig</filename> is inserted before the <filename>.tar.gz</filename>.
zh_CN: 后缀名 <filename>.tar.gz</filename> 前边插有 <filename>.orig</filename>。

note: type: Content of: <book><chapter><section><para>
en: You should also notice that many template files are created in the source under the <filename>debian</filename> directory.  These will be explained in <xref linkend="dreq"/> and <xref linkend="dother"/>.  You should also understand that packaging cannot be a fully automated process.  You will need to modify the upstream source for Debian (see <xref linkend="modify"/>).  After this, you need to use the proper methods for building Debian packages (<xref linkend="build"/>), testing them (<xref linkend="checkit"/>), and uploading them (<xref linkend="upload"/>).  All the steps will be explained.
zh_CN: 你或许注意到了 <filename>debian</filename> 目录下已经有了许多模板。这些文件将在 <xref linkend="dreq"/> 和 <xref linkend="dother"/> 中一一加以说明。另外，打包这件事情无法被完全自动化。因此你还得按照 <xref linkend="modify"/> 中介绍的方法为 Debian 修改软件包。再接下来，按照 <xref linkend="build"/> 中叙述的合适的方法来构建 Debian 软件包，并根据 <xref linkend="checkit"/> 中的方法进行软件包测试，最后参考 <xref linkend="upload"/> 这里的说明将其上传。所有的这些主要步骤本教程都会进行解释。

note: type: Content of: <book><chapter><section><para>
en: If you accidentally erased some template files while working on them, you can recover them by running <command>dh_make</command> with the <literal>--addmissing</literal> option again in a Debian package source tree.
zh_CN: 如果你在修改过程中不小心删除或玩坏了某些模板，你还可以使用 <command>dh_make</command> 加 <literal>--addmissing</literal> 参数来将其还原。（译注：也可以用dpkg -L dh-make 来寻找您想要的模板）

note: type: Content of: <book><chapter><section><para>
en: Updating an existing package may get complicated since it may be using older techniques.  While learning the basics, please stick to creating a fresh package; further explanations are given in <xref linkend="update"/>.
zh_CN: 更新一个已存在的软件包可能有点复杂，因为它可能使用了旧的打包技术。在学习基本功的阶段，建议只创建全新的软件包；稍后的 <xref linkend="update"/>中会细致地讲解更新现存软件包。

note: type: Content of: <book><chapter><section><para>
en: Please note that the source file does not need to contain any build system discussed in <xref linkend="simplemake"/> and <xref linkend="portable"/>.  It could be just a collection of graphical data, etc.  Installation of files may be carried out using only <systemitem role="package">debhelper</systemitem> configuration files such as <filename>debian/install</filename> (see <xref linkend="install"/>).
zh_CN: 请注意，源代码中不必包含任何在 <xref linkend="simplemake"/> 或 <xref linkend="portable"/> 中谈论到的编译系统。 就算源码包仅仅是一组图像之类的也可以，这时候这些文件的安装可以用 <systemitem role="package">debhelper</systemitem> 的配置文件来搞定，比如 <filename>debian/install</filename> (参见 <xref linkend="install"/>)。

note: type: Content of: <book><chapter><title>
en: Modifying the source
zh_CN: 修改源代码

note: type: Content of: <book><chapter><para>
en: Please note that there isn't space here to go into <emphasis>all</emphasis> the details of fixing upstream sources, but here are some basic steps and problems people often run across.
zh_CN: 请注意这里没有足够篇幅来描述有关修改上游源码的 <emphasis>全部</emphasis> 细节，这里只介绍基本步骤和常见问题。

note: type: Content of: <book><chapter><section><title>
en: Setting up <command>quilt</command>
zh_CN: 设置 <command>quilt</command>

note: type: Content of: <book><chapter><section><para>
en: The program <command>quilt</command> offers a basic method for recording modifications to the upstream source for Debian packaging.  It's useful to have a slightly customized default, so let's create an alias <command>dquilt</command> for Debian packaging by adding the following lines to <filename>~/.bashrc</filename>.  The second line provides the same shell completion feature of the <command>quilt</command> command to the <command>dquilt</command> command:
zh_CN: <command>quilt</command> 程序是 Debian 打包过程中采用的补丁管理工具。我们只需要在默认配置的基础上，加以少许修改即可。首先我们来创建一个别名 <command>dquilt</command>，以方便打包之需： 添加以下几行内容到 <filename>~/.bashrc</filename> 文件中。其中第二行可以给 <command>dquilt</command> 命令提供与 <command>quilt</command> 命令相同的 shell 补全：

note: type: Content of: <book><chapter><section><para>
en: Then let's create <filename>~/.quiltrc-dpkg</filename> as follows:
zh_CN: 现在我们来创建 <filename>~/.quiltrc-dpkg</filename> 文件：

note: type: Content of: <book><chapter><section><para>
en: See <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> and <filename>&quilt-pdf;</filename> on how to use <command>quilt</command>.
zh_CN: 参见 <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 以及 <filename>&quilt-pdf;</filename> 来获取有关 <command>quilt</command> 命令用法的信息。

note: type: Content of: <book><chapter><section><title>
en: Fixing upstream bugs
zh_CN: 修复上游 Bug

note: type: Content of: <book><chapter><section><para>
en: Let's assume you find an error in the upstream <filename>Makefile</filename> as follows, where <literal>install: gentoo</literal> should have been <literal>install: gentoo-target</literal>.
zh_CN: 假设你在上游的 <filename>Makefile</filename> 文件中找到了一个错误，其中的 <literal>install: gentoo</literal> 应该修正为 <literal>install: gentoo-target</literal> 。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The <filename>debian/patches</filename> directory should exist now if you ran <command>dh_make</command> as described before.  This example operation creates it just in case you are updating an existing package.
zh_CN: <filename>debian/patches</filename> 目录应当是运行 <command>dh_make</command> 时生成的。因为假设的是在更新一个已存在的软件包，所以在这个例子中我们新建它。

note: type: Content of: <book><chapter><section><para>
en: Let's fix this and record it with the <command>dquilt</command> command as <filename>fix-gentoo-target.patch</filename>: <placeholder type="footnote" id="0"/>
zh_CN: 使用 <command>dquilt</command> 修复这个问题，并把补丁命名为 <filename>fix-gentoo-target.patch</filename>。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: You change the <filename>Makefile</filename> file as follows:
zh_CN: 现在将 <filename>Makefile</filename> 修改为如下的样子：

note: type: Content of: <book><chapter><section><para>
en: Ask <command>dquilt</command> to generate the patch to create <filename>debian/patches/fix-gentoo-target.patch</filename> and add its description following <ulink url="&dep3;">DEP-3: Patch Tagging Guidelines</ulink>:
zh_CN: 使用 <command>dquilt</command> 将补丁创建到 <filename>debian/patches/fix-gentoo-targe.patch</filename> 并根据 <ulink url="&dep3;">DEP-3: Patch Tagging Guidelines</ulink> 添加描述：

note: type: Content of: <book><chapter><section><screen>
en: $ dquilt refresh
    $ dquilt header -e
    ... describe patch
zh_CN: $ dquilt refresh
    $ dquilt header -e
    ... 描述补丁

note: type: Content of: <book><chapter><section><title>
en: Installation of files to their destination
zh_CN: 文件安装

note: type: Content of: <book><chapter><section><para>
en: Most third-party software installs itself in the <filename>/usr/local</filename> directory hierarchy.  On Debian this is reserved for private use by the system administrator, so packages must not use directories such as <filename>/usr/local/bin</filename> but should instead use system directories such as <filename>/usr/bin</filename>, obeying the <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink> (FHS).
zh_CN: 大多数第三方程序会默认安装在 <filename>/usr/local</filename> 目录下。在 Debian 中，这是保留给系统管理员的私有位置，因此 Debian 软件包不可以使用比如<filename>/usr/local/bin</filename> 这样的目录，而应当使用比如 <filename>/usr/bin</filename> 这样的系统目录， 以遵循文件系统层级结构标准： <ulink url="&fhs;">Filesystem Hierarchy Standard</ulink> (FHS)。

note: type: Content of: <book><chapter><section><para>
en: Normally, <citerefentry> <refentrytitle>make</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> is used to automate building the program, and executing <literal>make install</literal> installs programs directly to the desired destination (following the <literal>install</literal> target in the <filename>Makefile</filename>).  In order for Debian to provide pre-built installable packages, it modifies the build system to install programs into a file tree image created under a temporary directory instead of the actual destination.
zh_CN: 通常情况下， <citerefentry> <refentrytitle>make</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 被用来自动编译程序，接着执行 <literal>make install</literal> 就可以把程序按照 <filename>Makefile</filename> 文件中的 <literal>install</literal> target 安装到指定的位置。为使 Debian 能够提供编译好的二进制软件包，打包脚本将自动修正编译系统，使其将文件安装到一个在临时目录中创建的文件系统子树中，而非直接安装到实际的目标位置。

note: type: Content of: <book><chapter><section><para>
en: These two differences between normal program installation on one hand and the Debian packaging system on the other can be transparently addressed by the <systemitem role="package">debhelper</systemitem> package through the <command>dh_auto_configure</command> and <command>dh_auto_install</command> commands if the following conditions are met:
zh_CN: 普通程序安装过程和 Debian 打包安装过程二者的区别可以由 <systemitem role="package">debhelper</systemitem> 软件包中的 <command>dh_auto_configure</command> 和 <command>dh_auto_install</command> 透明地处理。但必须满足以下条件：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&gnu-destdir;">GNU Coding Standards: 7.2.4 DESTDIR: Support for Staged Installs</ulink>.
zh_CN: 参见 <ulink url="&gnu-destdir;">GNU Coding Standards: 7.2.4 DESTDIR: Support for Staged Installs</ulink>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The <filename>Makefile</filename> must follow GNU conventions and support the <literal>$(DESTDIR)</literal> variable.  <placeholder type="footnote" id="0"/>
zh_CN: <filename>Makefile</filename> 文件应当遵循 GNU 的规定支持 <literal>$(DESTDIR)</literal> 变量<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The source must follow the Filesystem Hierarchy Standard (FHS).
zh_CN: 源代码必须遵循文件系统层级标准(FHS)。

note: type: Content of: <book><chapter><section><para>
en: Programs that use GNU <command>autoconf</command> follow the GNU conventions automatically, so they can be trivial to package.  On the basis of this and other heuristics, it is estimated that the <systemitem role="package">debhelper</systemitem> package will work for about 90% of packages without making any intrusive changes to their build system.  So packaging is not as complicated as it may seem.
zh_CN: 使用 GNU <command>autoconf</command> 的程序默认遵守 GNU 的规定，这有利于打包过程的自动化。通过这项特点和其他启发式处理，估计 <systemitem role="package">debhelper</systemitem> 软件可以直接制作约 90% 的软件包而不需维护者对编译系统做出大的改变。所以打包也不是看起来那样复杂。

note: type: Content of: <book><chapter><section><para>
en: If you need to make changes in the <filename>Makefile</filename>, you should be careful to support the <literal>$(DESTDIR)</literal> variable.  Although it is unset by default, the <literal>$(DESTDIR)</literal> variable is prepended to each file path used for the program installation.  The packaging script will set <literal>$(DESTDIR)</literal> to the temporary directory.
zh_CN: 如果你需要修改 <filename>Makefile</filename> 文件，就要确保其支持 <literal>$(DESTDIR)</literal> 变量，虽然默认情况下 <literal>$(DESTDIR)</literal> 变量没有设置并且在程序安装时会前置到每个文件的路径中。打包脚本会将 <literal>$(DESTDIR)</literal> 设置到临时目录上。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: For a source package generating multiple binary packages, the <command>dh_auto_install</command> command uses <filename>debian/tmp</filename> as the temporary directory while the <command>dh_install</command> command with the help of <filename>debian/<replaceable>package-1</replaceable>.install</filename> and <filename>debian/<replaceable>package-2</replaceable>.install</filename> files will split the contents of <filename>debian/tmp</filename> into <filename>debian/<replaceable>package-1</replaceable></filename> and <filename>debian/<replaceable>package-2</replaceable></filename> temporary directories, to create <filename><replaceable>package-1</replaceable>_*.deb</filename> and <filename><replaceable>package-2</replaceable>_*.deb</filename> binary packages.
zh_CN: 对于单份源码生成多个二进制包的情况，<command>dh_auto_install</command> 将临时目录设置为<filename>debian/tmp</filename>，而 <command>dh_install</command> 命令则将文件按照 <filename>debian/<replaceable>package-1</replaceable>.install</filename> 和 <filename>debian/<replaceable>package-2</replaceable>.install</filename> 等文件的描述将 <filename>debian/tmp</filename> 中的文件分别装入 <filename>debian/<replaceable>package-1</replaceable></filename> 和 <filename>debian/<replaceable>package-2</replaceable></filename> 等临时目录，用以创建 <filename><replaceable>package-1</replaceable>_*.deb</filename> 和 <filename><replaceable>package-2</replaceable>_*.deb</filename> 等二进制软件包。

note: type: Content of: <book><chapter><section><para>
en: For a source package generating a single binary package, the temporary directory used by the <command>dh_auto_install</command> command will be set to <filename>debian/<replaceable>package</replaceable></filename>.  <placeholder type="footnote" id="0"/> Everything that is contained in the temporary directory will be installed on users' systems when they install your package; the only difference is that <command>dpkg</command> will be installing the files to paths relative to the root directory rather than your working directory.
zh_CN: 对于从源码生成单个二进制包的情况， <command>dh_auto_install</command> 将临时目录设置到 <filename>debian/<replaceable>package</replaceable></filename>。<placeholder type="footnote" id="0"/> 临时目录中的全部文件都将成为软件包内容，并在安装该包时被安装到用户系统。这里唯一的区别是 <command>dpkg</command> 会把文件安装到真实的根目录树中，而不是你的工作目录。

note: type: Content of: <book><chapter><section><para>
en: Bear in mind that even though your program installs in <filename>debian/<replaceable>package</replaceable></filename>, it still needs to behave correctly when installed from the <filename>.deb</filename> package under the root directory.  So you must not allow the build system to hardcode strings like <literal>/home/me/deb/<replaceable>package</replaceable>-<replaceable>version</replaceable>/usr/share/<replaceable>package</replaceable></literal> into files in the package.
zh_CN: 请记住，即使你的程序正确安装到了<filename>debian/<replaceable>package</replaceable></filename>，仍然要考虑将 <filename>.deb</filename> 软件包文件安装到根目录下的情形。所以绝对不允许构建系统将诸如 <literal>/home/me/deb/<replaceable>package</replaceable>-<replaceable>version</replaceable>/usr/share/<replaceable>package</replaceable></literal> 这种诡异的内容硬编码到软件包文件中。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This is just an example to show what a <filename>Makefile</filename> should look like.  If the <filename>Makefile</filename> is created by the <command>./configure</command> command, the correct way to fix this kind of <filename>Makefile</filename> is to execute <command>./configure</command> from the <command>dh_auto_configure</command> command with default options including <literal>--prefix=/usr</literal>.
zh_CN: 这只是一个演示 <filename>Makefile</filename> 正常形态的例子。如果 <filename>Makefile</filename> 是通过 <command>./configure</command>  命令生成的，那么修复该类 <filename>Makefile</filename> 的方法是通过 <command>dh_auto_configure</command> 来执行 <command>./configure</command>，并带上包括 <literal>--prefix=/usr</literal> 的默认选项。

note: type: Content of: <book><chapter><section><para>
en: Here's the relevant part of <systemitem role="package">gentoo</systemitem>'s <filename>Makefile</filename><placeholder type="footnote" id="0"/>:
zh_CN: 以下是 <systemitem role="package">gentoo</systemitem> 软件包的 <filename>Makefile</filename> 文件中的相关部分<placeholder type="footnote" id="0"/>：

note: type: Content of: <book><chapter><section><para>
en: We see that the files are set to install under <filename>/usr/local</filename>.  As explained above, that directory hierarchy is reserved for local use on Debian, so change those paths as follows:
zh_CN: 可以看到文件被放到了 <filename>/usr/local</filename> 下。按照上边的解释，该目录被 Debian 保留作本地用途，所以请把它们按如下方式修改：

note: type: Content of: <book><chapter><section><para>
en: The exact locations that should be used for binaries, icons, documentation, etc. are specified in the Filesystem Hierarchy Standard (FHS).  You should browse through it and read the sections relevant to your package.
zh_CN: 二进制文件、图标和文档等的更确切位置均已在文件层级标准(FHS)中作出了详尽描述。本教程建议你快速浏览相关章节以获取你打包需要用到的内容。

note: type: Content of: <book><chapter><section><para>
en: So, we should install executable commands in <filename>/usr/bin</filename> instead of <filename>/usr/local/bin</filename>, the manual page in <filename>/usr/share/man/man1</filename> instead of <filename>/usr/local/man/man1</filename>, and so on.  Notice how there's no manual page mentioned in <systemitem role="package">gentoo</systemitem>'s <filename>Makefile</filename>, but since Debian Policy requires that every program has one, we'll make one later and install it in <filename>/usr/share/man/man1</filename>.
zh_CN: 因此，我们应当把可执行二进制文件安装到 <filename>/usr/bin</filename> 而非 <filename>/usr/local/bin</filename>，而 man 手册页则应放在 <filename>/usr/share/man/man1</filename> 而非 <filename>/usr/local/man/man1</filename>，依此类推。注意，<systemitem role="package">gentoo</systemitem> 的 <filename>Makefile</filename> 里没有提及手册页，而按照 Debian Policy 的要求，每个程序都应当有一个手册页，我们将在稍后制作一个并安装到 <filename>/usr/share/man/man1</filename>。

note: type: Content of: <book><chapter><section><para>
en: Some programs don't use <filename>Makefile</filename> variables to define paths such as these.  This means you might have to edit some real C sources in order to fix them to use the right locations.  But where to search, and exactly what for? You can find this out by issuing:
zh_CN: 有些程序不使用 <filename>Makefile</filename> 变量定义路径，这意味着你可能需要去编辑 C 程序源代码来使他们使用正确的路径。但是到哪里去搜索，哪些才是呢？你可以通过以下的方法找到它们：

note: type: Content of: <book><chapter><section><para>
en: <command>grep</command> will run recursively through the source tree and tell you the filename and the line number for all matches.
zh_CN: <command>grep</command> 会递归搜索整个源代码树并告诉你所有匹配项的文件名和行号。

note: type: Content of: <book><chapter><section><para>
en: Edit those files and in those lines replace <literal>usr/local/lib</literal> with <literal>usr/lib</literal>.  This can be done automatically as follows:
zh_CN: 编辑那些文件，在那些行中用 <literal>usr/lib</literal> 替换 <literal>usr/local/lib</literal>。这个过程可以用如下方法自动化完成：

note: type: Content of: <book><chapter><section><para>
en: If you want to confirm each substitution instead, this can be done interactively as follows:
zh_CN: 如果你想要确认每一个替换操作，那么下边的方法可以让你交互式地达成：

note: type: Content of: <book><chapter><section><para>
en: Next you should find the <literal>install</literal> target (searching for the line that starts with <literal>install:</literal> will usually work) and rename all references to directories other than ones defined at the top of the <filename>Makefile</filename>.
zh_CN: 紧接着你应该找到 <literal>install</literal> target (通常搜索以 <literal>install:</literal> 开头的行即可)，并把除 <filename>Makefile</filename> 顶部定义变量之外的目录引用妥当修改。

note: type: Content of: <book><chapter><section><para>
en: Originally, <systemitem role="package">gentoo</systemitem>'s <literal>install</literal> target said:
zh_CN: 原始的 <systemitem role="package">gentoo</systemitem> 的 <literal>install</literal> target 是这样：

note: type: Content of: <book><chapter><section><para>
en: Let's fix this upstream bug and record it with the <command>dquilt</command> command as <filename>debian/patches/install.patch</filename>.
zh_CN: 让我们来修复这个上游BUG，并把修改使用 <command>dquilt</command> 命令记录到<filename>debian/patches/install.patch</filename>。

note: type: Content of: <book><chapter><section><para>
en: In your editor, change this for the Debian package as follows:
zh_CN: 使用你喜欢的编辑器按照以下内容为 Debian 软件包作修改：

note: type: Content of: <book><chapter><section><para>
en: You'll have noticed that there's now an <literal>install -d</literal> command before the other commands in the rule.  The original <filename>Makefile</filename> didn't have it because usually <literal>/usr/local/bin</literal> and other directories already exist on the system where you are running <literal>make install</literal>.  However, since we will be installing into a newly created private directory tree, we will have to create each and every one of those directories.
zh_CN: 你一定会注意到规则里在其他命令前有了一个 <literal>install -d</literal> 命令。原始的 <filename>Makefile</filename> 文件中没有它，因为通常情况下当你执行 <literal>make install</literal> 命令时， <literal>/usr/local/bin</literal> 和用到的其他目录早已存在于系统中。然而当我们要向新建的私有目录树中安装时，我们必须创建其中的每一个目录。

note: type: Content of: <book><chapter><section><para>
en: We can also add in other things at the end of the rule, like the installation of additional documentation that the upstream authors sometimes omit:
zh_CN: 我们还可以在末尾添加上其他的内容，比如上游作者有时会省略的附加文档：

note: type: Content of: <book><chapter><section><para>
en: Check carefully, and if everything is okay, ask <command>dquilt</command> to generate the patch to create <filename>debian/patches/install.patch</filename> and add its description:
zh_CN: 仔细检查后如果没有问题，使用 <command>dquilt</command> 创建 <filename>debian/patches/install.patch</filename> 补丁文件并添加对它的描述：

note: type: Content of: <book><chapter><section><para>
en: Now you have a series of patches.
zh_CN: 现在你有了一系列的补丁。

note: type: Content of: <book><chapter><section><orderedlist><listitem><para>
en: Upstream bug fix: <filename>debian/patches/fix-gentoo-target.patch</filename>
zh_CN: 修复上游 Bug：<filename>debian/patches/fix-gentoo-target.patch</filename>

note: type: Content of: <book><chapter><section><orderedlist><listitem><para>
en: Debian specific packaging modification: <filename>debian/patches/install.patch</filename>
zh_CN: Debian 特有的打包时修改：<filename>debian/patches/install.patch</filename>

note: type: Content of: <book><chapter><section><para>
en: Whenever you make changes that are not specific to the Debian package such as <filename>debian/patches/fix-gentoo-target.patch</filename>, be sure to send them to the upstream maintainer so they can be included in the next version of the program and be useful to everyone else.  Also remember to avoid making your fixes specific to Debian or Linux &#x2014; or even Unix! Make them portable.  This will make your fixes much easier to apply.
zh_CN: 当进行任何非 Debian 特有的修改时，比如 <filename>debian/patches/fix-gentoo-target.patch</filename>，一定要向上游作者进行反馈，以便上游作者方便在下一版本中以使更多人受益。同时请记住不要做出特别针对 Debian 或 Linux (甚至是 Unix！)的修改，要使其可以移植，这会使你的修改更容易被接受。

note: type: Content of: <book><chapter><section><para>
en: Note that you don't have to send the <filename>debian/*</filename> files upstream.
zh_CN: 注意你不一定要把 <filename>debian/*</filename> 都提交到上游。

note: type: Content of: <book><chapter><section><title>
en: Differing libraries
zh_CN: 不同的库名称

note: type: Content of: <book><chapter><section><para>
en: There is one other common problem: libraries are often different from platform to platform.  For example, a <filename>Makefile</filename> can contain a reference to a library that doesn't exist on the Debian system.  In that case, we need to change it to a library that does exist in Debian, and serves the same purpose.
zh_CN: 还有另外一个常见的问题：不同平台之间的库名称常常因平台而异。例如一个 <filename>Makefile</filename> 中可能引了用一个 Debian 系统中不存在的库。这种情况下我们需要将其修改为 Debian 中存在的、提供完全相同功能的库。

note: type: Content of: <book><chapter><section><para>
en: Let's assume a line in your program's <filename>Makefile</filename> (or <filename>Makefile.in</filename>) as the following.
zh_CN: 如果你手中程序的 <filename>Makefile</filename>(或 <filename>Makefile.in</filename>)中有如下的行。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If there are API changes from the <literal>foo</literal> library to the <literal>foo2</literal> library, required changes to the source code need to be made to match the new API.
zh_CN: 如果从 <literal>foo</literal> 库切换到 <literal>foo2</literal> 库时要更改应用程序接口（API），这就要求我们修改源代码来符合新的 API。

note: type: Content of: <book><chapter><section><para>
en: If your program doesn't compile since the <literal>foo</literal> library doesn't exist and its equivalent is provided by the <literal>foo2</literal> library on the Debian system, you can fix this build problem as <filename>debian/patches/foo2.patch</filename> by changing <literal>foo</literal> into <literal>foo2</literal>:<placeholder type="footnote" id="0"/>
zh_CN: 如果你的程序由于 <literal>foo</literal> 库不存在，而 Debian 系统中的 <literal>foo2</literal> 库提供了其等效，那么你可以修复这个构建问题并将修改记录到 <filename>debian/patches/foo2.patch</filename> 中，只需要将 <literal>foo</literal> 切换到 <literal>foo2</literal>:<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><screen>
en: $ dquilt new foo2.patch
    $ dquilt add Makefile
    $ sed -i -e 's/-lfoo/-lfoo2/g' Makefile
    $ dquilt refresh
    $ dquilt header -e
    ... describe patch
zh_CN: $ dquilt new foo2.patch
    $ dquilt add Makefile
    $ sed -i -e 's/-lfoo/-lfoo2/g' Makefile
    $ quilt refresh
    $ quilt header -e
    ... 描述补丁

note: type: Content of: <book><chapter><title>
en: Required files under the <filename>debian</filename> directory
zh_CN: <filename>debian</filename> 目录中的必需内容

note: type: Content of: <book><chapter><para>
en: In this chapter, files in the <filename>debian</filename> directory are referred to without the leading <filename>debian/</filename> for simplicity whenever the meaning is obvious.
zh_CN: 在本章节中， 只要不产生歧义，所有提及的 <filename>debian</filename> 目录下的文件均会省去 <filename>debian/</filename> 前缀以求简洁方便。

note: type: Content of: <book><chapter><para>
en: There is a new subdirectory under the program's source directory, called <filename>debian</filename>.  There are a number of files in this directory that we should edit in order to customize the behavior of the package.  The most important of them are <filename>control</filename>, <filename>changelog</filename>, <filename>copyright</filename>, and <filename>rules</filename>, which are required for all packages.  <placeholder type="footnote" id="0"/>
zh_CN: 在程序源代码目录下有一个叫做 <filename>debian</filename> 的新的子目录。这个目录中存放着许多文件，我们将要修改这些文件来定制软件包行为。其中最重要的文件当属 <filename>control</filename>, <filename>changelog</filename>, <filename>copyright</filename>, 以及 <filename>rules</filename>, 所有的软件包都必须有这几个文件。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: This file contains various values which <command>dpkg</command>, <command>dselect</command>, <command>apt-get</command>, <command>apt-cache</command>, <command>aptitude</command>, and other package management tools will use to manage the package.  It is defined by the <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink>.
zh_CN: 这个文件包含了很多供 <command>dpkg</command>、<command>dselect</command>、<command>apt-get</command>、<command>apt-cache</command>、<command>aptitude</command> 等包管理工具进行管理时所使用的许多变量。这些变量均在 <ulink url="&policy-control;">Debian Policy Manual, 5 "Control files and their fields"</ulink> 中被定义。

note: type: Content of: <book><chapter><section><para>
en: Here is the <filename>control</filename> file <command>dh_make</command> created for us:
zh_CN: 这里的 <filename>control</filename> 文件是 <command>dh_make</command> 命令为我们创建的：

note: type: Content of: <book><chapter><section><para>
en: (I've added the line numbers.)
zh_CN: (注：我为它添加了行号。)

note: type: Content of: <book><chapter><section><para>
en: Lines 1&#x2013;7 are the control information for the source package.  Lines 9&#x2013;13 are the control information for the binary package.
zh_CN: 第 1&#x2013;7 行是源代码包的控制信息。第 9&#x2013;13 行是二进制包的控制信息。

note: type: Content of: <book><chapter><section><para>
en: Line 1 is the name of the source package.
zh_CN: 第 1 行是源代码包的名称。

note: type: Content of: <book><chapter><section><para>
en: Line 2 is the section of the distribution the source package goes into.
zh_CN: 第 2 行是该源码包要进入发行版中的分类。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 "Sections"</ulink> and <ulink url="&sections-unstable;">List of sections in <literal>sid</literal></ulink>.
zh_CN: 参见 <ulink url="&policy-subsections;">Debian Policy Manual, 2.4 "Sections"</ulink> 以及 <ulink url="&sections-unstable;">List of sections in <literal>sid</literal></ulink>.

note: type: Content of: <book><chapter><section><para>
en: As you may have noticed, the Debian archive is divided into multiple areas: <literal>main</literal> (the free software), <literal>non-free</literal> (the not really free software) and <literal>contrib</literal> (free software that depends on non-free software).  Each of these is divided into sections that classify packages into rough categories.  So we have <literal>admin</literal> for administrator-only programs, <literal>devel</literal> for programmer tools, <literal>doc</literal> for documentation, <literal>libs</literal> for libraries, <literal>mail</literal> for email readers and daemons, <literal>net</literal> for network apps and daemons, <literal>x11</literal> for X11 programs that don't fit anywhere else, and many more.  <placeholder type="footnote" id="0"/>
zh_CN: 你可能已经注意到，Debian 仓库被分为几个类别：<literal>main</literal> (自由软件)、<literal>non-free</literal> (非自由软件)以及 <literal>contrib</literal> (依赖于非自由软件的自由软件)。在这些大的分类之下还有多个逻辑上的子分类，用以简短描述软件包的用途类别。<literal>admin</literal> 为供系统管理员使用的程序，<literal>devel</literal> 为开发工具，<literal>doc</literal> 为文档，<literal>libs</literal> 为库，<literal>mail</literal> 为电子邮件阅读器或邮件系统守护程序，<literal>net</literal> 为网络应用程序或网络服务守护进程，<literal>x11</literal> 为不属于其他分类的为 X11 程序，此外还有很多很多。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: Let's change it then to x11.  (A <literal>main/</literal> prefix is implied so we can omit it.)
zh_CN: 我们将本例设置为 x11。( <literal>main/</literal> 前缀是默认值，可以省略。)

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 "Priorities"</ulink>.
zh_CN: 参见 <ulink url="&policy-priorities;">Debian Policy Manual, 2.5 "Priorities"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: Line 3 describes how important it is that the user installs this package.  <placeholder type="footnote" id="0"/>
zh_CN: 第 3 行描述了用户安装此软件包的优先级。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The <literal>optional</literal> priority will usually work for new packages that do not conflict with others claiming <literal>required</literal>, <literal>important</literal>, or <literal>standard</literal> priority.
zh_CN: <literal>optional</literal> 优先级适用于与优先级为 <literal>required</literal>、<literal>important</literal> 或 <literal>standard</literal> 的软件包不冲突的新软件包。

note: type: Content of: <book><chapter><section><para>
en: Section and priority are used by front-ends like <command>aptitude</command> when they sort packages and select defaults.  Once you upload the package to Debian, the value of these two fields can be overridden by the archive maintainers, in which case you will be notified by email.
zh_CN: Section 和 Priority 常被如 <command>aptitude</command> 的前端所使用，以分类软件包并选择默认值。一旦你把软件包上传到 Debian，这两项的值可以被仓库维护人员修改，此时你将收到提示邮件。

note: type: Content of: <book><chapter><section><para>
en: As this is a normal priority package and doesn't conflict with anything else, we will change the priority to <literal>optional</literal>.
zh_CN: 由于这是一个常规优先级的软件，并不与其他软件包冲突，我们将优先级改为 <literal>optional</literal>。

note: type: Content of: <book><chapter><section><para>
en: Line 4 is the name and email address of the maintainer.  Make sure that this field includes a valid <literal>To</literal> header for email, because after you upload it, the bug tracking system will use it to deliver bug emails to you.  Avoid using commas, ampersands, or parentheses.
zh_CN: 第 4 行是维护者的姓名和电子邮件地址。请确保此处的值可以直接用于电子邮件头的 <literal>To</literal> 项。因为一旦你将软件包上传至仓库，Bug 跟踪系统将使用它向你发送可能的 Bug 报告邮件。请避免使用逗号、“&amp;”符号或括号。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian Policy Manual, 7.7 "Relationships between source and binary packages - Build-Depends, Build-Depends-Indep, Build-Conflicts, Build-Conflicts-Indep"</ulink>.
zh_CN: 参见 <ulink url="&policy-relationships;#s-sourcebinarydeps">Debian Policy Manual, 7.7 "Relationships between source and binary packages - Build-Depends, Build-Depends-Indep, Build-Conflicts, Build-Conflicts-Indep"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: Line 5 includes the list of packages required to build your package as the <literal>Build-Depends</literal> field.  You can also have the <literal>Build-Depends-Indep</literal> field as an additional line here.  <placeholder type="footnote" id="0"/> Some packages like <systemitem role="package">gcc</systemitem> and <systemitem role="package">make</systemitem> which are required by the <systemitem role="package">build-essential</systemitem> package are implied.  If you need to have other tools to build your package, you should add them to these fields.  Multiple entries are separated with commas; read on for the explanation of binary package dependencies to find out more about the syntax of these lines.
zh_CN: 第 5 行中的 <literal>Build-Depends</literal> 项列出了编译此软件包需要的软件包。你还可以在这里添加一行 <literal>Build-Depends-Indep</literal> 作为附加。<placeholder type="footnote" id="0"/> 有些被 <systemitem role="package">build-essential</systemitem> 依赖的软件包，如 <systemitem role="package">gcc</systemitem> 和 <systemitem role="package">make</systemitem> 等，已经会被默认安装而不需再写到此处。如果你需要其他工具来编译这个软件包，请将它们加到这里。多个软件包应使用半角逗号分隔。继续阅读二进制包依赖关系以增进对这些行的语法的理解。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: For all packages packaged with the <command>dh</command> command in the <filename>debian/rules</filename> file, you must have <literal>debhelper (&gt;=9)</literal> in the <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement for the <literal>clean</literal> target.
zh_CN: 对于所有在 <filename>debian/rules</filename> 文件中使用 <command>dh</command> 命令打包的软件包，必须在 <literal>Build-Depends</literal> 中包含 <literal>debhelper (&gt;=9)</literal> 以满足 Debian Policy 中对 <literal>clean</literal> target 的要求。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Source packages which have binary packages with <literal>Architecture: any</literal> are rebuilt by the autobuilder.  Since this autobuilder procedure installs only the packages listed in the <literal>Build-Depends</literal> field before running <literal>debian/rules build</literal> (see <xref linkend="autobuilder"/>), the <literal>Build-Depends</literal> field needs to list practically all the required packages, and <literal>Build-Depends-Indep</literal> is rarely used.
zh_CN: 对于生成有标记过 <literal>Architecture: any</literal> 的二进制包的源码包，它们将被 autobuilder 重构建。因为 autobuilder 过程在仅安装 <literal>Build-Depends</literal> 中列出的程序前便执行 <literal>debian/rules build</literal> 中的内容(参看 <xref linkend="autobuilder"/>)，<literal>Build-Depends</literal> 字段需要列出所有必须的编译依赖，而 <literal>Build-Depends-Indep</literal> 则很少使用。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: For source packages with binary packages all of which are <literal>Architecture: all</literal>, the <literal>Build-Depends-Indep</literal> field may list all the required packages unless they are already listed in the <literal>Build-Depends</literal> field to satisfy the Debian Policy requirement for the <literal>clean</literal> target.
zh_CN: 对于生成全标记 <literal>Architecture: all</literal> 二进制包的源码包，<literal>Build-Depends-Indep</literal> 中应列出所有要求的软件包，除非  <literal>Build-Depends</literal> 中已经列出，这样以便满足Debian Policy 中对 <literal>clean</literal> target 的要求。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This somewhat strange situation is a feature well documented in the <ulink url="&policy-build-depends-indep;">Debian Policy Manual, Footnotes 55</ulink>.  This is not due to the use of the <command>dh</command> command in the <filename>debian/rules</filename> file but due to how the <command>dpkg-buildpackage</command> works.  The same situation applies to the <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">auto build system for Ubuntu</ulink>.
zh_CN: 这种奇怪的情况是 <ulink url="&policy-build-depends-indep;">Debian Policy Manual, Footnotes 55</ulink> 中详细描述的一种特性。这不是由于在 <filename>debian/rules</filename> 中使用 <command>dh</command> 命令所致的，真正的原因是 <command>dpkg-buildpackage</command> 的运行方式。相同的情形也适用于 <ulink url="https://bugs.launchpad.net/launchpad-buildd/+bug/238141">Ubuntu 的自动编译系统</ulink>。

note: type: Content of: <book><chapter><section><para>
en: If you are not sure which one should be used, use the <literal>Build-Depends</literal> field to be on the safe side.  <placeholder type="footnote" id="0"/>
zh_CN: 如果你不知道应该使用哪一个，则使用 <literal>Build-Depends</literal> 以保证安全。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: To find out what packages your package needs to be built run the command:
zh_CN: 要找出编译你的软件所需的软件包可以使用这个命令(译注：来自devscripts包)：

note: type: Content of: <book><chapter><section><para>
en: To manually find exact build dependencies for <command><replaceable>/usr/bin/foo</replaceable></command>, execute
zh_CN: 要手工地找到 <command><replaceable>/usr/bin/foo</replaceable></command> 的编译依赖，可以执行

note: type: Content of: <book><chapter><section><para>
en: and for each library listed (e.g., <command>libfoo.so.6</command>), execute
zh_CN: 对于列出的每个库（例如 <command>libfoo.so.6</command>），运行

note: type: Content of: <book><chapter><section><para>
en: Then just take the <literal>-dev</literal> version of every package as a <literal>Build-Depends</literal> entry.  If you use <command>ldd</command> for this purpose, it will report indirect lib dependencies as well, resulting in the problem of excessive build dependencies.
zh_CN: 接下来直接将相应的 <literal>-dev</literal> 版本的软件包名称放到 <literal>Build-Depends</literal> 项内。如果你使用 <command>ldd</command>，它也会报告出间接的库依赖关系，这可能造成填写依赖时画蛇添足。

note: type: Content of: <book><chapter><section><para>
en: <systemitem role="package">gentoo</systemitem> also happens to require <systemitem role="package">xlibs-dev</systemitem>, <systemitem role="package">libgtk1.2-dev</systemitem> and <systemitem role="package">libglib1.2-dev</systemitem> to build, so we'll add them here next to <systemitem role="package">debhelper</systemitem>.
zh_CN: <systemitem role="package">gentoo</systemitem> 需要 <systemitem role="package">xlibs-dev</systemitem>、<systemitem role="package">libgtk1.2-dev</systemitem> 和 <systemitem role="package">libglib1.2-dev</systemitem> 才能编译，所以我们将这些软件包加在 <systemitem role="package">debhelper</systemitem> 之后。

note: type: Content of: <book><chapter><section><para>
en: Line 6 is the version of the <ulink url="&debian-policy;">Debian Policy Manual</ulink> standards this package follows, the one you read while making your package.
zh_CN: 第 6 行是此软件包所依据的 <ulink url="&debian-policy;">Debian Policy Manual</ulink> 标准版本号。

note: type: Content of: <book><chapter><section><para>
en: On line 7 you can put the URL of the software's upstream homepage.
zh_CN: 在第 7 行你可以放置上游项目首页的URL。

note: type: Content of: <book><chapter><section><para>
en: Line 9 is the name of the binary package.  This is usually the same as the name of the source package, but it doesn't necessarily have to be that way.
zh_CN: 第 9 行是二进制软件包的名称。通常情况下与源代码包相同，但不是必须的。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-architecture;">Debian Policy Manual, 5.6.8 "Architecture"</ulink> for exact details.
zh_CN: 确切信息请参见 <ulink url="&policy-architecture;">Debian Policy Manual, 5.6.8 "Architecture"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: Line 10 describes the architectures the binary package can be compiled for.  This value is usually one of the following depending on the type of the binary package: <placeholder type="footnote" id="0"/>
zh_CN: 第 10 行描述了可以编译本二进制包的体系结构。根据二进制包的类型，这个值常常是下列中的一个： <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: The generated binary package is an architecture dependent one usually in a compiled language.
zh_CN: 一般而言，包含 编译型语言编写的程序 生成的二进制包依赖于具体的体系结构。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: The generated binary package is an architecture independent one usually consisting of text, images, or scripts in an interpreted language.
zh_CN: 一般而言，包含 文本、图像、或解释型语言脚本 生成的二进制包独立于体系结构。

note: type: Content of: <book><chapter><section><para>
en: We leave line 10 as is since this is written in C.  <citerefentry><refentrytitle>dpkg-gencontrol</refentrytitle><manvolnum>1</manvolnum></citerefentry> will fill in the appropriate architecture value for any machine this source package gets compiled on.
zh_CN: 我们不管第 10 行，鉴于本程序是用 C 语言编写的。 <citerefentry> <refentrytitle>dpkg-gencontrol</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令将根据这个软件包可以编译的平台 而为此处填写合适的信息。

note: type: Content of: <book><chapter><section><para>
en: If your package is architecture independent (for example, a shell or Perl script, or a document), change this to <literal>all</literal>, and read later in <xref linkend="rules"/> about using the <literal>binary-indep</literal> rule instead of <literal>binary-arch</literal> for building the package.
zh_CN: 如果你的软件包是平台独立的(例如一个 shell 或 Perl 脚本，或一些文档)，将这项改变为 <literal>all</literal>，然后继续阅读 <xref linkend="rules"/> 中关于使用 <literal>binary-indep</literal> 指令替代 <literal>binary-arch</literal> 来编译软件包的内容。

note: type: Content of: <book><chapter><section><para>
en: Line 11 shows one of the most powerful features of the Debian packaging system.  Packages can relate to each other in various ways.  Apart from <literal>Depends</literal>, other relationship fields are <literal>Recommends</literal>, <literal>Suggests</literal>, <literal>Pre-Depends</literal>, <literal>Breaks</literal>, <literal>Conflicts</literal>, <literal>Provides</literal>, and <literal>Replaces</literal>.
zh_CN: 第 11 行显示了 Debian 软件包系统中最强大的特性之一。每个软件包都可以和其他软件包有各种不同的关系。除 <literal>Depends</literal> 外，还有 <literal>Recommends</literal>、<literal>Suggests</literal>、<literal>Pre-Depends</literal>、<literal>Breaks</literal>、<literal>Conflicts</literal>、<literal>Provides</literal> 和 <literal>Replaces</literal>。

note: type: Content of: <book><chapter><section><para>
en: The package management tools usually behave the same way when dealing with these relations; if not, it will be explained.  (See <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>apt</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, etc.)
zh_CN: 软件包管理工具通常对这些关系采取相同的操作；如果有例外，本教程将会详细解释。(参看 <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>dselect</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>apt</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>aptitude</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 等。)

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&policy-relationships;">Debian Policy Manual, 7 "Declaring relationships between packages"</ulink>.
zh_CN: 参见 <ulink url="&policy-relationships;">Debian Policy Manual, 7 "Declaring relationships between packages"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: Here is a simplified description of package relationships: <placeholder type="footnote" id="0"/>
zh_CN: 这里有一篇关于软件包关系的简述： <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The package will not be installed unless the packages it depends on are installed.  Use this if your program absolutely will not run (or will cause severe breakage) unless a particular package is present.
zh_CN: 此软件包仅当它依赖的软件包均已安装后才可以安装。此处请写明你的程序所必须的软件包，如果没有要求的软件包该软件便不能正常运行（或严重抛锚）的话。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Use this for packages that are not strictly necessary but are typically used with your program.  When a user installs your program, all front-ends will probably prompt them to install the recommended packages.  <command>aptitude</command> and <command>apt-get</command> install recommended packages along with your package by default (but the user can disable this behavior).  <command>dpkg</command> will ignore this field.
zh_CN: 这项中的软件包不是严格意义上必须安装才可以保证程序运行。当用户安装软件包时，所有前端工具都会询问是否要安装这些推荐的软件包。<command>aptitude</command> 和 <command>apt-get</command> 会在安装你的软件包的时候自动安装推荐的软件包(用户可以禁用这个默认行为)。<command>dpkg</command> 则会忽略此项。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Use this for packages which will work nicely with your program but are not at all necessary.  When a user installs your program, they will probably not be prompted to install suggested packages.  <command>aptitude</command> can be configured to install suggested packages along with your package but this is not its default.  <command>dpkg</command> and <command>apt-get</command> will ignore this field.
zh_CN: 此项中的软件包可以和本程序更好地协同工作，但不是必须的。当用户安装程序时，所有的前端程序可能不会询问是否安装建议的软件包。<command>aptitude</command> 可以被配置为安装软件时自动安装建议的软件包，但这不是默认。<command>dpkg</command> 和 <command>apt-get</command> 将忽略此项。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This is stronger than <literal>Depends</literal>.  The package will not be installed unless the packages it pre-depends on are installed and <emphasis>correctly configured</emphasis>.  Use this <emphasis>very</emphasis> sparingly and only after discussing it on the <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org</ulink> mailing list.  Read: don't use it at all.  :-)
zh_CN: 此项中的依赖强于 <literal>Depends</literal> 项。软件包仅在预依赖的软件包已经安装并且 <emphasis>正确配置</emphasis> 后才可以正常安装。在使用此项时应 <emphasis>非常慎重</emphasis>，仅当在 <ulink url="&debian-devel-ldo;">debian-devel@lists.debian.org</ulink> 邮件列表讨论后才能使用。记住：根本就不要用这项。 :-)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: The package will not be installed until all the packages it conflicts with have been removed.  Use this if your program absolutely will not run or will cause severe problems if a particular package is present.
zh_CN: 仅当所有冲突的软件包都已经删除后此软件包才可以安装。当程序在某些特定软件包存在的情况下根本无法运行或存在严重问题时使用此项。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: When installed the package will break all the listed packages.  Normally a <literal>Breaks</literal> entry specifies that it applies to versions earlier than a certain value.  The resolution is generally to use higher-level package management tools to upgrade the listed packages.
zh_CN: 此软件包安装后列出的软件包将会受到损坏。通常 <literal>Breaks</literal> 要附带一个“版本号小于多少”的说明。这样，软件包管理工具将会选择升级被损坏的特定版本的软件包作为解决方案。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: For some types of packages where there are multiple alternatives, virtual names have been defined.  You can get the full list in the <ulink url="&virtual-package;">virtual-package-names-list.txt.gz</ulink> file.  Use this if your program provides a function of an existing virtual package.
zh_CN: 某些类型的软件包会定义有多个备用的虚拟名称。你可以在 <ulink url="&virtual-package;">virtual-package-names-list.txt.gz</ulink>文件中找到完整的列表。如果你的程序提供了某个已存在的虚拟软件包的功能则使用此项。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Use this when your program replaces files from another package, or completely replaces another package (used in conjunction with <literal>Conflicts</literal>).  Files from the named packages will be overwritten with the files from your package.
zh_CN: 当你的程序要替换其他软件包的某些文件，或是完全地替换另一个软件包(与 <literal>Conflicts</literal> 一起使用)。列出的软件包中的某些文件会被你软件包中的文件所覆盖。

note: type: Content of: <book><chapter><section><para>
en: All these fields have uniform syntax.  They are a list of package names separated by commas.  These package names may also be lists of alternative package names, separated by vertical bar symbols <literal>|</literal> (pipe symbols).
zh_CN: 所有的这些项都使用统一的语法。它们是一个软件包列表，软件包名称间使用半角逗号分隔。也可以写出有多个备选软件包名称，这些软件包使用 <literal>|</literal> 符号(管道符)分隔。

note: type: Content of: <book><chapter><section><para>
en: The fields may restrict their applicability to particular versions of each named package.  The restriction of each individual package is listed in parentheses after its name, and should contain a relation from the list below followed by a version number value.  The relations allowed are: <literal>&lt;&lt;</literal>, <literal>&lt;=</literal>, <literal>=</literal>, <literal>&gt;=</literal>, and <literal>&gt;&gt;</literal> for strictly lower, lower or equal, exactly equal, greater or equal, and strictly greater, respectively.  For example,
zh_CN: 这些项内还可以限定与某些软件包的某个版本区间之间的关系。版本号限定在括号内，这紧随软件包名称之后，并在以下逻辑符号后写清具体版本：<literal>&lt;&lt;</literal>、<literal>&lt;=</literal>、<literal>=</literal>、<literal>&gt;=</literal> 和 <literal>&gt;&gt;</literal>，分别代表严格小于、小于或等于、严格等于、大于或等于以及严格大于。例如，

note: type: Content of: <book><chapter><section><para>
en: The last feature you need to know about is <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>, <literal>${misc:Depends}</literal>, etc.
zh_CN: 最后一个需要了解的特性是 <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>, <literal>${misc:Depends}</literal>, 之类。

note: type: Content of: <book><chapter><section><para>
en: <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> calculates shared library dependencies for binary packages.  It generates a list of <ulink url="&elf;">ELF</ulink> executables and shared libraries it has found for each binary package.  This list is used for substituting <literal>${shlibs:Depends}</literal>.
zh_CN: <citerefentry> <refentrytitle>dh_shlibdeps</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 会为二进制包计算共享库依赖关系。它会为每个二进制包生成一份 <ulink url="&elf;">ELF</ulink> 可执行文件和共享库列表。 这个列表用于替换 <literal>${shlibs:Depends}</literal>。

note: type: Content of: <book><chapter><section><para>
en: <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> calculates Perl dependencies.  It generates a list of a dependencies on <literal>perl</literal> or <literal>perlapi</literal> for each binary package.  This list is used for substituting <literal>${perl:Depends}</literal>.
zh_CN: <citerefentry> <refentrytitle>dh_perl</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 会计算 Perl 依赖。它会为每个二进制包生成一个叫作 <literal>perl</literal> 或 <literal>perlapi</literal> 的依赖列表。这个列表用于替换 <literal>${perl:Depends}</literal>。

note: type: Content of: <book><chapter><section><para>
en: Some <systemitem role="package">debhelper</systemitem> commands may cause the generated package to depend on some additional packages.  All such commands generate a list of required packages for each binary package.  This list is used for substituting <literal>${misc:Depends}</literal>.
zh_CN: 一些 <systemitem role="package">debhelper</systemitem> 命令可能会使生成的软件包需要依赖于某些其他的软件包。所有这些命令将会为每一个二进制包生成一个列表。这些列表将用于替换 <literal>${misc:Depends}</literal> 。

note: type: Content of: <book><chapter><section><para>
en: <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> generates <filename>DEBIAN/control</filename> for each binary package while substituting <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>, <literal>${misc:Depends}</literal>, etc.
zh_CN: <citerefentry> <refentrytitle>dh_gencontrol</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 会为每个二进制包生成 <filename>DEBIAN/control</filename> 当替换 <literal>${shlibs:Depends}</literal>, <literal>${perl:Depends}</literal>, <literal>${misc:Depends}</literal>, 之类的时候。

note: type: Content of: <book><chapter><section><para>
en: Having said all that, we can leave the <literal>Depends</literal> field exactly as it is now, and insert another line after it saying <literal>Suggests: file</literal>, because <systemitem role="package">gentoo</systemitem> can use some features provided by the <systemitem role="package">file</systemitem> package.
zh_CN: 说过这些以后，我们可以让 <literal>Depends</literal> 项保持现状，并在其下插入一行 <literal>Suggests: file</literal>，因为 <systemitem role="package">gentoo</systemitem> 可以使用 <systemitem role="package">file</systemitem> 软件包提供的某些特性。

note: type: Content of: <book><chapter><section><para>
en: Line 9 is the Homepage URL.  Let's assume this to be at <ulink url="&gentoo;"/>.
zh_CN: 第 9 行是主页的URL。我们假设它是 <ulink url="&gentoo;"/>。

note: type: Content of: <book><chapter><section><para>
en: Line 12 is the short description.  Terminals are conventionally 80 columns wide so this shouldn't be longer than about 60 characters.  I'll change it to <literal>fully GUI-configurable, two-pane X file manager</literal>.
zh_CN: 第 12 行是简述。绝大多数人的屏幕是 80 列宽，所以描述不应超过 60 个字符。在这个例子里我把它写为 <literal>fully GUI-configurable, two-pane X file manager</literal>。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: These descriptions are in English.  Translations of these descriptions are provided by <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink>.
zh_CN: 这些描述都使用英语。相应的翻译由 <ulink url="&ddtp;">The Debian Description Translation Project - DDTP</ulink> （Debian 描述翻译项目）项目提供。

note: type: Content of: <book><chapter><section><para>
en: Line 13 is where the long description goes.  This should be a paragraph which gives more details about the package.  Column 1 of each line should be empty.  There must be no blank lines, but you can put a single <literal>.</literal> (dot) in a column to simulate that.  Also, there must be no more than one blank line after the long description. <placeholder type="footnote" id="0"/>
zh_CN: 第 13 行是长描述开始的地方。这应当是一段更详细地描述软件包的话。每行的第一个格应当留空。描述中不应存在空行，如果必须使用空行，则在行中仅放置一个 <literal>.</literal> (半角句点)来近似。同时，长描述后也不应有超过一行的空白。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&devref-bpp-vcs;">Debian Developer's Reference, 6.2.5. "Version Control System location"</ulink>.
zh_CN: 参见 <ulink url="&devref-bpp-vcs;">Debian Developer's Reference, 6.2.5. "Version Control System location"</ulink>。

note: type: Content of: <book><chapter><section><para>
en: We can insert <literal>Vcs-*</literal> fields to document the Version Control System (VCS) location between lines 6 and 7.  <placeholder type="footnote" id="0"/> Let's assume that the <systemitem role="package">gentoo</systemitem> package has its VCS located in the Debian Alioth Git Service at <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>.
zh_CN: 接下来我们在第 6 和第 7 行之间添加版本控制系统位置 <literal>Vcs-*</literal> 项。<placeholder type="footnote" id="0"/> 这里我们假设 <systemitem role="package">gentoo</systemitem> 软件包的VCS 处于 Debian Alioth Git 服务的 <literal>git://git.debian.org/git/collab-maint/gentoo.git</literal>

note: type: Content of: <book><chapter><section><para>
en: Finally, here is the updated <filename>control</filename> file:
zh_CN: 到此为止，我们做好了 <filename>control</filename> 文件：

note: type: Content of: <book><chapter><section><screen>
en:  1 Source: gentoo
     2 Section: x11
     3 Priority: optional
     4 Maintainer: Josip Rodin &lt;joy-mg@debian.org&gt;
     5 Build-Depends: debhelper (&gt;=10), xlibs-dev, libgtk1.2-dev, libglib1.2-dev
     6 Standards-Version: 4.0.0
     7 Vcs-Git: https://anonscm.debian.org/git/collab-maint/gentoo.git
     8 Vcs-browser: https://anonscm.debian.org/git/collab-maint/gentoo.git
     9 Homepage: &gentoo;
    10
    11 Package: gentoo
    12 Architecture: any
    13 Depends: ${shlibs:Depends}, ${misc:Depends}
    14 Suggests: file
    15 Description: fully GUI-configurable, two-pane X file manager
    16  gentoo is a two-pane file manager for the X Window System. gentoo lets the
    17  user do (almost) all of the configuration and customizing from within the
    18  program itself. If you still prefer to hand-edit configuration files,
    19  they're fairly easy to work with since they are written in an XML format.
    20  .
    21  gentoo features a fairly complex and powerful file identification system,
    22  coupled to an object-oriented style system, which together give you a lot
    23  of control over how files of different types are displayed and acted upon.
    24  Additionally, over a hundred pixmap images are available for use in file
    25  type descriptions.
    26  .
    29  gentoo was written from scratch in ANSI C, and it utilizes the GTK+ toolkit
    30  for its interface.
zh_CN:  1 Source: gentoo
     2 Section: x11
     3 Priority: optional
     4 Maintainer: Josip Rodin &lt;joy-mg@debian.org&gt;
     5 Build-Depends: debhelper (&gt;=10), xlibs-dev, libgtk1.2-dev, libglib1.2-dev
     6 Standards-Version: 3.9.4
     7 Vcs-Git: https://anonscm.debian.org/git/collab-maint/gentoo.git
     8 Vcs-browser: https://anonscm.debian.org/git/collab-maint/gentoo.git
     9 Homepage: &gentoo;
    10
    11 Package: gentoo
    12 Architecture: any
    13 Depends: ${shlibs:Depends}, ${misc:Depends}
    14 Suggests: file
    15 Description: fully GUI-configurable, two-pane X file manager
    16  gentoo is a two-pane file manager for the X Window System. gentoo lets the
    17  user do (almost) all of the configuration and customizing from within the
    18  program itself. If you still prefer to hand-edit configuration files,
    19  they're fairly easy to work with since they are written in an XML format.
    20  .
    21  gentoo features a fairly complex and powerful file identification system,
    22  coupled to an object-oriented style system, which together give you a lot
    23  of control over how files of different types are displayed and acted upon.
    24  Additionally, over a hundred pixmap images are available for use in file
    25  type descriptions.
    26  .
    29  gentoo was written from scratch in ANSI C, and it utilizes the GTK+ toolkit
    30  for its interface.

note: type: Content of: <book><chapter><section><para>
en: This file contains information about the copyright and license of the upstream sources.  <ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink> dictates its content and <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink> provides guidelines for its format.
zh_CN: 这个文件包含了上游软件的版权以及许可证信息。<ulink url="&policy-copyright;">Debian Policy Manual, 12.5 "Copyright information"</ulink> 掌控着它的内容，另外 <ulink url="&dep5;">DEP-5: Machine-parseable <filename>debian/copyright</filename></ulink> 提供了关于其格式的方针。

note: type: Content of: <book><chapter><section><para>
en: <command>dh_make</command> can give you a template <filename>copyright</filename> file.  Let's use the <literal>--copyright gpl2</literal> option here to get a template file for the <systemitem role="package">gentoo</systemitem> package released under GPL-2.
zh_CN: <command>dh_make</command> 可以给出一个 <filename>copyright</filename> 文件的模板。在这里我们使用 <literal>--copyright gpl2</literal> 参数来获得一个模板写明 <systemitem role="package">gentoo</systemitem> 软件包是发布于 GPL-2 许可证下。

note: type: Content of: <book><chapter><section><para>
en: You must fill in missing information to complete this file, such as the place you got the package from, the actual copyright notice, and the license.  For certain common free software licenses (GNU GPL-1, GNU GPL-2, GNU GPL-3, LGPL-2, LGPL-2.1, LGPL-3, GNU FDL-1.2, GNU FDL-1.3, Apache-2.0, 3-Clause BSD, CC0-1.0, MPL-1.1, MPL-2.0 or the Artistic license), you can just refer to the appropriate file in the <filename>/usr/share/common-licenses/</filename> directory that exists on every Debian system.  Otherwise, you must include the complete license.
zh_CN: 你必须填写上空缺的信息，如你从何处获得此软件，实际的版权声明和它们的许可证。对于常见的自由软件许可证，如 GNU GPL-1、GNU GPL-2、GNU GPL-3、LGPL-2、LGPL-2.1、LGPL-3、GNU FDL-1.2、GNU FDL-1.3、Apache-2.0、3-Clause BSD、CC0-1.0、MPL-1.1、MPL-2.0 或 Artistic 许可证，你可以直接将其指向所有 Debian 系统都有的 <filename>/usr/share/common-licenses/</filename> 目录下的文件。否则，许可证则必须包含完整的许可证文本。

note: type: Content of: <book><chapter><section><para>
en: In short, here's what <systemitem role="package">gentoo</systemitem>'s <filename>copyright</filename> file should look like:
zh_CN: 简言之，<systemitem role="package">gentoo</systemitem> 的 <filename>copyright</filename> 文件如下所示：

note: type: Content of: <book><chapter><section><para>
en: Please follow the HOWTO provided by the ftpmasters and sent to debian-devel-announce: <ulink url="&howto-copyright;"/>.
zh_CN: 另外还可以参看 ftpmasters 发送到 debian-devel-announce 的 HOWTO： announce: <ulink url="&howto-copyright;"/>.

note: type: Content of: <book><chapter><section><para>
en: This is a required file, which has a special format described in <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink>.  This format is used by <command>dpkg</command> and other programs to obtain the version number, revision, distribution, and urgency of your package.
zh_CN: 这是一个必须的文件，它的特殊格式在 <ulink url="&policy-dpkgchangelog;">Debian Policy Manual, 4.4 "debian/changelog"</ulink> 中有详细的描述。这种格式被 <command>dpkg</command> 和其他程序用以解析版本号信息、适用的发行版和紧急程度。

note: type: Content of: <book><chapter><section><para>
en: For you, it is also important, since it is good to have documented all changes you have done.  It will help people downloading your package to see whether there are issues with the package that they should know about.  It will be saved as <filename>/usr/share/doc/gentoo/changelog.Debian.gz</filename> in the binary package.
zh_CN: 对于你而言，详细描述你所做出的更改也是很好且很重要的。它将帮助下载你的软件包的人了解这个软件包中是否有他们需要知道的事情。它会被作为 <filename>/usr/share/doc/gentoo/changelog.Debian.gz</filename> 保存在二进制包中。

note: type: Content of: <book><chapter><section><para>
en: <command>dh_make</command> created a default one, and this is what it looks like:
zh_CN: <command>dh_make</command> 创建了一个默认的文件，这是它的容貌：

note: type: Content of: <book><chapter><section><para>
en: Line 1 is the package name, version, distribution, and urgency.  The name must match the source package name; distribution should be <literal>unstable</literal>, and urgency should be set to medium unless there is any particular reason for other values.
zh_CN: 第 1 行是软件包名、版本号、发行版和紧急程度。软件包名必须与实际的源代码包名相同，发行版应该是 <literal>unstable</literal>。除非有特殊原因，紧急程度默认设置为 medium（中等）。

note: type: Content of: <book><chapter><section><para>
en: Lines 3-5 are a log entry, where you document changes made in this package revision (not the upstream changes &#x2014; there is a special file for that purpose, created by the upstream authors, which you will later install as <filename>/usr/share/doc/gentoo/changelog.gz</filename>).  Let's assume your ITP (Intent To Package) bug report number was <literal>12345</literal>.  New lines must be inserted just below the uppermost line that begins with <literal>*</literal> (asterisk).  You can do it with <citerefentry> <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  You can edit this manually with a text editor as long as you follow the formatting convention used by the <citerefentry> <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 第 3-5 行是一个很长的条目，记录了你在这个 Debian 修订版本中做出的修改(非上游修改——上游修改由上游作者创建并由另外一个文件维护，它们应被安装为 <filename>/usr/share/doc/gentoo/changelog.gz</filename>)。假设你的 ITP (Intent To Package，计划打包)的 Bug 号为 <literal>12345</literal>。新行必须插入在上一个以星号 <literal>*</literal> 开头的行的正下方。你可以使用 <citerefentry> <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 完成这个工作，也可以使用普通的文本编辑器手工完成，只要你遵循 <citerefentry> <refentrytitle>dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 所使用的格式。

note: type: Content of: <book><chapter><section><para>
en: In order to prevent a package being accidentally uploaded before completing the package, it is a good idea to change the distribution value to an invalid distribution value of <literal>UNRELEASED</literal>.
zh_CN: 为了阻止软件包在打包完成之前被意外上传，将发行版值改成一个不可用的 <literal>UNRELEASED</literal> 将是一个很好的选择。

note: type: Content of: <book><chapter><section><para>
en: You will end up with something like this:
zh_CN: 最后它会成为以下的样子：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: If you use the <literal>dch -r</literal> command to make this last change, please make sure to save the <filename>changelog</filename> file explicitly by the editor.
zh_CN: 如果你用 <literal>dch -r</literal> 命令来使它成为最后一笔更改， 请确保用编辑器显式地保存 <filename>changelog</filename> 文件。

note: type: Content of: <book><chapter><section><para>
en: Once you are satisfied with all the changes and documented them in <filename>changelog</filename>, you should change the distribution value from <literal>UNRELEASED</literal> to the target distribution value <literal>unstable</literal> (or even <literal>experimental</literal>).  <placeholder type="footnote" id="0"/>
zh_CN: 如果你已经对自己所作出的改动感到满意，而且它们都被记录在了 <filename>changelog</filename> 中，那么你就可以将发行版值由 <literal>UNRELEASED</literal> 修改至目标发行版值 <literal>unstable</literal> (甚至 <literal>experimental</literal>)。  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: You can read more about updating the <filename>changelog</filename> file later in <xref linkend="update"/>.
zh_CN: 你可以在关于更新的 <xref linkend="update"/> 中了解更多关于 <filename>changelog</filename> 的内容。

note: type: Content of: <book><chapter><section><para>
en: Now we need to take a look at the exact rules that <citerefentry> <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> will use to actually create the package.  This file is in fact another <filename>Makefile</filename>, but different from the one(s) in the upstream source.  Unlike other files in <filename>debian</filename>, this one is marked as executable.
zh_CN: 现在我们需要看看 <citerefentry> <refentrytitle>dpkg-buildpackage</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 用于实际创建软件包的 rules 文件。这个文件事实上是另一个 <filename>Makefile</filename>，但不同于上游源代码中的那个。和 <filename>debian</filename> 目录中的其他文件不同，这个文件被标记为可执行。

note: type: Content of: <book><chapter><section><section><title>
en: Targets of the <filename>rules</filename> file
zh_CN: <filename>rules</filename> 文件中的 Target

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: You can start learning how to write a <filename>Makefile</filename> from <ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>.  The full documentation is available as <ulink url="&gnu-make;"></ulink> or as the <systemitem role="package">make-doc</systemitem> package in the <literal>non-free</literal> archive area.
zh_CN: 你可以通过该资源来学习编写 <filename>Makefile</filename> ：<ulink url="&debref-make;">Debian Reference, 12.2. "Make"</ulink>。 完整文档在 <ulink url="&gnu-make;"></ulink> 或者 <systemitem role="package">make-doc</systemitem> 软件包 (该包位于 <literal>non-free</literal> 部分）。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: <ulink url="&policy-debianrules;">Debian Policy Manual, 4.9 "Main building script: debian/rules"</ulink> explains the details.
zh_CN: <ulink url="&policy-debianrules;">Debian Policy Manual, 4.9 "Main building script: debian/rules"</ulink> 针对细节进行了解释。

note: type: Content of: <book><chapter><section><section><para>
en: Every <filename>rules</filename> file, like any other <filename>Makefile</filename>, consists of several rules, each of which defines a target and how it is carried out.  <placeholder type="footnote" id="0"/> A new rule begins with its target declaration in the first column.  The following lines beginning with the TAB code (ASCII 9) specify the recipe for carrying out that target.  Empty lines and lines beginning with <literal>#</literal> (hash) are treated as comments and ignored.  <placeholder type="footnote" id="1"/>
zh_CN: 每一个 <filename>rules</filename> 文件， 就像其他的 <filename>Makefile</filename> 一样，包含着若干 rules，其中每一个都定义了一个 target 以及其具体 操作。 <placeholder type="footnote" id="0"/> 一个新的 rule  以自己的 target 声明(置于第一列)来起头。 后续的行都以 TAB 字符 (ASCII 9) 来开头，以指示 target 的具体行为。 空行和以井号 <literal>#</literal> 开头的行会被当作注释而被忽略。  <placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><section><para>
en: A rule that you want to execute is invoked by its target name as a command line argument.  For example, <literal>debian/rules <replaceable>build</replaceable></literal> and <literal>fakeroot make -f debian/rules <replaceable>binary</replaceable></literal> execute rules for <literal><replaceable>build</replaceable></literal> and <literal><replaceable>binary</replaceable></literal> targets, respectively.
zh_CN: 当你想要执行一个 rule 的时候，就将 target（目标）名称作为命令行参数来调用。比如说， <literal>debian/rules <replaceable>build</replaceable></literal> 以及 <literal>fakeroot make -f debian/rules <replaceable>binary</replaceable></literal> 会分别执行 <literal><replaceable>build</replaceable></literal> 和 <literal><replaceable>binary</replaceable></literal> 两个 target。

note: type: Content of: <book><chapter><section><section><para>
en: Here is a simplified explanation of the targets:
zh_CN: 以下是对各 target 的简单解释：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>clean</literal> target: to clean all compiled, generated, and useless files in the build-tree.  (Required)
zh_CN: <literal>clean</literal> target：清理所有编译的、生成的或编译树中无用的文件。(必须)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>build</literal> target: to build the source into compiled programs and formatted documents in the build-tree.  (Required)
zh_CN: <literal>build</literal> target：在编译树中将代码编译为程序并生成格式化的文档。(必须)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>build-arch</literal> target: to build the source into arch-dependent compiled programs in the build-tree.  (Required)
zh_CN: <literal>build-arch</literal> target：在编译树中将代码编译为依赖于体系结构的程序。(必须)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>build-indep</literal> target: to build the source into arch-independent formatted documents in the build-tree.  (Required)
zh_CN: <literal>build-indep</literal> target：在编译树中将代码编译为独立于平台的格式化文档。(必须)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>install</literal> target: to install files into a file tree for each binary package under the <filename>debian</filename> directory.  If defined, <literal>binary*</literal> targets effectively depend on this target.  (Optional)
zh_CN: <literal>install</literal> target：把文件安装到 <filename>debian</filename> 目录内为各个二进制包构建的文件树。如果有定义，那么 <literal>binary*</literal> target 则会依赖于此 target。(可选)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: This target is used by <literal>dpkg-buildpackage</literal> as in <xref linkend="completebuild"/>.
zh_CN: 此 target 被 <literal>dpkg-buildpackage</literal> 用于 <xref linkend="completebuild"/> 描述的过程中。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>binary</literal> target: to create all binary packages (effectively a combination of <literal>binary-arch</literal> and <literal>binary-indep</literal> targets).  (Required)<placeholder type="footnote" id="0"/>
zh_CN: <literal>binary</literal> target：创建所有二进制包(是 <literal>binary-arch</literal> 和 <literal>binary-indep</literal> 的合并)。(必须)<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: This target is used by <literal>dpkg-buildpackage -B</literal> as in <xref linkend="autobuilder"/>.
zh_CN: 此 target 被 <literal>dpkg-buildpackage -B</literal> 用于<xref linkend="autobuilder"/> 描述的过程中。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>binary-arch</literal> target: to create arch-dependent (<literal>Architecture: any</literal>) binary packages in the parent directory.  (Required)<placeholder type="footnote" id="0"/>
zh_CN: <literal>binary-arch</literal> target：在父目录中创建平台依赖(<literal>Architecture: any</literal>)的二进制包。(必须)<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: This target is used by <literal>dpkg-buildpackage -A</literal>.
zh_CN: 此 target 被 <literal>dpkg-buildpackage -A</literal> 使用。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>binary-indep</literal> target: to create arch-independent (<literal>Architecture: all</literal>) binary packages in the parent directory.  (Required)<placeholder type="footnote" id="0"/>
zh_CN: <literal>binary-indep</literal> target：在父目录中创建平台独立(<literal>Architecture: all</literal>)的二进制包。(必须)<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>get-orig-source</literal> target: to obtain the most recent version of the original source package from an upstream archive.  (Optional)
zh_CN: <literal>get-orig-source</literal> target：从上游站点获得最新的原始源代码包。(可选)

note: type: Content of: <book><chapter><section><section><para>
en: You are probably overwhelmed by now, but things are much simpler upon examination of the <filename>rules</filename> file that <command>dh_make</command> gives us as a default.
zh_CN: 可能你现在感到有些迷惑，在接下来讲解 <command>dh_make</command> 给出的默认的 <filename>rules</filename> 文件时事情会变得简单。

note: type: Content of: <book><chapter><section><section><title>
en: Default <filename>rules</filename> file
zh_CN: 默认的 <filename>rules</filename> 文件

note: type: Content of: <book><chapter><section><section><para>
en: Newer <command>dh_make</command> generates a very simple but powerful default <filename>rules</filename> file using the <command>dh</command> command:
zh_CN: 新版本的 <command>dh_make</command> 会生成一个使用 <command>dh</command> 命令的非常简单但非常强大的默认的 <filename>rules</filename> 文件：

note: type: Content of: <book><chapter><section><section><para>
en: (I've added the line numbers and trimmed some comments.  In the actual <filename>rules</filename> file, the leading spaces are a TAB code.)
zh_CN: (注：我添加了行号并删去了一些注释。实际的 <filename>rules</filename> 文件里开头的空格是 TAB 填充的。)

note: type: Content of: <book><chapter><section><section><para>
en: You are probably familiar with lines like line 1 from shell and Perl scripts.  It tells the operating system that this file is to be processed with <filename>/usr/bin/make</filename>.
zh_CN: 可能在 shell 或 Perl 脚本中你已经对第一行的形式很熟悉了，它告诉操作系统这个文件应使用 <filename>/usr/bin/make</filename> 处理。

note: type: Content of: <book><chapter><section><section><para>
en: Line 4 can be uncommented to set the <literal>DH_VERBOSE</literal> variable to 1, so that the <command>dh</command> command outputs which <command>dh_*</command> commands it is executing.  You can also add a line <literal>export DH_OPTIONS=-v</literal> here, so that each <command>dh_*</command> command outputs which commands it is executing.  This helps you to understand exactly what is going on behind this simple <filename>rules</filename> file and to debug its problems.  This new <command>dh</command> is designed to form a core part of the <systemitem role="package">debhelper</systemitem> tools, and not to hide anything from you.
zh_CN: 可以取消第 4 行的注释，以设置 <literal>DH_VERBOSE</literal> 变量为 1， 于是 <command>dh</command> 命令就会输出它将要使用的 <command>dh_*</command> 命令。 你也可以在此添加一行 <literal>export DH_OPTIONS=-v</literal> ， 于是 <command>dh_*</command> 命令 同样也会输出它正在调用的命令。 这能帮助你理解在这个简单的 <filename>rules</filename> 文件背后发生了什么，以及帮助你进行调试。新的 <command>dh</command> 被设计来作为 <systemitem role="package">debhelper</systemitem> 工具的核心部分，并不向你隐藏任何东西。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: This uses the new <systemitem role="package">debhelper</systemitem> v7+ features.  Its design concepts are explained in <ulink url="&debhelper-slides;">Not Your Grandpa's Debhelper</ulink> presented at DebConf9 by the <systemitem role="package">debhelper</systemitem> upstream.  Under <literal>lenny</literal>, <command>dh_make</command> created a much more complicated <filename>rules</filename> file with explicit rules and many <command>dh_*</command> scripts listed for each one, most of which are now unnecessary (and show the package's age). The new <command>dh</command> command is simpler and frees us from doing the routine work "manually". You still have full power to customize the process with <literal>override_dh_*</literal> targets. See <xref linkend="customrules"/>.  It is based only on the <systemitem role="package">debhelper</systemitem> package and does not obfuscate the package building process as the <systemitem role="package">cdbs</systemitem> package tends to do.
zh_CN: 此处使用了新版本 <systemitem role="package">debhelper</systemitem> v7+ 的特性。 它的设计理念在 <ulink url="&debhelper-slides;">Not Your Grandpa's Debhelper</ulink> 中进行了阐明，这在 DebConf9 中被 <systemitem role="package">debhelper</systemitem> 上游进行了演示。 在 <literal>lenny</literal> 下， <command>dh_make</command> 会创建一个更为复杂 的 <filename>rules</filename> 文件，伴有许多显式的 rule 和许多为每个 rule 所用的<command>dh_*</command> 脚本，其中有大部分在现在已经是不必要的了(这也显示了软件包的年龄)。 新一代的 <command>dh</command> 命令更为简洁，并能将我们从"手工的重复工作"中解放出来。当然，你仍然拥有完全的力量来定制整个过程，只要使用 <literal>override_dh_*</literal> target。参见 <xref linkend="customrules"/>。  它仅仅基建于 <systemitem role="package">debhelper</systemitem> 软件包，而且不会像 <systemitem role="package">cdbs</systemitem> 软件包所倾向的那样混淆软件包构建过程。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: You can verify the actual sequences of <command>dh_*</command> programs invoked for a given <literal><replaceable>target</replaceable></literal> without really running them by invoking <literal>dh <replaceable>target</replaceable> --no-act</literal> or <literal>debian/rules -- '<replaceable>target</replaceable> --no-act'</literal>.
zh_CN: 你可以检验每一个已有的 <literal><replaceable>target</replaceable></literal> 所调用的实际 <command>dh_*</command> 程序序列，而并不需要真的通过 <literal>dh <replaceable>target</replaceable> --no-act</literal> 或 <literal>debian/rules -- '<replaceable>target</replaceable> --no-act'</literal> 来执行以查看。

note: type: Content of: <book><chapter><section><section><para>
en: Lines 16 and 17 are where all the work is done with an implicit rule using the pattern rule.  The percent sign means "any targets", which then call a single program, <command>dh</command>, with the target name.  <placeholder type="footnote" id="0"/> The <command>dh</command> command is a wrapper script that runs appropriate sequences of <command>dh_*</command> programs depending on its argument.  <placeholder type="footnote" id="1"/>
zh_CN: 第 16 和 17 行使用了 pattern rule，以此隐式地完成所有工作。 其中的百分号意味着“任何 targets”， 它会以 target 名称作参数调用单个程序  <command>dh</command>。  <placeholder type="footnote" id="0"/> <command>dh</command> 命令是一个包装脚本，它会根据参数执行妥当的 <command>dh_*</command> 程序序列。 <placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>debian/rules clean</literal> runs <literal>dh clean</literal>, which in turn runs the following:
zh_CN: <literal>debian/rules clean</literal> 运行了 <literal>dh clean</literal>，接下来实际执行的命令为：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>debian/rules build</literal> runs <literal>dh build</literal>, which in turn runs the following:
zh_CN: <literal>debian/rules build</literal> 运行了 <literal>dh build</literal>，其实际执行的命令为：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: The following example assumes your <filename>debian/compat</filename> has a value equal or more than 9 to avoid invoking any python support commands automatically.
zh_CN: 下边的例子假定你的 <filename>debian/compat</filename> 有一个 值大于或等于 9 ，以此避免自动调用任何 python 支持命令。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>fakeroot debian/rules binary</literal> runs <literal>fakeroot dh binary</literal>, which in turn runs the following<placeholder type="footnote" id="0"/>:
zh_CN: <literal>fakeroot debian/rules binary</literal> 执行了 <literal>fakeroot dh binary</literal>，其实际执行的命令为<placeholder type="footnote" id="0"/>：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>fakeroot debian/rules binary-arch</literal> runs <literal>fakeroot dh binary-arch</literal>, which in turn runs the same sequence as <literal>fakeroot dh binary</literal> but with the <literal>-a</literal> option appended for each command.
zh_CN: <literal>fakeroot debian/rules binary-arch</literal> 执行了 <literal>fakeroot dh binary-arch</literal>，其效果等同于 <literal>fakeroot dh binary</literal> 并附加 <literal>-a</literal> 参数于每个命令后。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <literal>fakeroot debian/rules binary-indep</literal> runs <literal>fakeroot dh binary-indep</literal>, which in turn runs almost the same sequence as <literal>fakeroot dh binary</literal> but excluding <command>dh_strip</command>, <command>dh_makeshlibs</command>, and <command>dh_shlibdeps</command> with the <literal>-i</literal> option appended for each remaining command.
zh_CN: <literal>fakeroot debian/rules binary-indep</literal> 执行了 <literal>fakeroot dh binary-indep</literal>，这会运行几乎和 <literal>fakeroot dh binary</literal> 一样的命令，但 <command>dh_strip</command>、<command>dh_makeshlibs</command> 和 <command>dh_shlibdeps</command> 除外，其他命令则均附加<literal>-i</literal> 选项。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: For complete information on what all these <command>dh_*</command> scripts do exactly, and what their other options are, please read their respective manual pages and the <systemitem role="package">debhelper</systemitem> documentation.
zh_CN: 关于所有 <command>dh_*</command> 脚本具体行为， 以及 它们有什么选项 的完整信息，请阅读它们各自的 man 手册页 以及 <systemitem role="package">debhelper</systemitem> 的文档。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: These commands support other build environments, such as <filename>setup.py</filename>, which can be listed by executing <literal>dh_auto_build --list</literal> in a package source directory.
zh_CN: 这些构建系统同样支持其他的构建环境，比如 <filename>setup.py</filename> ，这可以通过在软件包源码目录中执行 <literal>dh_auto_build --list</literal> 来列出。

note: type: Content of: <book><chapter><section><section><para>
en: The functions of <command>dh_*</command> commands are largely self-evident from their names.  <placeholder type="footnote" id="0"/> There are a few notable ones that are worth giving (over)simplified explanations here assuming a typical build environment based on a <filename>Makefile</filename>: <placeholder type="footnote" id="1"/>
zh_CN: <command>dh_*</command> 命令的功能依其名称不言而喻。 <placeholder type="footnote" id="0"/> 不过其中有一些值得在这里进行简要解释， 假定有一个基于 <filename>Makefile</filename> 的典型构建环境： <placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: It actually looks for the first available target in the <filename>Makefile</filename> out of <literal>distclean</literal>, <literal>realclean</literal>, or <literal>clean</literal>, and executes that.
zh_CN: 它实际上在 <filename>Makefile</filename> 中搜寻第一个可用的 target ，除了 <literal>distclean</literal>, <literal>realclean</literal>, 或 <literal>clean</literal>， 接下来再执行它。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <command>dh_auto_clean</command> usually executes the following if a <filename>Makefile</filename> exists with the <literal>distclean</literal> target.  <placeholder type="footnote" id="0"/>
zh_CN: <command>dh_auto_clean</command> 通常在 <filename>Makefile</filename> 存在且有 <literal>distclean</literal> target 时执行以下命令<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <command>dh_auto_configure</command> usually executes the following if <filename>./configure</filename> exists (arguments abbreviated for readability).
zh_CN: <command>dh_auto_configure</command> 在 <filename>./configure</filename> 存在时通常执行以下命令(省略部分参数以方便此处阅读)。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <command>dh_auto_build</command> usually executes the following to execute the first target of <filename>Makefile</filename> if it exists.
zh_CN: <command>dh_auto_build</command> 通常使用以下命令执行 <filename>Makefile</filename> 中的第一个 target。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: It actually looks for the first available target in the <filename>Makefile</filename> out of <literal>test</literal> or <literal>check</literal>, and executes that.
zh_CN: 实际上它在 <filename>Makefile</filename> 中搜索第一个可用的 target，除了 <literal>test</literal> 或 <literal>check</literal>，然后执行它。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <command>dh_auto_test</command> usually executes the following if a <filename>Makefile</filename> exists with the <literal>test</literal> target.  <placeholder type="footnote" id="0"/>
zh_CN: <command>dh_auto_test</command> 通常在 <filename>Makefile</filename> 存在且有 <literal>test</literal> target 时执行以下命令。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: <command>dh_auto_install</command> usually executes the following if a <filename>Makefile</filename> exists with the <literal>install</literal> target (line folded for readability).
zh_CN: <command>dh_auto_install</command> 通常在 <filename>Makefile</filename> 存在且有 <literal>install</literal> target 时执行以下命令(进行了换行以便阅读)。

note: type: Content of: <book><chapter><section><section><para>
en: All targets which require the <command>fakeroot</command> command will contain <command>dh_testroot</command>, which exits with an error if you are not using this command to pretend to be root.
zh_CN: 所有需要 <command>fakeroot</command> 命令的都包含了 <command>dh_testroot</command>。如果你没有使用 fakeroot，那将会报错并退出。

note: type: Content of: <book><chapter><section><section><para>
en: The important part to know about the <filename>rules</filename> file created by <command>dh_make</command> is that it is just a suggestion.  It will work for most packages but for more complicated ones, don't be afraid to customize it to fit your needs.
zh_CN: 关于 <command>dh_make</command> 生成的 <filename>rules</filename> 文件，你应该知道的最重要的事是，它仅仅是一个建议。它对多数简单的软件包有效，但对于更复杂的则要大胆对其进行定制以满足需要。

note: type: Content of: <book><chapter><section><section><para>
en: Although <literal>install</literal> is not a required target, it is supported.  <literal>fakeroot dh install</literal> behaves like <literal>fakeroot dh binary</literal> but stops after <command>dh_fixperms</command>.
zh_CN: 尽管 <literal>install</literal> target 不是必须的，但也被支持。<literal>fakeroot dh install</literal> 的操作就像 <literal>fakeroot dh binary</literal>一样，但停止于 <command>dh_fixperms</command>。

note: type: Content of: <book><chapter><section><section><title>
en: Customization of <filename>rules</filename> file
zh_CN: 定制 <filename>rules</filename> 文件

note: type: Content of: <book><chapter><section><section><para>
en: There are many ways to customize the <filename>rules</filename> file created with the new <command>dh</command> command.
zh_CN: 有很多方法来定制使用新的 <command>dh</command> 命令创建的 <filename>rules</filename> 文件。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: If a package installs the <filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename> file, you should activate its customization function by <literal>dh $@ --with <replaceable>custom-name</replaceable></literal>.
zh_CN: 如果一个软件包安装了 <filename>/usr/share/perl5/Debian/Debhelper/Sequence/<replaceable>custom_name</replaceable>.pm</filename> 文件，你应当使用 <literal>dh $@ --with <replaceable>custom-name</replaceable></literal> 命令激活其功能。

note: type: Content of: <book><chapter><section><section><para>
en: The <literal>dh $@</literal> command can be customized as follows: <placeholder type="footnote" id="0"/>
zh_CN: <literal>dh $@</literal> 命令可以按以下方式定制：<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para><footnote><para>
en: Use of the <command>dh_python2</command> command is preferred over use of <command>dh_pysupport</command> or <command>dh_pycentral</command> commands.  Do not use the <command>dh_python</command> command.
zh_CN: 在 <command>dh_python2</command> 和 <command>dh_pysupport</command> 以及<command>dh_pycentral</command> 命令之间更推荐使用前者。不要使用 <command>dh_python</command> 命令。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_python2</command> command.  (The best choice for Python.) <placeholder type="footnote" id="0"/>
zh_CN: 为 <command>dh_python2</command> 命令添加支持。(对于 Python 的最佳选择。)<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">python</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">python</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with python2</literal>.
zh_CN: 使用 <literal>dh $@ --with python2</literal>.

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This handles Python modules using the <systemitem role="package">python</systemitem> framework.
zh_CN: 这会使用 <systemitem role="package">python</systemitem> 框架处理 Python 模块。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_pysupport</command> command. (deprecated)
zh_CN: 添加 <command>dh_pysupport</command> 命令的支持。(已废弃)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">python-support</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">python-support</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with pysupport</literal>.
zh_CN: 使用 <literal>dh $@ --with pysupport</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This handles Python modules using the <systemitem role="package">python-support</systemitem> framework.
zh_CN: 这会使用 <systemitem role="package">python-support</systemitem> 框架处理 Python 模块。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_pycentral</command> command. (deprecated)
zh_CN: 添加 <command>dh_pycentral</command> 命令支持。(已废弃)

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">python-central</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">python-central</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with python-central</literal> instead.
zh_CN: 使用 <literal>dh $@ --with python-central</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This also deactivates the <command>dh_pysupport</command> command.
zh_CN: 这样会同时停用 <command>dh_pysupport</command> 命令。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This handles Python modules using the <systemitem role="package">python-central</systemitem> framework.
zh_CN: 这会使用 <systemitem role="package">python-central</systemitem> 框架处理 Python 模块。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_installtex</command> command.
zh_CN: 添加 <command>dh_installtex</command> 命令支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">tex-common</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">tex-common</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with tex</literal> instead.
zh_CN: 使用 <literal>dh $@ --with tex</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This registers Type 1 fonts, hyphenation patterns, and formats with TeX.
zh_CN: 这样会注册 Type 1 字体、断句样式及其他 TeX 格式。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command> commands.
zh_CN: 添加 <command>dh_quilt_patch</command> 和 <command>dh_quilt_unpatch</command> 命令支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">quilt</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">quilt</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with quilt</literal> instead.
zh_CN: 使用 <literal>dh $@ --with quilt </literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This applies and un-applies patches to the upstream source from files in the <filename>debian/patches</filename> directory for a source package in the <literal>1.0</literal> format.
zh_CN: 这会在你使用 <literal>1.0</literal> 格式的源代码包时自动应用或解除 <filename>debian/patches</filename> 目录中的补丁。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This is not needed if you use the new <literal>3.0 (quilt)</literal> source package format.
zh_CN: 如果你使用新的 <literal>3.0 (quilt)</literal> 源代码包格式则不需要这些。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_dkms</command> command.
zh_CN: 为 <command>dh_dkms</command> 命令添加支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">dkms</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">dkms</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with dkms</literal> instead.
zh_CN: 使用 <literal>dh $@ --with dkms </literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This correctly handles DKMS usage by kernel module packages.
zh_CN: 这能使内核模块软件包正确使用 DKMS。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_autotools-dev_updateconfig</command> and <command>dh_autotools-dev_restoreconfig</command> commands.
zh_CN: 添加 <command>dh_autotools-dev_updateconfig</command> 和 <command>dh_autotools-dev_restoreconfig</command> 命令支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">autotools-dev</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">autotools-dev</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with autotools-dev</literal> instead.
zh_CN: 使用 <literal>dh $@ --with autotools-dev</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This updates and restores <filename>config.sub</filename> and <filename>config.guess</filename>.
zh_CN: 这会自动更新或还原 <filename>config.sub</filename> 和 <filename>config.guess</filename> 文件。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_autoreconf</command> and <command>dh_autoreconf_clean</command> commands.
zh_CN: 添加 <command>dh_autoreconf</command> 和 <command>dh_autoreconf_clean</command> 命令支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Include the <systemitem role="package">dh-autoreconf</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">dh-autoreconf</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with autoreconf</literal> instead.
zh_CN: 使用 <literal>dh $@ --with autoreconf</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This updates the GNU Build System files and restores them after the build.
zh_CN: 这样会在编译时更新 GNU 编译系统文件并在编译后对其进行恢复。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>dh_girepository</command> command.
zh_CN: 添加 <command>dh_girepository</command> 命令支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Includes the <systemitem role="package">gobject-introspection</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">gobject-introspection</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with gir</literal> instead.
zh_CN: 使用 <literal>dh $@ --with quilt</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This computes dependencies for packages shipping GObject introspection data and generates the <literal>${gir:Depends}</literal> substitution variable for the package dependency.
zh_CN: 这会为带有 GObject 内省数据的软件包计算依赖，并生成 <literal>${gir:Depends}</literal> 这一替换变量。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: Add support for the <command>bash</command> completion feature.
zh_CN: 添加 <command>bash</command> 补全特性支持。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Includes the <systemitem role="package">bash-completion</systemitem> package in <literal>Build-Depends</literal>.
zh_CN: 在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">bash-completion</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Use <literal>dh $@ --with bash-completion</literal> instead.
zh_CN: 使用 <literal>dh $@ --with bash-completion</literal>

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: This installs <command>bash</command> completions using a configuration file at <filename>debian/<replaceable>package</replaceable>.bash-completion</filename>.
zh_CN: 这会使用 <filename>debian/<replaceable>package</replaceable>.bash-completion</filename> 中的配置文件来安装 <command>bash</command> 补全。

note: type: Content of: <book><chapter><section><section><para>
en: Many <command>dh_*</command> commands invoked by the new <command>dh</command> command can be customized by the corresponding configuration files in the <filename>debian</filename> directory.  See <xref linkend="dother"/> and the manpage of each command for the customization of such features.
zh_CN: 很多由新的 <command>dh</command> 命令触发的 <command>dh_*</command> 都可以通过修改 <filename>debian</filename> 目录中的配置文件来对其行为进行定制。参看 <xref linkend="dother"/> 和每个命令的 man 手册页。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: Under <literal>lenny</literal>, if you wanted to change the behavior of a <command>dh_*</command> script you found the relevant line in the <filename>rules</filename> file and adjusted it.
zh_CN: 在 <literal>lenny</literal> 下，如果你希望更改某个 <command>dh_*</command> 脚本的行为，你需要在 <filename>rules</filename> 中找到相应的行然后进行调整。

note: type: Content of: <book><chapter><section><section><para>
en: You may need to run <command>dh_*</command> commands invoked via the new <command>dh</command> with added arguments, or to run additional commands with them, or to skip them.  For such cases, you create an <literal>override_dh_<replaceable>foo</replaceable></literal> target with its rule in the <filename>rules</filename> file defining an <literal>override_dh_<replaceable>foo</replaceable></literal> target for the <command>dh_<replaceable>foo</replaceable></command> command you want to change.  It basically says <emphasis>run me instead</emphasis>.  <placeholder type="footnote" id="0"/>
zh_CN: 某些由新的 <command>dh</command> 命令所触发的 <command>dh_*</command> 命令可能需要额外的参数，或需要附加执行或者跳过执行。对于这类情况，你可以在 <filename>rules</filename> 文件中创建一个 <literal>override_dh_<replaceable>foo</replaceable></literal> target，并在其中定义一个 <literal>override_dh_<replaceable>foo</replaceable></literal>来使其完成你想要 <command>dh_<replaceable>foo</replaceable></command> 命令作出的改变。它的作用简单说就是 <emphasis>run me instead (把运行的命令换成我)</emphasis>。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><para>
en: Please note that the <command>dh_auto_*</command> commands tend to do more than what has been discussed in this (over)simplified explanation to take care of all the corner cases.  It is a bad idea to use <literal>override_dh_*</literal> targets to substitute simplified equivalent commands (except for the <literal>override_dh_auto_clean</literal> target) since it may bypass such smart <systemitem role="package">debhelper</systemitem> features.
zh_CN: 请注意 <command>dh_auto_*</command> 命令为了照顾所有的边缘情况，它实际所做的比上述(过度)简化的步骤中介绍的内容更多。除了 <literal>override_dh_auto_clean</literal> 外把上面的简化命令写成 <literal>override_dh_*</literal> 中是不明智的，这样会使得 <systemitem role="package">debhelper</systemitem> 的许多智能特性无法体现。

note: type: Content of: <book><chapter><section><section><para>
en: So, for instance, if you want to store system configuration data in the <filename>/etc/gentoo</filename> directory instead of the usual <filename>/etc</filename> directory for the recent <systemitem role="package">gentoo</systemitem> package using Autotools, you can override the default <literal>--sysconfig=/etc</literal> argument given by the <command>dh_auto_configure</command> command to the <command>./configure</command> command by the following:
zh_CN: 所以，比如，最近的<systemitem role="package">gentoo</systemitem> 软件包使用了 Autotools，如果你希望把系统配置配置文件安装到 <filename>/etc/gentoo</filename> 而非通常的 <filename>/etc</filename> 目录，你可以凌驾 <command>dh_auto_configure</command> 默认的使用的 <literal>--sysconfig=/etc</literal> 参数，改为向 <command>./configure</command> 命令传递以下参数：

note: type: Content of: <book><chapter><section><section><para>
en: The arguments given after <literal>--</literal> are appended to the default arguments of the auto-executed program to override them.  Using the <command>dh_auto_configure</command> command is better than directly invoking the <command>./configure</command> command here since it will only override the <literal>--sysconfig</literal> argument and retain any other, benign arguments to the <command>./configure</command> command.
zh_CN: 在 <literal>--</literal> 其后给出的参数会被追加到被自动执行的程序默认参数后，以此凌驾它们并修改其默认行为。 使用 <command>dh_auto_configure</command> 命令要比直接调用 <command>./configure</command> 命令好很多，因为 它只修改 <literal>--sysconfig</literal> 参数内容，同时保留其他任何对 <command>./configure</command> 命令良性的参数。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: <command>dh_auto_build</command> without any arguments will execute the first target in the <filename>Makefile</filename>.
zh_CN: 没有参数的 <command>dh_auto_build</command>命令将执行 <filename>Makefile</filename> 中的第一个 target。

note: type: Content of: <book><chapter><section><section><para>
en: If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify <literal>build</literal> as its target to build it <placeholder type="footnote" id="0"/>, you create an <literal>override_dh_auto_build</literal> target to enable this.
zh_CN: 如果 <systemitem role="package">gentoo</systemitem> 的 <filename>Makefile</filename> 需要指定 <literal>build</literal> 作为其编译用的 target<placeholder type="footnote" id="0"/>，你可以创建一个 <literal>override_dh_auto_build</literal> target 来启用它。

note: type: Content of: <book><chapter><section><section><para>
en: This ensures <literal>$(MAKE)</literal> is run with all the default arguments given by the <command>dh_auto_build</command> command plus the <literal>build</literal> argument.
zh_CN: 这保证了 <literal>$(MAKE)</literal> 会使用 <command>dh_auto_build</command> 传递的所有默认参数并编译处理 <literal>build</literal> 这个 target。

note: type: Content of: <book><chapter><section><section><para>
en: If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> requires you to specify the <literal>packageclean</literal> target to clean it for the Debian package instead of using <literal>distclean</literal> or <literal>clean</literal> targets, you can create an <literal>override_dh_auto_clean</literal> target to enable it.
zh_CN: 如果 <systemitem role="package">gentoo</systemitem> 的 <filename>Makefile</filename> 需要指定 <literal>packageclean</literal> target 来为 Debian 软件包作清理，而非 <literal>distclean</literal> 或 <literal>clean</literal> target，那你就可以创建一个 <literal>override_dh_auto_clean</literal> target 来启用它。

note: type: Content of: <book><chapter><section><section><para>
en: If the <filename>Makefile</filename> in the source for <systemitem role="package">gentoo</systemitem> contains a <literal>test</literal> target which you do not want to run for the Debian package building process, you can use an empty <literal>override_dh_auto_test</literal> target to skip it.
zh_CN: 如果 <systemitem role="package">gentoo</systemitem> 的 <filename>Makefile</filename> 包含了一个 <literal>test</literal> target 但你不想在 Debian 软件包构建过程中运行它，可以使用空的 <literal>override_dh_auto_test</literal> target 来跳过它。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: The <filename>debian/changelog</filename> and <filename>debian/NEWS</filename> files are always automatically installed.  The upstream changelog is found by converting filenames to lower case and matching them against <filename>changelog</filename>, <filename>changes</filename>, <filename>changelog.txt</filename>, and <filename>changes.txt</filename>.
zh_CN: <filename>debian/changelog</filename> 和 <filename>debian/NEWS</filename> 总是会被自动安装。程序会将文件名转为小写并搜索以下文件名来检测上游 changelog：<filename>changelog</filename>、<filename>changes</filename>、<filename>changelog.txt</filename>和<filename>changes.txt</filename>。

note: type: Content of: <book><chapter><section><section><para>
en: If <systemitem role="package">gentoo</systemitem> has an unusual upstream changelog file called <filename>FIXES</filename>, <command>dh_installchangelogs</command> will not install that file by default.  The <command>dh_installchangelogs</command> command requires <filename>FIXES</filename> as its argument to install it.  <placeholder type="footnote" id="0"/>
zh_CN: 如果 <systemitem role="package">gentoo</systemitem> 有某个不常见的上游 changelog 文件名为 <filename>FIXES</filename>，默认情况下 <command>dh_installchangelogs</command> 不会安装它。<command>dh_installchangelogs</command> 命令需要将 <filename>FIXES</filename> 作为它的参数才会安装它。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><para>
en: When you use the new <command>dh</command> command, use of explicit targets such as the ones listed in <xref linkend="targets"/>, other than the <literal>get-orig-source</literal> target, may make it difficult to understand their exact effects.  Please limit explicit targets to <literal>override_dh_*</literal> targets and completely independent ones, if possible.
zh_CN: 如果你使用新的 <command>dh</command> 命令时，还使用 <xref linkend="targets"/> 中除 <literal>get-orig-source</literal> 的显式 target ，会使得其效果难以预料。如果可能的话请尽量避免使用独立的或预设的 target，如果必须修改默认设置则酌情使用 <literal>override_dh_*</literal>。

note: type: Content of: <book><chapter><title>
en: Other files under the <filename>debian</filename> directory
zh_CN: <filename>debian</filename> 目录下的其他文件

note: type: Content of: <book><chapter><para>
en: To control most of what <systemitem role="package">debhelper</systemitem> does while building the package, you put optional configuration files under the <filename>debian</filename> directory.  This chapter will provide an overview of what each of these does and its format.  Please read the <ulink url="&debian-policy;">Debian Policy Manual</ulink> and <ulink url="&developers-reference;">Debian Developer's Reference</ulink> for guidelines for packaging.
zh_CN: 要控制 <systemitem role="package">debhelper</systemitem> 在构建软件包过程中的大部分行为，可以在 <filename>debian</filename> 目录中放置可选的配置文件。本章将会对这些文件和它们的格式进行概述。请阅读 <ulink url="&debian-policy;">Debian Policy Manual</ulink> 和 <ulink url="&developers-reference;">Debian Developer's Reference</ulink> 来了解更多关于打包方针的内容。

note: type: Content of: <book><chapter><para>
en: Some template configuration files for <systemitem role="package">debhelper</systemitem> may not be created by the <command>dh_make</command> command.  In such cases, you need to create them with an editor.
zh_CN: 还有一些 <systemitem role="package">debhelper</systemitem> 的配置文件模板可能未被 <command>dh_make</command> 命令创建。在这种情况下如果你需要它们，则要使用文本编辑器手工创建。

note: type: Content of: <book><chapter><para>
en: If you wish or need to activate any of these, please do the following:
zh_CN: 如果你希望或需要激活它们中的任意一个或多个，请按照下面的方法做：

note: type: Content of: <book><chapter><itemizedlist><listitem><para>
en: rename the configuration files to use the actual binary package name in place of <literal><replaceable>package</replaceable></literal>;
zh_CN: 把配置文件的名称改为实际的二进制软件包名，例如 <literal><replaceable>package</replaceable></literal>;

note: type: Content of: <book><chapter><itemizedlist><listitem><para>
en: modify template file contents to suit your needs;
zh_CN: 修改模板文件来满足你的需要;

note: type: Content of: <book><chapter><itemizedlist><listitem><para>
en: remove template files which you do not need;
zh_CN: 删除不需要的模板文件;

note: type: Content of: <book><chapter><itemizedlist><listitem><para>
en: modify the <filename>control</filename> file (see <xref linkend="control"/>), if necessary;
zh_CN: 如果需要，修改 <filename>control</filename> 文件(参看 <xref linkend="control"/>)。

note: type: Content of: <book><chapter><itemizedlist><listitem><para>
en: modify the <filename>rules</filename> file (see <xref linkend="rules"/>), if necessary.
zh_CN: 如果需要，修改 <filename>rules</filename> 文件(参看 <xref linkend="rules"/>)。

note: type: Content of: <book><chapter><para>
en: Any <systemitem role="package">debhelper</systemitem> configuration files without a <filename><replaceable>package</replaceable></filename> prefix, such as <filename>install</filename>, apply to the first binary package.  When there are many binary packages, their configurations can be specified by prefixing their name to their configuration filenames such as <filename><replaceable>package-1</replaceable>.install</filename>, <filename><replaceable>package-2</replaceable>.install</filename>, etc.
zh_CN: 任何不带有 <filename><replaceable>package</replaceable></filename> 前缀的<systemitem role="package">debhelper</systemitem> 配置文件， 比如应用到第一个二进制包的 <filename>install</filename>。 当此处有多个二进制包时，可以通过在文件名中前置 它们各自的名称来指定它们各自的配置文件，比如<filename><replaceable>package-1</replaceable>.install</filename>, <filename><replaceable>package-2</replaceable>.install</filename>, 之类。

note: type: Content of: <book><chapter><section><para>
en: Any extra details or discrepancies between the original package and your Debian version should be documented here.
zh_CN: 所有关于你的 Debian 版本与原始版本间的额外信息或差别都应在这里记录。

note: type: Content of: <book><chapter><section><para>
en: <command>dh_make</command> created a default one; this is what it looks like:
zh_CN: <command>dh_make</command> 创建了一个默认的文件，以下是它的样子：

note: type: Content of: <book><chapter><section><para>
en: If you have nothing to be documented, remove this file.  See <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 如果你没有需要写在这里的东西，则删除这个文件。参看 <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>

note: type: Content of: <book><chapter><section><para>
en: The <filename>compat</filename> file defines the <systemitem role="package">debhelper</systemitem> compatibility level.  Currently, you should set it to the <systemitem role="package">debhelper</systemitem> v10 as follows:
zh_CN: <filename>compat</filename> 文件定义了 <systemitem role="package">debhelper</systemitem> 的兼容级别。目前你应当使用如下方法将其设置为 <systemitem role="package">debhelper</systemitem> V10：

note: type: Content of: <book><chapter><section><para>
en: You may use compat level v9 in certain circumstances for compatibility with older systems. However, using any level below v9 is not recommended and should be avoided for new packages.
zh_CN: 在特定场景下，你可以在需要兼容旧版本系统时使用兼容等级9。然而，我们不建议你使用任何低于 9 的兼容等级，在新建软件包时也应避免使用这些低的等级。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> and <ulink url="&policy-conffiles;">Debian Policy Manual, "D.2.5 Conffiles"</ulink>.
zh_CN: 参见 <citerefentry> <refentrytitle>dpkg</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 以及 <ulink url="&policy-conffiles;">Debian Policy Manual, "D.2.5 Conffiles"</ulink>.

note: type: Content of: <book><chapter><section><para>
en: One of the most annoying things about software is when you spend a great deal of time and effort customizing a program, only to have an upgrade stomp all over your changes.  Debian solves this problem by marking such configuration files as conffiles.  <placeholder type="footnote" id="0"/> When you upgrade a package, you'll be asked whether you want to keep your old configuration files or not.
zh_CN: 关于软件有件很恼人的事，就是当你付出了很多时间和精力来自定义一个程序，但是升级后所有的修改都被覆盖掉了。Debian 通过将配置文件单独标记来解决这个问题， <placeholder type="footnote" id="0"/> 当软件包升级的时候，你将会被询问是否要保留你的旧配置文件。

note: type: Content of: <book><chapter><section><para>
en: <citerefentry><refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> <emphasis>automatically</emphasis> flags any files under the <filename>/etc</filename> directory as conffiles, so if your program only has conffiles there you do not need to specify them in this file.  For most package types, the only place conffiles should ever be is under <filename>/etc</filename>, and so this file doesn't need to exist.
zh_CN: <citerefentry><refentrytitle>dh_installdeb</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> <emphasis>automatically</emphasis> 会把 <filename>/etc</filename> 目录下的任何文件都标记为 conffiles，所以如果你的程序在那只有 conffiles 的话就不需要再在这个文件中指定它们。 对于大多数软件包类型，唯一合理的 conffiles 文件存放位置自始至终应当在 <filename>/etc</filename> 目录下， 正因如此，该文件也没有存在的必要。

note: type: Content of: <book><chapter><section><para>
en: If your program uses configuration files but also rewrites them on its own, it's best not to make them conffiles because <command>dpkg</command> will then prompt users to verify the changes all the time.
zh_CN: 如果你的程序使用配置文件，但程序会自动对配置文件进行改写，则最好别将其标记为 conffiles ，因为 <command>dpkg</command> 总是会要求用户校验变更。

note: type: Content of: <book><chapter><section><para>
en: If the program you're packaging requires every user to modify the configuration files in the <filename>/etc</filename> directory, there are two popular ways to arrange for them to not be conffiles, keeping <command>dpkg</command> quiet:
zh_CN: 如果你正在打包的程序需要所有用户都为自己修改 <filename>/etc</filename> 目录中的配置文件，那么有两种常见的方法让 <command>dpkg</command> 不将其记录为 conffiles，以使其沉默。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Create a symlink under the <filename>/etc</filename> directory pointing to a file under the <filename>/var</filename> directory generated by the maintainer scripts.
zh_CN: 在 <filename>/etc</filename> 目录中创建指向 <filename>/var</filename> 中维护者脚本(maintainer scripts)生成的文件的符号链接。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Create a file generated by the maintainer scripts under the <filename>/etc</filename> directory.
zh_CN: 用维护者脚本(maintainer scripts)在 <filename>/etc</filename> 目录中生成一个文件。

note: type: Content of: <book><chapter><section><para>
en: For information on maintainer scripts, see <xref linkend="maintscripts"/>.
zh_CN: 更多关于维护者脚本(maintainer scripts)的信息，参看 <xref linkend="maintscripts"/>

note: type: Content of: <book><chapter><section><para>
en: If your package requires regularly scheduled tasks to operate properly, you can use these files to set that up.  You can set up regular tasks that either happen hourly, daily, weekly, or monthly, or alternatively happen at any other time that you wish.  The filenames are:
zh_CN: 如果你的软件包需要有计划运行的操作以保证正常工作，可以使用这个文件达成。你既可以设置常规的任务使其在每小时、每天、每星期、每月或其他情况或你希望的时间下运行。相应的文件名是：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename><replaceable>package</replaceable>.cron.hourly</filename> - Installed as <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename>; run once an hour.
zh_CN: <filename><replaceable>package</replaceable>.cron.hourly</filename> - 安装至 <filename>/etc/cron.hourly/<replaceable>package</replaceable></filename> ；每小时运行一次。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename><replaceable>package</replaceable>.cron.daily</filename> - Installed as <filename>/etc/cron.daily/<replaceable>package</replaceable></filename>; run once a day.
zh_CN: <filename><replaceable>package</replaceable>.cron.daily</filename> - 安装至 <filename>/etc/cron.daily/<replaceable>package</replaceable></filename> ；每天运行一次。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename><replaceable>package</replaceable>.cron.weekly</filename> - Installed as <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename>; run once a week.
zh_CN: <filename><replaceable>package</replaceable>.cron.weekly</filename> - 安装至 <filename>/etc/cron.weekly/<replaceable>package</replaceable></filename> ；每周运行一次。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename><replaceable>package</replaceable>.cron.monthly</filename> - Installed as <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename>: run once a month.
zh_CN: <filename><replaceable>package</replaceable>.cron.monthly</filename> - 安装至 <filename>/etc/cron.monthly/<replaceable>package</replaceable></filename> ：每月运行一次。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename><replaceable>package</replaceable>.cron.d</filename> - Installed as <filename>/etc/cron.d/<replaceable>package</replaceable></filename>: for any other time.
zh_CN: <filename><replaceable>package</replaceable>.cron.d</filename> - 安装至 <filename>/etc/cron.d/<replaceable>package</replaceable></filename>： 对于其他的任何时间。

note: type: Content of: <book><chapter><section><para>
en: Most of these files are shell scripts, with the exception of <filename><replaceable>package</replaceable>.cron.d</filename> which follows the format of <citerefentry> <refentrytitle>crontab</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>.
zh_CN: 这些文件均为 shell 脚本。唯一不同的是 <filename><replaceable>package</replaceable>.cron.d</filename>，它的格式需要参照 <citerefentry> <refentrytitle>crontab</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>

note: type: Content of: <book><chapter><section><para>
en: No explicit <filename>cron.*</filename> file is needed to set up log rotation; for that, see <citerefentry><refentrytitle>dh_installlogrotate</refentrytitle> <manvolnum>1</manvolnum></citerefentry> and <citerefentry><refentrytitle>logrotate</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
zh_CN: 有必要显式地用 <filename>cron.*</filename> 文件来设置日志轮转； 关于这个问题，请参见 <citerefentry><refentrytitle>dh_installlogrotate</refentrytitle> <manvolnum>1</manvolnum></citerefentry> 和 <citerefentry><refentrytitle>logrotate</refentrytitle><manvolnum>8</manvolnum></citerefentry>.

note: type: Content of: <book><chapter><section><para>
en: This file specifies any directories which we need but which are not created by the normal installation procedure (<literal>make install DESTDIR=...</literal> invoked by <literal>dh_auto_install</literal>).  This generally means there is a problem with the <filename>Makefile</filename>.
zh_CN: 这个文件指定了我们需要，但在正常安装过程(<literal>dh_auto_install</literal> 触发的 <literal>make install DESTDIR=...</literal>)里没有被安装的目录。通常这是由于 <filename>Makefile</filename> 中存在问题。

note: type: Content of: <book><chapter><section><para>
en: Files listed in an <filename>install</filename> file don't need their directories created first.  See <xref linkend="install"/>.
zh_CN: <filename>install</filename> 文件中列出的文件不需要为其提前创建目录，参看 <xref linkend="install"/>。

note: type: Content of: <book><chapter><section><para>
en: It is best to try to run the installation first and only use this if you run into trouble.  There is no preceding slash on the directory names listed in the <filename>dirs</filename> file.
zh_CN: 最好是先尝试安装，如果遇到了问题再使用这个文件。在 <filename>dirs</filename>中列出的目录名中不应有前导的 / (斜杠)符号。

note: type: Content of: <book><chapter><section><para>
en: If your package has documentation other than manual and info pages, you should use the <systemitem role="package">doc-base</systemitem> file to register it, so the user can find it with e.g.  <citerefentry> <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, or <citerefentry> <refentrytitle>doccentral</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 如果你的软件包在 man 手册页和 info 信息文档外还有其他文档，你应该使用 <systemitem role="package">doc-base</systemitem> 文件注册它们，这样用户可以使用例如 <citerefentry> <refentrytitle>dhelp</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>、<citerefentry> <refentrytitle>dwww</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 或 <citerefentry> <refentrytitle>doccentral</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 的工具找到它们。

note: type: Content of: <book><chapter><section><para>
en: This usually includes HTML, PS and PDF files, shipped in <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>.
zh_CN: 这通常包括 HTML、PS 和 PDF 文件，放置在 <filename>/usr/share/doc/<replaceable>packagename</replaceable>/</filename>。

note: type: Content of: <book><chapter><section><para>
en: This is what <systemitem role="package">gentoo</systemitem>'s doc-base file <filename>gentoo.doc-base</filename> looks like:
zh_CN: 以下是 <systemitem role="package">gentoo</systemitem> 的 doc-base 文件 <filename>gentoo.doc-base</filename> 的样子：

note: type: Content of: <book><chapter><section><para>
en: For information on the file format, see <citerefentry> <refentrytitle>install-docs</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> and the Debian <systemitem role="package">doc-base</systemitem> manual at the local copy <filename>&doc-base;</filename> provided by the <systemitem role="package">doc-base</systemitem> package.
zh_CN: 关于文件格式的更多信息，参看 <citerefentry> <refentrytitle>install-docs</refentrytitle> <manvolnum>8</manvolnum> </citerefentry> 以及 Debian <systemitem role="package">doc-base</systemitem> 手册页，在 <filename>&doc-base;</filename> 有一份本地拷贝，这是由 <systemitem role="package">doc-base</systemitem> 软件包提供的。

note: type: Content of: <book><chapter><section><para>
en: For more details on installing additional documentation, look in <xref linkend="destdir"/>.
zh_CN: 关于安装附加文档的更多信息，查看 <xref linkend="destdir"/>。

note: type: Content of: <book><chapter><section><para>
en: This file specifies the file names of documentation files we can have <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> install into the temporary directory for us.
zh_CN: 这个文件指定了我们使用 <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 安装到临时目录的文档文件名。

note: type: Content of: <book><chapter><section><para>
en: By default, it will include all existing files in the top-level source directory that are called <filename>BUGS</filename>, <filename>README*</filename>, <filename>TODO</filename> etc.
zh_CN: 默认情况下它会加入代码目录顶层的所有名为 <filename>BUGS</filename>、<filename>README*</filename>、<filename>TODO</filename> 等的文件。

note: type: Content of: <book><chapter><section><para>
en: For <systemitem role="package">gentoo</systemitem>, some other files are also included:
zh_CN: 对于 <systemitem role="package">gentoo</systemitem>，这里还加入了一些其他文件：

note: type: Content of: <book><chapter><section><para>
en: If your package supplies Emacs files that can be bytecompiled at package installation time, you can use these files to set it up.
zh_CN: 如果你的软件包提供可以在安装时编译为字节码的 Emacs 文件，你可以使用这些文件设置。

note: type: Content of: <book><chapter><section><para>
en: They are installed into the temporary directory by <citerefentry> <refentrytitle>dh_installemacsen</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 它们会被 <citerefentry> <refentrytitle>dh_installemacsen</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 安装到临时目录。

note: type: Content of: <book><chapter><section><para>
en: If you don't need these, remove them.
zh_CN: 如果你不需要这些，就删除它们。

note: type: Content of: <book><chapter><section><para>
en: The <citerefentry> <refentrytitle>dh_installexamples</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command installs files and directories listed in this file as example files.
zh_CN: <citerefentry> <refentrytitle>dh_installexamples</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 会将列出的文件和目录作为示例文件安装。

note: type: Content of: <book><chapter><section><title>
en: <filename><replaceable>package</replaceable>.init</filename> and <filename><replaceable>package</replaceable>.default</filename>
zh_CN: <filename><replaceable>package</replaceable>.init</filename> 和 <filename><replaceable>package</replaceable>.default</filename>

note: type: Content of: <book><chapter><section><para>
en: If your package is a daemon that needs to be run at system start-up, you've obviously disregarded my initial recommendation, haven't you? :-)
zh_CN: 如果你的软件包需要在系统启动时运行一个守护进程，那么你显然没有按照我最初的建议做事，不是吗？ :-)

note: type: Content of: <book><chapter><section><para>
en: The <filename><replaceable>package</replaceable>.default</filename> file will be installed as <filename>/etc/default/<replaceable>package</replaceable></filename>.  This file sets defaults that are sourced by the init script.  This <filename><replaceable>package</replaceable>.default</filename> file is most often used to set some default flags or timeouts.  If your init script has certain configurable features, you can set them in the <filename><replaceable>package</replaceable>.default</filename> file, instead of in the init script itself.
zh_CN: <filename><replaceable>package</replaceable>.default</filename> 文件 会被安装至 <filename>/etc/default/<replaceable>package</replaceable></filename>。 这个文件设置被 init 脚本使用的默认设置。   <filename><replaceable>package</replaceable>.default</filename> 文件最经常用于设置 一些默认标记或者超时。 如果你的 init 脚本中有某种 可配置的特性，你可以在 <filename><replaceable>package</replaceable>.default</filename> 文件中设置它们， 而不是 init 脚本本身。

note: type: Content of: <book><chapter><section><para>
en: If your upstream program provides a file for the init script, you can either use it or not.  If you don't use their init script then create a new one in <filename><replaceable>package</replaceable>.init</filename>.  However if the upstream init script looks fine and installs in the right place you still need to set up the <filename>rc*</filename> symlinks.  To do this you will need to override <command>dh_installinit</command> in the <filename>rules</filename> file with the following lines:
zh_CN: 如果你的上游程序中包含了给 init 用的脚本文件，那用不用它都可以。如果不使用，则创建相应的 <filename><replaceable>package</replaceable>.init</filename> 文件；然而如果上游的 init 脚本很好且被安装到正确的位置，你仍然需要设置 <filename>rc*</filename> 符号链接。你需要按照以下的方法在 <filename>rules</filename> 文件中凌驾 <command>dh_installinit</command>：

note: type: Content of: <book><chapter><section><para>
en: If you don't need this, remove the files.
zh_CN: 如果你不需要这些，就删除它们。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This replaces the deprecated <citerefentry> <refentrytitle>dh_movefiles</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command which is configured by the <filename>files</filename> file.
zh_CN: 这取代了已经废弃的 <citerefentry> <refentrytitle>dh_movefiles</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令，它本是用 <filename>files</filename> 文件所配置的。

note: type: Content of: <book><chapter><section><para>
en: If there are files that need to be installed into your package but your standard <literal>make install</literal> won't do it, put the filenames and destinations into this <filename>install</filename> file.  They are installed by <citerefentry> <refentrytitle>dh_install</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.<placeholder type="footnote" id="0"/> You should first check that there is not a more specific tool to use.  For example, documents should be in the <filename>docs</filename> file and not in this one.
zh_CN: 如果你的软件包需要那些标准的 <literal>make install</literal> 没有安装的文件，你可以把文件名和目标路径写入 <filename>install</filename> 文件，它们将被 <citerefentry> <refentrytitle>dh_install</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 安装。<placeholder type="footnote" id="0"/> 你需要首先检查要安装的文件是否有更有针对性的特定工具会对其进行安装。例如，文档应写在 <filename>docs</filename> 文件中安装，而不是这一个。

note: type: Content of: <book><chapter><section><para>
en: This <filename>install</filename> file has one line per file installed, with the name of the file (relative to the top build directory) then a space then the installation directory (relative to the install directory).  One example of where this is used is if a binary <filename>src/<replaceable>bar</replaceable></filename> is left uninstalled; the <filename>install</filename> file might look like:
zh_CN: 这个 <filename>install</filename> 文件每行安装一份文件，格式上先是相对于编译目录的文件路径，然后是一个空格，接下来是相对于安装目录的目标目录。例如，假设某个二进制文件 <filename>src/<replaceable>bar</replaceable></filename>没有被默认安装，则应让 <filename>install</filename> 呈现成这样：

note: type: Content of: <book><chapter><section><para>
en: This means when this package is installed, there will be an executable command <filename>/usr/bin/<replaceable>bar</replaceable></filename>.
zh_CN: 这意味着安装这个软件包时，将有一个二进制文件 <filename>/usr/bin/<replaceable>bar</replaceable></filename>.

note: type: Content of: <book><chapter><section><para>
en: Alternatively, this <filename>install</filename> can have the name of the file only without the installation directory when the relative directory path does not change.  This format is usually used for a large package that splits the output of its build into multiple binary packages using <filename><replaceable>package-1</replaceable>.install</filename>, <filename><replaceable>package-2</replaceable>.install</filename>, etc.
zh_CN: 当然，在相对路径保持不变的情况下 <filename>install</filename> 文件也可以只包含相对的源路径而不带目标位置。这样的格式通常用于使用 <filename><replaceable>package-1</replaceable>.install</filename>、<filename><replaceable>package-2</replaceable>.install</filename> 等将大软件包分割为多个二进制包的情况。

note: type: Content of: <book><chapter><section><para>
en: The <command>dh_install</command> command will fall back to looking in <filename>debian/tmp</filename> for files, if it doesn't find them in the current directory (or wherever you've told it to look using <literal>--sourcedir</literal>).
zh_CN: 如果 <command>dh_install</command> 命令没有在当前目录(或者你可能使用 <literal>--sourcedir</literal> 参数指定的位置)找到文件，它会回滚至使用 <filename>debian/tmp</filename> 目录。

note: type: Content of: <book><chapter><section><para>
en: If your package has info pages, you should install them using <citerefentry> <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> by listing them in a <filename><replaceable>package</replaceable>.info</filename> file.
zh_CN: 如果你的软件包有 info 信息页，应该使用 <citerefentry> <refentrytitle>dh_installinfo</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 安装，要安装的文件列于 <filename><replaceable>package</replaceable>.info</filename> 文件中。

note: type: Content of: <book><chapter><section><para>
en: If you need to create additional symlinks in package build directories as package maintainer, you should install them using <citerefentry> <refentrytitle>dh_link</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> by listing their full paths of source and destination files in a <filename><replaceable>package</replaceable>.links</filename> file.
zh_CN: 如果你作为包维护者需要在包中创建附加的符号链接，你应该使用 <citerefentry> <refentrytitle>dh_link</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来安装，要安装的文件完整路径列于 <filename><replaceable>package</replaceable>.info</filename> 文件中。

note: type: Content of: <book><chapter><section><para>
en: If <systemitem role="package">lintian</systemitem> reports an erroneous diagnostic for a case where Debian policy allows exceptions to some rule, you can use <filename><replaceable>package</replaceable>.lintian-overrides</filename> or <filename>source/lintian-overrides</filename> to quieten it.  Please read the Lintian User's Manual (<filename>&lintian-doc;</filename>) and refrain from abusing this.
zh_CN: 如果 <systemitem role="package">lintian</systemitem> 根据 Debian Policy 的某些规则允许例外从而报告了错误诊断，你可以使用 <filename><replaceable>package</replaceable>.lintian-overrides</filename> 或 <filename>source/lintian-overrides</filename> 使其不再警告。请认真阅读 Lintian 用户手册(<filename>&lintian-doc;</filename>) 并避免滥用。

note: type: Content of: <book><chapter><section><para>
en: <filename><replaceable>package</replaceable>.lintian-overrides</filename> is for the binary package named <systemitem role="package"><replaceable>package</replaceable></systemitem> and is installed into <filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename> by the <command>dh_lintian</command> command.
zh_CN: <filename><replaceable>package</replaceable>.lintian-overrides</filename> 是对于名为 <systemitem role="package"><replaceable>package</replaceable></systemitem> 的二进制包的有效配置，会由 <command>dh_lintian</command> 命令安装到<filename>usr/share/lintian/overrides/<replaceable>package</replaceable></filename>。

note: type: Content of: <book><chapter><section><para>
en: <filename>source/lintian-overrides</filename> is for the source package.  This is not installed.
zh_CN: <filename>source/lintian-overrides</filename> 是针对源代码包的，不会安装。

note: type: Content of: <book><chapter><section><para>
en: Your program(s) should have a manual page.  If they don't, you should create them.  The <command>dh_make</command> command creates some template files for manual pages.  These need to be copied and edited for each command missing its manual page.  Please make sure to remove unused templates.
zh_CN: 你的程序应该有 man 手册页，如果它们没有自带则需要由你来创建。<command>dh_make</command> 命令创建了几个 man 手册页的模板。为每一个缺手册的命令拷贝一份模板，并妥善地编写，并且要删除未使用的模板。

note: type: Content of: <book><chapter><section><section><para>
en: Manual pages are normally written in <citerefentry> <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  The <filename>manpage.1.ex</filename> template is written in <command>nroff</command>, too.  See the <citerefentry> <refentrytitle>man</refentrytitle> <manvolnum>7</manvolnum> </citerefentry> manual page for a brief description of how to edit such a file.
zh_CN: man 手册页通常是使用 <citerefentry> <refentrytitle>nroff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 的格式编写的。<filename>manpage.1.ex</filename> 模板也是使用 <command>nroff</command> 格式的。参看 <citerefentry> <refentrytitle>man</refentrytitle> <manvolnum>7</manvolnum> </citerefentry> 手册页来简要了解如何编辑这个文件。

note: type: Content of: <book><chapter><section><section><para>
en: The final manual page file name should give the name of the program it is documenting, so we will rename it from <literal>manpage</literal> to <literal>gentoo</literal>.  The file name also includes <literal>.1</literal> as the first suffix, which means it's a manual page for a user command.  Be sure to verify that this section is indeed the correct one.  Here's a short list of manual page sections:
zh_CN: 最终的 man 手册页文件的名称，应当为其对应的程序名称。 所以我们将 <literal>manpage</literal> 重命名为 <literal>gentoo</literal>。 同时，它的文件名当然要以 <literal>.1</literal> 作为第一个后缀，这表示本手册页是为一个用户命令而攒写的。 再者，请校验本 man 手册处在正确的节(section)。这个简短的列表列举了 man 手册页的章节：

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><thead><row><entry>
en: Section
zh_CN: Section(部分)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><thead><row><entry>
en: Description
zh_CN: Description(描述)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><thead><row><entry>
en: Notes
zh_CN: Notes(提示)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: User commands
zh_CN: User commands(用户命令)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Executable commands or scripts
zh_CN: Executable commands or scripts(可执行命令或脚本)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: System calls
zh_CN: System calls(系统调用)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Functions provided by the kernel
zh_CN: Functions provided by the kernel(由内核提供的功能)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Library calls
zh_CN: Library calls(库调用)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Functions within system libraries
zh_CN: Functions within system libraries(系统库中的功能)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Special files
zh_CN: Special files(特殊文件)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Usually found in <filename>/dev</filename>
zh_CN: 经常在 <filename>/dev</filename> 目录中出没

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: File formats
zh_CN: File formats(文件格式)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: E.g. <filename>/etc/passwd</filename>'s format
zh_CN: 例如， <filename>/etc/passwd</filename> 的格式

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Games
zh_CN: Games(游戏)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Games or other frivolous programs
zh_CN: Games or other frivolous programs(游戏或无聊的程序)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Macro packages
zh_CN: Macro packages(宏包)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Such as <command>man</command> macros
zh_CN: 比如 <command>man</command> 宏

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: System administration
zh_CN: System administrarion(系统管理)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Programs typically only run by root
zh_CN: Programs typically only run by root(典型的root专用程序)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Kernel routines
zh_CN: Kernel routines(内核惯例)

note: type: Content of: <book><chapter><section><section><informaltable><tgroup><tbody><row><entry>
en: Non-standard calls and internals
zh_CN: Non-standard calls and internals(非标准调用及内部构建)

note: type: Content of: <book><chapter><section><section><para>
en: So <systemitem role="package">gentoo</systemitem>'s man page should be called <filename>gentoo.1</filename>.  If there was no <filename>gentoo.1</filename> man page in the original source, you should create it by renaming the <filename>manpage.1.ex</filename> template to <filename>gentoo.1</filename> and editing it using information from the example and from the upstream docs.
zh_CN: 所以 <systemitem role="package">gentoo</systemitem> 的 man 手册页应叫 <filename>gentoo.1</filename>。如果原始代码中没有 <filename>gentoo.1</filename> man 手册页，你需要重命名 <filename>manpage.1.ex</filename> 模板为 <filename>gentoo.1</filename> 并按照示例和上游文档编辑它。

note: type: Content of: <book><chapter><section><section><para><footnote><para>
en: Note that <command>help2man</command>'s placeholder man page will claim that more detailed documentation is available in the info system. If the command is missing an <command>info</command> page, you should manually edit the man page created by the <command>help2man</command> command.
zh_CN: 注意， <command>help2man</command> 的占位符性质 man 手册页会声称 在 info 系统中有着更为详尽的细节。如果命令 缺少 <command>info</command> 页，那你应该手工编辑由 <command>help2man</command> 命令创建的 man 手册页。

note: type: Content of: <book><chapter><section><section><para>
en: You can use the <command>help2man</command> command to generate a man page out of the <literal>--help</literal> and <literal>--version</literal> output of each program, too.  <placeholder type="footnote" id="0"/>
zh_CN: 你也可以使用 <command>help2man</command> 命令来借助每个程序的 <literal>--help</literal> 和 <literal>--version</literal> 参数的输出来生成 man 手册页。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><section><para>
en: If on the other hand you prefer writing SGML instead of <command>nroff</command>, you can use the <filename>manpage.sgml.ex</filename> template.  If you do this, you have to:
zh_CN: 如果你希望使用 SGML 而非 <command>nroff</command> 格式编写 man 手册页，可以使用 <filename>manpage.sgml.ex</filename> 模板。如果你要这样，需要进行以下步骤：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: rename the file to something like <filename>gentoo.sgml</filename>.
zh_CN: 重命名文件为类似 <filename>gentoo.sgml</filename> 的名称。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: install the <systemitem role="package">docbook-to-man</systemitem> package
zh_CN: 安装 <systemitem role="package">docbook-to-man</systemitem> 软件包。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: add <literal>docbook-to-man</literal> to the <literal>Build-Depends</literal> line in the <filename>control</filename> file
zh_CN: 在 <filename>control</filename> 文件中将 <literal>docbook-to-man</literal> 添加到 <literal>Build-Depends</literal> 行。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: add an <literal>override_dh_auto_build</literal> target to your <filename>rules</filename> file:
zh_CN: 在 <filename>rules</filename> 文件里添加 <literal>override_dh_auto_build</literal> target：

note: type: Content of: <book><chapter><section><section><para>
en: If you prefer XML over SGML, you can use the <literal>manpage.xml.ex</literal> template.  If you do this, you have to:
zh_CN: 如果你希望使用XML 而非 SGML，可以使用 <literal>manpage.xml.ex</literal> 模板。如果你要这样，需要进行以下步骤：

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: rename the source file to something like <literal>gentoo.1.xml</literal>
zh_CN: 重命名源文件为类似 <literal>gentoo.1.xml</literal> 的名称。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: install the <systemitem role="package">docbook-xsl</systemitem> package and an XSLT processor like <systemitem role="package">xsltproc</systemitem> (recommended)
zh_CN: 安装 <systemitem role="package">docbook-xsl</systemitem> 软件包和一个 XSLT 处理器，例如 <systemitem role="package">xsltproc</systemitem> (推荐)。

note: type: Content of: <book><chapter><section><section><itemizedlist><listitem><para>
en: add the <literal>docbook-xsl</literal>, <literal>docbook-xml</literal>, and <literal>xsltproc</literal> packages to the <literal>Build-Depends</literal> line in the <literal>control</literal> file
zh_CN: 在 <literal>control</literal> 文件中将 <literal>docbook-xsl</literal>, <literal>docbook-xml</literal>, 以及 <literal>xsltproc</literal> 软件包添加到 <literal>Build-Depends</literal> 行。

note: type: Content of: <book><chapter><section><para>
en: If your package has manual pages, you should install them using <citerefentry> <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> by listing them in a <filename><replaceable>package</replaceable>.manpages</filename> file.
zh_CN: 如果你的软件包有 man 手册页，你应该将它们列在 <filename><replaceable>package</replaceable>.manpages</filename> 文件中以便 <citerefentry> <refentrytitle>dh_installman</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 进行安装。

note: type: Content of: <book><chapter><section><para>
en: To install <filename>docs/gentoo.1</filename> as a manpage for the <systemitem role="package">gentoo</systemitem> package, create a <filename>gentoo.manpages</filename> file as follows:
zh_CN: 要将 <filename>doc/gentoo.1</filename> 安装为 <systemitem role="package">gentoo</systemitem> 的 man 手册页，创建一个 <filename>gentoo.manpages</filename>，内容如下：

note: type: Content of: <book><chapter><section><para>
en: The <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command installs this.
zh_CN: <citerefentry> <refentrytitle>dh_installchangelogs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令会安装这个文件。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Despite this use of the <command>bash</command> shorthand expression <filename>{pre,post}{inst,rm}</filename> to indicate these filenames, you should use pure POSIX syntax for these maintainer scripts for compatibility with <command>dash</command> as the system shell.
zh_CN: 尽管这里使用 <command>bash</command> 表达式速记法 <filename>{pre,post}{inst,rm}</filename> 来指示这些文件名，但你应该使用 纯 POSIX 语法来编写 maintainer scripts，这是为了兼容 <command>dash</command> 作为系统 shell 的情况。

note: type: Content of: <book><chapter><section><para>
en: These <filename>postinst</filename>, <filename>preinst</filename>, <filename>postrm</filename>, and <filename>prerm</filename> files <placeholder type="footnote" id="0"/> are called <emphasis>maintainer scripts</emphasis>.  They are scripts which are put in the control area of the package and run by <command>dpkg</command> when your package is installed, upgraded, or removed.
zh_CN: <filename>postinst</filename>、<filename>preinst</filename>、<filename>postrm</filename> 和 <filename>prerm</filename> 文件 <placeholder type="footnote" id="0"/> 被称为 <emphasis>maintainer scripts</emphasis>。它们是放置于软件包控制区域，并由 <command>dpkg</command> 在软件包安装、升级或卸载时执行的脚本。

note: type: Content of: <book><chapter><section><para>
en: As a novice maintainer, you should avoid any manual editing of maintainer scripts because they are problematic.  For more information refer to the <ulink url="&policy-mantainerscripts;">Debian Policy Manual, 6 "Package maintainer scripts and installation procedure"</ulink>, and take a look at the example files provided by <command>dh_make</command>.
zh_CN: 作为一个新维护人员，你应当避免手工编辑 maintainer scripts ，因为它们常存在各种问题。更多信息请阅读 <ulink url="&policy-mantainerscripts;">Debian Policy Manual, 6 "Package maintainer scripts and installation procedure"</ulink> 并查看 <command>dh_make</command> 给出的示例文件。

note: type: Content of: <book><chapter><section><para>
en: If you did not listen to me and have created custom maintainer scripts for a package, you should make sure to test them not only for <emphasis role="strong">install</emphasis> and <emphasis role="strong">upgrade</emphasis> but also for <emphasis role="strong">remove</emphasis> and <emphasis role="strong">purge</emphasis>.
zh_CN: 如果你不听我的劝告，自己为一个软件包创建并定制了 maintainer scripts，你必须保证不仅测试 <emphasis role="strong">install</emphasis> 和 <emphasis role="strong">upgrade</emphasis>，还应测试 <emphasis role="strong">remove</emphasis> 和 <emphasis role="strong">purge</emphasis>。

note: type: Content of: <book><chapter><section><para>
en: Upgrades to the new version should be silent and non-intrusive (existing users should not notice the upgrade except by discovering that old bugs have been fixed and perhaps that there are new features).
zh_CN: 升级到新版本应当是静默且非侵入式的(已有用户应当只在发现旧的 Bug 被修复或有新特性时注意到升级的变化)。

note: type: Content of: <book><chapter><section><para>
en: When the upgrade is necessarily intrusive (eg., config files scattered through various home directories with totally different structure), you may consider as the last resort switching the package to a safe fallback state (e.g., disabling a service) and providing the proper documentation required by policy (<filename>README.Debian</filename> and <filename>NEWS.Debian</filename>).  Don't bother the user with <command>debconf</command> notes invoked from these maintainer scripts for upgrades.
zh_CN: 当更新必须以非静默模式进行时(例如分散在多个主目录中的配置文件都要改为完全不同的结构时)，作为最后的手段，你应该考虑将软件包设置到安全的回退状态(例如禁用服务)并按照 Debian Policy 提供相应的文档(<filename>README.Debian</filename> 和 <filename>NEWS.Debian</filename>)。不要在升级时使用 maintainer scripts 触发 <command>debconf</command> 来打扰用户。

note: type: Content of: <book><chapter><section><para>
en: The <systemitem role="package">ucf</systemitem> package provides a <emphasis>conffile-like</emphasis> handling infrastructure to preserve user changes for files that may not be labeled as <emphasis>conffiles</emphasis> such as those managed by the maintainer scripts.  This should minimize issues associated with them.
zh_CN: <systemitem role="package">ucf</systemitem> 软件包提供了 <emphasis>类似 conffile</emphasis> 对可能不标记为 <emphasis>conffiles</emphasis> 的文件的保留机制，比如由 maintainer scripts 来管理的配置文件。这可以把最大程度减少相关的问题。

note: type: Content of: <book><chapter><section><para>
en: These maintainer scripts are among the Debian enhancements that explain <emphasis role="strong">why people choose Debian</emphasis>.  You must be very careful not to turn them into a source of annoyance.
zh_CN: 这些 maintainer scripts 是 Debian 的增强特性，它们解释了 <emphasis role="strong">人们为什么选择 Debian</emphasis>。你必须非常小心，保证人们不因此产生烦恼。

note: type: Content of: <book><chapter><section><title>
en: <filename><replaceable>package</replaceable>.symbols</filename>
zh_CN: <filename><replaceable>package</replaceable>.examples</filename>

note: type: Content of: <book><chapter><section><para>
en: Packaging of a library is not easy for a novice maintainer and should be avoided.  Having said it, if your package has libraries, you should have <filename>debian/<replaceable>package</replaceable>.symbols</filename> files. See <xref linkend="librarysymbols"/>.
zh_CN: 对于新维护者而言，打包一个库非常不易，因此不建议尝试。 这样说吧，如果你的软件包有库，那你应该处理好 <filename>debian/<replaceable>package</replaceable>.symbols</filename> 文件。 参见 <xref linkend="librarysymbols"/>.

note: type: Content of: <book><chapter><section><para>
en: The <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command installs this.
zh_CN: <citerefentry> <refentrytitle>dh_installdocs</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令会安装这个文件。

note: type: Content of: <book><chapter><section><para>
en: The <filename>watch</filename> file format is documented in the <citerefentry> <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> manpage.  The <filename>watch</filename> file configures the <command>uscan</command> program (in the <systemitem role="package">devscripts</systemitem> package) to watch the site where you originally got the source.  This is also used by the <ulink url="&debtrack;">Debian Package Tracker</ulink> service.
zh_CN: <filename>watch</filename> 文件的格式被详述于 <citerefentry> <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> man 手册页中。<filename>watch</filename> 文件配置了 <command>uscan</command> 程序(它在 <systemitem role="package">devscripts</systemitem> 中)以便监视你获得原始源代码的网站。它还被用于 <ulink url="&debtrack;">Debian 软件包跟踪系统（PTS）</ulink> 服务。

note: type: Content of: <book><chapter><section><para>
en: Here are its contents:
zh_CN: 它的内容如下：

note: type: Content of: <book><chapter><section><para>
en: Normally with a <filename>watch</filename> file, the URL at <literal>&sf-net;/gentoo</literal> is downloaded and searched for links of the form <literal>&lt;a href=...&gt;</literal>.  The basename (just the part after the final <literal>/</literal>) of each linked URL is compared against the Perl regular expression pattern (see <citerefentry> <refentrytitle>perlre</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)  <literal>gentoo-(.+)\.tar\.gz</literal>.  Out of the files that match, the one with the greatest version number is downloaded and the <command>uupdate</command> program is run to create an updated source tree.
zh_CN: 通常，在按照这个 <filename>watch</filename> 文件执行时，URL <literal>&sf-net;/gentoo</literal> 会被下载，程序会在其中搜索 <literal>&lt;a href=...&gt;</literal>。最后一个斜杠 <literal>/</literal> 后的基本名称会按照 Perl 正则表达式匹配(参看 <citerefentry> <refentrytitle>perlre</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)  <literal>gentoo-(.+)\.tar\.gz</literal>。在所有匹配的文件里，将会下载带有最大版本号的，此后由 <command>uupdate</command> 程序创建更新的源代码树。

note: type: Content of: <book><chapter><section><para>
en: Although this is true for other sites, the SourceForge download service at <ulink url="&sf-net;"/> is an exception.  When the <filename>watch</filename> file has a URL matching the Perl regexp <literal>^http://sf\.net/</literal>, the <command>uscan</command> program replaces it with <literal>&qa-do;watch/sf.php/</literal> and then applies this rule.  The URL redirector service at <ulink url="&qa-do;"/> is designed to offer a stable redirect service to the desired file for any <filename>watch</filename> pattern of the form <literal>&sf-net;/<replaceable>project</replaceable>/<replaceable>tar-name</replaceable>-(.+)\.tar\.gz</literal>.  This solves issues related to periodically changing SourceForge URLs.
zh_CN: 尽管上述内容对于所有站点都适用，但 SourceForge 下载服务(<ulink url="&sf-net;">&sf-net;</ulink>)仍是一个例外。当 <filename>watch</filename> 中包含匹配 Perl 正则表达式 <literal>^http://sf\.net/</literal> 的 URL 时，<command>uscan</command> 程序会将其替换为 <literal>&qa-do;watch/sf.php/</literal> 然后应用此规则。<ulink url="&qa-do;">&qa-do;</ulink> 的 URL 重定向服务被设计用于提供一个稳定的重定向服务以满足 <filename>watch</filename> 文件中的 <literal>&sf-net;/<replaceable>project</replaceable>/<replaceable>tar-name</replaceable>-(.+)\.tar\.gz</literal> 形式，这样解决了 SourceForge 经常性的 URL 变更导致的问题。

note: type: Content of: <book><chapter><section><para>
en: If the upstream offers the cryptographic signature of the tarball, it is recommended to verify its authenticity using the <literal>pgpsigurlmangle</literal> option as described in <citerefentry> <refentrytitle>uscan</refentrytitle><manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 如果上游提供 tarball 的加密签章，那么推荐校验其真实性，可以用 <literal>pgpsigurlmangle</literal> 选项来实现，这一点在 <citerefentry> <refentrytitle>uscan</refentrytitle><manvolnum>1</manvolnum> </citerefentry> 中有描述。

note: type: Content of: <book><chapter><section><para>
en: In the <filename>debian/source/format</filename> file, there should be a single line indicating the desired format for the source package (check <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> for an exhaustive list).  After <literal>squeeze</literal>, it should say either:
zh_CN: 在 <filename>debian/source/format</filename> 中只包含一行，写明了此源代码包的格式(查看 <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 获得完整列表)。在 <literal>squeeze</literal> 后，它应该是以下二者之一：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>3.0 (native)</literal> for native Debian packages or
zh_CN: <literal>3.0 (native)</literal> - Debian 本土软件或者

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>3.0 (quilt)</literal> for everything else.
zh_CN: <literal>3.0 (quilt)</literal> - 其他所有软件

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&debsrc3;">DebSrc3.0</ulink> for a summary on the switch to the new <literal>3.0 (quilt)</literal> and <literal>3.0 (native)</literal> source formats.
zh_CN: 参看 <ulink url="&debsrc3;">DebSrc3.0</ulink> 以了解转换到新的 <literal>3.0 (quilt)</literal> 和 <literal>3.0 (native)</literal> 源代码格式时的总结。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Actually, this new format also supports multiple upstream tarballs and more compression methods.  These are beyond the scope of this document.
zh_CN: 实际上新格式还支持多个上游 tarball 和更多的压缩方法，但这已超出本文档讲述的范围。

note: type: Content of: <book><chapter><section><para>
en: The newer <literal>3.0 (quilt)</literal> source format records modifications in a <command>quilt</command> patch series within <filename>debian/patches</filename>.  Those changes are then automatically applied during extraction of the source package.  <placeholder type="footnote" id="0"/> The Debian modifications are simply stored in a <filename>debian.tar.gz</filename> archive containing all files under the <filename>debian</filename> directory.  This new format supports inclusion of binary files such as PNG icons by the package maintainer without requiring tricks.  <placeholder type="footnote" id="1"/>
zh_CN: 全新的 <literal>3.0 (quilt)</literal> 源代码格式将所有修改使用 <command>quilt</command> 补丁系列记录到 <filename>debian/patches</filename>。这些修改会在解压源代码包时自动应用。<placeholder type="footnote" id="0"/> Debian 修改保存于 <filename>debian.tar.gz</filename> 归档文件，其中包含了整个 <filename>debian</filename> 目录。这个新格式支持直接添加例如 PNG 图标等的二进制文件。<placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><para>
en: When <command>dpkg-source</command> extracts a source package in <literal>3.0 (quilt)</literal> source format, it automatically applies all patches listed in <filename>debian/patches/series</filename>.  You can avoid applying patches at the end of the extraction with the <literal>--skip-patches</literal> option.
zh_CN: <command>dpkg-source</command> 解压 <literal>3.0 (quilt)</literal> 格式的源码包时会自动应用所有列于 <filename>debian/patches/series</filename> 的补丁。你可以使用 <literal>--skip-patches</literal> 选项避免在解压后自动应用补丁。

note: type: Content of: <book><chapter><section><para>
en: When you want to manage Debian packaging activities under a VCS, you typically create one branch (e.g., <literal>upstream</literal>) tracking the upstream source and another branch (e.g., typically <literal>master</literal> for Git)  tracking the Debian package.  For the latter, you usually want to have unpatched upstream source with your <filename>debian/*</filename> files for the Debian packaging to ease merging of the new upstream source.
zh_CN: 如果你希望使用版本控制系统（VCS）管理 Debian 打包活动，你可以创建一个分支(例如叫做 <literal>upstream</literal>) 来跟踪上游代码，和另一个分支(对于 Git 而言典型的是 <literal>master</literal> 分支)来跟踪你的 Debian 软件包。对于后者，通常会将未应用补丁的上游代码和你的 <filename>debian/*</filename> 文件放在一起以便容易合并上游的新代码。

note: type: Content of: <book><chapter><section><para>
en: After you build a package, the source is normally left patched.  You need to unpatch it manually by running <literal>dquilt pop -a</literal> before committing to the <literal>master</literal> branch.  You can automate this by adding the optional <filename>debian/source/local-options</filename> file containing <literal>unapply-patches</literal>.  This file is not included in the generated source package and changes the local build behavior only.  This file may contain <literal>abort-on-upstream-changes</literal>, too (see <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>).
zh_CN: 在编译软件包之后，源代码通常会被保持在应用补丁后的状态。你需要手工执行 <literal>quilt pop -a</literal> 来解除这些补丁，然后再提交到 <literal>master</literal> 分支。你可以向 <filename>debian/source/local-options</filename> 文件里添加一行 <literal>unapply-patches</literal> 来自动实现此目的。这个文件不会被加入到生成的源代码包，它只影响本地的编译构建行为。这个文件里还可以包含 <literal>abort-on-upstream-changes</literal> (参看 <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)。

note: type: Content of: <book><chapter><section><para>
en: The autogenerated files in the source tree can be quite annoying for packaging since they generate meaningless large patch files.  There are custom modules such as <command>dh_autoreconf</command> to ease this problem as described in <xref linkend="customrules"/>.
zh_CN: 在源码树下自动生成的文件有时会超级讨厌，因为它们会生成毫无意义巨大无比的补丁文件。 为了减轻这种问题，可以用一些定制模块比如 <command>dh_autoreconf</command> ，参见 <xref linkend="customrules"/>。

note: type: Content of: <book><chapter><section><para>
en: You can provide a Perl regular expression to the <literal>--extend-diff-ignore</literal> option argument of <citerefentry> <refentrytitle>dpkg-source</refentrytitle><manvolnum>1</manvolnum> </citerefentry> to ignore changes made to the autogenerated files while creating the source package.
zh_CN: 你可以给 <literal>--extend-diff-ignore</literal> 选项提供一个 Perl 正则表达式作为 <citerefentry> <refentrytitle>dpkg-source</refentrytitle><manvolnum>1</manvolnum> </citerefentry> 的参数，以此忽略 在创建源码包时自动生成的文件所发生的变更。

note: type: Content of: <book><chapter><section><para>
en: As a general solution to address this problem of the autogenerated files, you can store such a <command>dpkg-source</command> option argument in the <filename>source/options</filename> file of the source package.  The following will skip creating patch files for <filename>config.sub</filename>, <filename>config.guess</filename>, and <filename>Makefile</filename>.
zh_CN: 作为这个自动生成文件的问题的通用解决办法 你可以存放像 <command>dpkg-source</command> 这样的选项参数到源码包的 <filename>source/options</filename> 文件中。如下将会跳过给 <filename>config.sub</filename>, <filename>config.guess</filename>, 以及 <filename>Makefile</filename> 创建补丁文件。

note: type: Content of: <book><chapter><section><para>
en: The old <literal>1.0</literal> source format created a single large <filename>diff.gz</filename> file containing package maintenance files in <filename>debian</filename> and patch files for the source.  Such a package is a bit cumbersome to inspect and understand for each source tree modification later.  This is not so nice.
zh_CN: 旧的 <literal>1.0</literal> 源代码包格式使用单一的大 <filename>diff.gz</filename> 文件为源码保存 <filename>debian</filename> 中的维护文件和补丁。这样的软件包比较难于在事后检查和分析。这不是很好。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Several methods of patch set maintenance have been proposed and are in use for Debian packages.  The <command>quilt</command> system is the preferred maintenance system in use.  Others include <command>dpatch</command>, <command>dbs</command>, and <command>cdbs</command>.  Many of these keep such patches as <filename>debian/patches/*</filename> files.
zh_CN: 这里已经提出了若干种补丁集维护方法，并且正为 Debian 软件包所采用。 <command>quilt</command> 系统是最推荐的维护系统。而其他的有包括 <command>dpatch</command>, <command>dbs</command>, 以及 <command>cdbs</command>。 其中有许多将 补丁保存为 <filename>debian/patches/*</filename> 文件。

note: type: Content of: <book><chapter><section><para>
en: The newer <literal>3.0 (quilt)</literal> source format stores patches in <filename>debian/patches/*</filename> files using the <command>quilt</command> command.  These patches and other package data which are all contained under the <filename>debian</filename> directory are packaged as the <filename>debian.tar.gz</filename> file.  Since the <command>dpkg-source</command> command can handle <command>quilt</command> formatted patch data in the <literal>3.0 (quilt)</literal> source without the <systemitem role="package">quilt</systemitem> package, it does not need a <literal>Build-Depends</literal> on <systemitem role="package">quilt</systemitem>.  <placeholder type="footnote" id="0"/>
zh_CN: 新的 <literal>3.0 (quilt)</literal> 源码格式将补丁存储在 <filename>debian/patches/*</filename> 中，用 <command>quilt</command> 命令。 这些补丁和其他 <filename>debian</filename> 目录下的打包数据都会被打包成 <filename>debian.tar.gz</filename> 文件。由于 <command>dpkg-source</command> 命令可以处理 <command>quilt</command> 格式的补丁数据 (在格式为 <literal>3.0 (quilt)</literal> 的源码中)，而不需要 <systemitem role="package">quilt</systemitem> 软件包；不需要在 <literal>Build-Depends</literal> 中添加 <systemitem role="package">quilt</systemitem>。  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If you are asking a sponsor to upload your package, this kind of clear separation and documentation of your changes is very important to expedite the package review by your sponsor.
zh_CN: 如果你需要一个 sponsor 上传你的软件包，这种情况下，清晰的软件包分离和记录更改的文档对于软件包审查过程的顺利程度非常重要。

note: type: Content of: <book><chapter><section><para>
en: The <command>quilt</command> command is explained in <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  It records modifications to the source as a stack of <literal>-p1</literal> patch files in the <filename>debian/patches</filename> directory and the source tree is untouched outside of the <filename>debian</filename> directory.  The order of these patches is recorded in the <filename>debian/patches/series</filename> file.  You can apply (=push), un-apply (=pop), and refresh patches easily.  <placeholder type="footnote" id="0"/>
zh_CN: <command>quilt</command> 命令在 <citerefentry> <refentrytitle>quilt</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 中有详细描述。它将对源代码的修改维护于 <filename>debian/patches</filename> 中一系列 <literal>-p1</literal> 级别的补丁文件中，<filename>debian</filename> 目录外的文件没有任何修改。这些补丁的顺序记录于 <filename>debian/patches/series</filename> 文件中。你可以轻松地 apply (=push)、un-apply (=pop) 和 refresh 补丁。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: For <xref linkend="modify"/>, we created three patches in <filename>debian/patches</filename>.
zh_CN: 在 <xref linkend="modify"/> 中，我们在 <filename>debian/patches</filename> 创建了三个补丁。

note: type: Content of: <book><chapter><section><para>
en: Since Debian patches are located in <filename>debian/patches</filename>, please make sure to set up the <command>dquilt</command> command properly as described in <xref linkend="quiltrc"/>.
zh_CN: 因为 Debian 补丁位于 <filename>debian/patches</filename>，请确定按照 <xref linkend="quiltrc"/> 中的方法正确配置 <command>dquilt</command>。

note: type: Content of: <book><chapter><section><para>
en: When anyone (including yourself) provides a patch <filename><replaceable>foo</replaceable>.patch</filename> to the source later, modifying a <literal>3.0 (quilt)</literal> source package is quite simple:
zh_CN: 如果在之后有人(包括你自己)提供了一个补丁 <filename><replaceable>foo</replaceable>.patch</filename>，对于 <literal>3.0 (quilt)</literal> 源代码包格式可以很容易修改：

note: type: Content of: <book><chapter><section><para>
en: The patches stored in the newer <literal>3.0 (quilt)</literal> source format must be <emphasis>fuzz</emphasis> free.  You can ensure this with <literal>dquilt pop -a; while dquilt push; do dquilt refresh; done</literal>.
zh_CN: 用新的 <literal>3.0 (quilt)</literal> 源代码包格式存储的补丁必须有 <emphasis>清晰的边界</emphasis>。你应该通过 <literal>dquilt pop -a; while quilt push; do quilt refresh; done</literal> 来验证这点。

note: type: Content of: <book><chapter><title>
en: Building the package
zh_CN: 构建软件包

note: type: Content of: <book><chapter><para>
en: We should now be ready to build the package.
zh_CN: 现在我们已经为构建软件包做好了准备。

note: type: Content of: <book><chapter><section><title>
en: Complete (re)build
zh_CN: 完整的(重)构建

note: type: Content of: <book><chapter><section><para>
en: In order to perform a complete (re)build of a package properly, you need to make sure you have installed
zh_CN: 为保证完整的软件包(重)构建能顺利进行，你必须保证系统中已经安装

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: the <systemitem role="package">build-essential</systemitem> package,
zh_CN: <systemitem role="package">build-essential</systemitem> 软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/>), and
zh_CN: 列于 <literal>Build-Depends</literal> 域的软件包(参看 <xref linkend="control"/>)；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: packages listed in the <literal>Build-Depends-indep</literal> field (see <xref linkend="control"/>).
zh_CN: 列于 <literal>Build-Depends-indep</literal> 域的软件包(参看 <xref linkend="control"/>)。

note: type: Content of: <book><chapter><section><para>
en: Then you issue the following command in the source directory:
zh_CN: 然后在源代码目录中执行以下命令：

note: type: Content of: <book><chapter><section><para>
en: This will do everything to make full binary and source packages for you.  It will:
zh_CN: 这样会自动完成所有从源代码包构建二进制包的工作，包括：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: clean the source tree (<literal>debian/rules clean</literal>)
zh_CN: 清理源代码树(<literal>debian/rules clean</literal>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: build the source package (<literal>dpkg-source -b</literal>)
zh_CN: 构建源代码包(<literal>dpkg-source -b</literal>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: build the program (<literal>debian/rules build</literal>)
zh_CN: 构建程序(<literal>debian/rules build</literal>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: build binary packages (<literal>fakeroot debian/rules binary</literal>)
zh_CN: 构建二进制包(<literal>fakeroot debian/rules binary</literal>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: make the <filename>.dsc</filename> file
zh_CN: 制作 <filename>.dsc</filename> 文件

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: make the <filename>.changes</filename> file, using <command>dpkg-genchanges</command>
zh_CN: 用 <command>dpkg-genchanges</command> 命令制作 <filename>.changes</filename> 文件。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This GPG key must be signed by a Debian developer to get connected to the web of trust and must be registered to <ulink url="&keyring;">the Debian keyring</ulink>.  This enables your uploaded packages to be accepted to the Debian archives.  See <ulink url="&keycreate;">Creating a new GPG key</ulink> and <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>.
zh_CN: 为了连接至信任网络，本 GPG 密钥必须被一名 Debian 开发者签署， 而且必须注册到 <ulink url="&keyring;">the Debian keyring</ulink> （Debian密钥环）中。  这样你上传的软件包就能被接受到 Debian 归档中了。 参见 <ulink url="&keycreate;">Creating a new GPG key</ulink> 以及 <ulink url="&keysigning; ">Debian Wiki on Keysigning</ulink>。

note: type: Content of: <book><chapter><section><para>
en: If the build result is satisfactory, sign the <filename>.dsc</filename> and <filename>.changes</filename> files with your private GPG key using the <command>debsign</command> command.  You need to enter your secret pass phrase, twice.  <placeholder type="footnote" id="0"/>
zh_CN: 如果构建结果令人满意，那就用 <command>debsign</command> 命令以你的私有 GPG 密钥签署 <filename>.dsc</filename> 文件和 <filename>.changes</filename> 文件。你需要输入密码两次。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: For a non-native Debian package, e.g., <systemitem role="package">gentoo</systemitem>, you will see the following files in the parent directory (<filename>~/gentoo</filename>) after building packages:
zh_CN: 对于非本土 Debian 软件包，比如 <systemitem role="package">gentoo</systemitem>， 构建软件包之后，你将会在上一级目录(<filename>~/gentoo</filename>) 中看到下列文件：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This is the original upstream source code tarball, merely renamed to the above so that it adheres to the Debian standard.  Note that this was created initially by the command <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal>.
zh_CN: 这是原始的源代码 tarball，最初由 <literal>dh_make -f ../gentoo-0.9.12.tar.gz</literal> 命令创建，它的内容与上游 tarball 相同，仅被重命名以符合 Debian 的标准。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This is a summary of the contents of the source code.  The file is generated from your <filename>control</filename> file, and is used when unpacking the source with <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 这是一个从 <filename>control</filename> 文件生成的源代码概要，可被 <citerefentry> <refentrytitle>dpkg-source</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 程序解包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This compressed tarball contains your <filename>debian</filename> directory contents.  Each and every addition you made to the original source code is stored as a <command>quilt</command> patch in <filename>debian/patches</filename>.
zh_CN: 这个压缩的 Tar 归档包含你的 <filename>debian</filename> 目录内容。其他所有对于源代码的修改都由 <command>quilt</command> 补丁存储于 <filename>debian/patches</filename> 中。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: You can avoid applying <command>quilt</command> patches in the <literal>3.0 (quilt)</literal> source format at the end of the extraction with the <literal>--skip-patches</literal> option.  Alternatively, you can run <literal>dquilt pop -a</literal> after normal operation.
zh_CN: 你可以使用 <literal>--skip-patches</literal> 选项来在正常的提取操作后避免应用 <literal>3.0 (quilt)</literal> 源代码包格式中的 <command>quilt</command> 补丁。你也可以在正常解压后使用 <literal>quilt pop -a</literal> 还原这些补丁对源码的修改。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If someone else wants to re-create your package from scratch, they can easily do so using the above three files.  The extraction procedure is trivial: just copy the three files somewhere else and run <literal>dpkg-source -x gentoo_0.9.12-1.dsc</literal>.  <placeholder type="footnote" id="0"/>
zh_CN: 如果其他人想要重新构建你的软件包，他们可以使用以上三个文件很容易地完成。只需复制三个文件，再运行 <literal>dpkg-source -x gentoo_0.9.12-1.dsc</literal>。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This is your completed binary package.  You can use <command>dpkg</command> to install and remove this just like any other package.
zh_CN: 这是你的二进制包，可以使用 <command>dpkg</command> 程序安装或卸载它，就像其他软件包一样。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: This file describes all the changes made in the current package revision; it is used by the Debian FTP archive maintenance programs to install the binary and source packages.  It is partly generated from the <filename>changelog</filename> file and the <filename>.dsc</filename> file.
zh_CN: 这个文件描述了当前修订版本软件包中的全部变更，它被 Debian FTP 仓库维护程序用于安装二进制和源代码包。它是部分从 <filename>changelog</filename> 和 <filename>.dsc</filename> 文件生成的。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: As you keep working on the package, its behavior will change and new features will be added.  People downloading your package can look at this file and quickly see what has changed.  Debian archive maintenance programs will also post the contents of this file to the <ulink url="&debian-devel-changes-ldo;">debian-devel-changes@lists.debian.org</ulink> mailing list.
zh_CN: 随着你不断完善这个软件包，程序的行为会发生变化，也会有更多新特性添加进来。下载你软件包的人可以查看这个文件来快速找到有哪些变化，Debian 仓库维护程序还会把它的内容发表至 <ulink url="&debian-devel-changes-ldo;">debian-devel-changes@lists.debian.org</ulink> 邮件列表。

note: type: Content of: <book><chapter><section><para>
en: The <filename>gentoo_0.9.12-1.dsc</filename> and <filename>gentoo_0.9.12-1_i386.changes</filename> files must be signed using the <command>debsign</command> command with your private GPG key in the <filename>~/.gnupg/</filename> directory, before uploading them to the Debian FTP archive. The GPG signature provides the proof that these files are really yours, using your public GPG key.
zh_CN: 在上传到 Debian FTP 仓库中前，<filename>gentoo_0.9.12-1.dsc</filename> 文件和 <filename>gentoo_0.9.12-1_i386.changes</filename> 文件必须用 <command>debsign</command> 命令签署，其中使用你自己存放在 <filename>~/.gnupg/</filename> 目录中的 GPG 私钥。 用你的公钥，可以令 GPG 签名证明这些文件真的是你的。

note: type: Content of: <book><chapter><section><para>
en: The <command>debsign</command> command can be made to sign with your specified secret GPG key ID (good for sponsoring packages) with the following in the <filename>~/.devscripts</filename> file:
zh_CN: <command>debsign</command> 命令可以用来以指定 ID 的 GPG 密钥进行签署 （这方便了赞助(sponsor)软件包）， 只要照着下边在 <filename>~/.devscripts</filename> 中的内容：

note: type: Content of: <book><chapter><section><para>
en: The long strings of numbers in the <filename>.dsc</filename> and <filename>.changes</filename> files are SHA1/SHA256 checksums for the files mentioned.  Anyone downloading your files can test them with <citerefentry> <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> or <citerefentry> <refentrytitle>sha256sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> and if the numbers don't match, they'll know the file is corrupt or has been tampered with.
zh_CN: <filename>.dsc</filename> 和 <filename>.changes</filename> 文件中很长的数字串是其中提及文件的 SHA1/SHA256 校验和。下载你软件包的人可以使用 <citerefentry> <refentrytitle>sha1sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 或 <citerefentry> <refentrytitle>sha256sum</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来进行核对。如果校验和不符，则说明文件已被损坏或偷换。

note: type: Content of: <book><chapter><section><title>
en: Autobuilder
zh_CN: 自动编译系统

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The actual autobuilder system involves much more complicated schemes than the one documented here.  Such details are beyond the scope of this document.
zh_CN: 实际中的自动构建系统包含了极为复杂(比这里说明的还要复杂)的体制。不过这类细节已经超出本文档范围。

note: type: Content of: <book><chapter><section><para>
en: Debian supports many <ulink url="&ports;">ports</ulink> with the <ulink url="&buildd;">autobuilder network</ulink> running <command>buildd</command> daemons on computers of many different architectures.  Although you do not need to do this yourself, you should be aware of what will happen to your packages.  Let's look into roughly how they rebuild your packages for multiple architectures.  <placeholder type="footnote" id="0"/>
zh_CN: Debian 支持非常多的 <ulink url="&ports;">移植(port)</ulink>，同时它有着 <ulink url="&buildd;">自动构建网络</ulink>，这个网络在不同体系结构的计算机上运行着 <command>buildd</command> 守护进程。 虽然你不需要自己做这件事情，你也应该知道在你的软件包身上发生了什么。让我们来简要地看看他们是如何为你给多个体系结构构建软件包的。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: For <literal>Architecture: any</literal> packages, the autobuilder system performs a rebuild.  It ensures the installation of
zh_CN: 对于 <literal>Architecture: any</literal> 的软件包，自动编译系统重构建它们。它确保系统中已经安装

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: the <systemitem role="package">build-essential</systemitem> package, and
zh_CN: <systemitem role="package">build-essential</systemitem> 软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: packages listed in the <literal>Build-Depends</literal> field (see <xref linkend="control"/>).
zh_CN: 列于 <literal>Build-Depends</literal> 域的软件包(参看 <xref linkend="control"/>)。

note: type: Content of: <book><chapter><section><para>
en: Then it issues the following command in the source directory:
zh_CN: 然后在源代码目录中执行以下命令：

note: type: Content of: <book><chapter><section><para>
en: This will do everything to make architecture dependent binary packages on another architecture.  It will:
zh_CN: 这样会自动完成从源代码包构建平台依赖二进制包的工作，包括：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: build architecture dependent binary packages (<literal>fakeroot debian/rules binary-arch</literal>)
zh_CN: 构建平台依赖二进制包(<literal>fakeroot debian/rules binary-arch</literal>)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: sign the source <filename>.dsc</filename> file, using <command>gpg</command>
zh_CN: 使用 <command>gpg</command> 签署 <filename>.dsc</filename> 文件

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: create and sign the upload <filename>.changes</filename> file, using <command>dpkg-genchanges</command> and <command>gpg</command>
zh_CN: 使用 <command>dpkg-genchanges</command> 和 <command>gpg</command> 创建并签署上传用的 <filename>.changes</filename> 文件

note: type: Content of: <book><chapter><section><para>
en: This is why you see your package for other architectures.
zh_CN: 这就是你看到你的软件包在其他平台上可用的原因。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Unlike under the <systemitem role="package">pbuilder</systemitem> package, the <command>chroot</command> environment under the <systemitem role="package">sbuild</systemitem> package used by the autobuilder system does not enforce the use of a minimal system and may have many leftover packages installed.
zh_CN: 和在 <systemitem role="package">pbuilder</systemitem> 中不同，自动编译系统使用的 <systemitem role="package">sbuild</systemitem> 软件包所维护的 <command>chroot</command> 不强制要求最小化的编译系统，并可能保持很多软件包始终安装在其中。

note: type: Content of: <book><chapter><section><para>
en: Although packages listed in the <literal>Build-Depends-Indep</literal> field are required to be installed for our normal packaging work (see <xref linkend="completebuild"/>), they are not required to be installed for the autobuilder system since it builds only architecture dependent binary packages.  <placeholder type="footnote" id="0"/> This distinction between normal packaging and autobuilding procedures is what dictates whether you should record such required packages in the <literal>Build-Depends</literal> or <literal>Build-Depends-Indep</literal> fields of the <filename>debian/control</filename> file (see <xref linkend="control"/>).
zh_CN: 尽管通常的打包工作中 <literal>Build-Depends-indep</literal> 字段中列出的软件包都需要安装(参看 <xref linkend="completebuild"/>)，但是在编译平台依赖二进制包时它们无需在自动编译系统上安装。<placeholder type="footnote" id="0"/>通常打包和自动编译系统的这种不同为你指出如何考虑必须的软件包应如何放在 <filename>debian/control</filename> 文件的 <literal>Build-Depends</literal> 或 <literal>Build-Depends-indep</literal> 域中(参看 <xref linkend="control"/>)。

note: type: Content of: <book><chapter><section><title>
en: <command>debuild</command> command
zh_CN: <command>debuild</command> 命令

note: type: Content of: <book><chapter><section><para>
en: You can automate the build activity around executing the <command>dpkg-buildpackage</command> command package further with the <command>debuild</command> command.  See <citerefentry> <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 你可以使用 <command>debuild</command> 命令来进一步自动化 <command>dpkg-buildpackage</command> 的构建过程。参看 <citerefentry> <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>

note: type: Content of: <book><chapter><section><para>
en: The <command>debuild</command> command executes the <command>lintian</command> command to make a static check after building the Debian package.  The <command>lintian</command> command can be customized with the following in the <filename>~/.devscripts</filename> file:
zh_CN: <command>debuild</command> 命令会执行 <command>lintian</command> 命令，以在 Debian 软件包构建结束之后进行静态检查。 <command>lintian</command> 命令可以用下边出现在 <filename>~/.devscripts</filename> 文件中的项来定制：

note: type: Content of: <book><chapter><section><para>
en: Cleaning the source and rebuilding the package from your user account is as simple as:
zh_CN: 在普通用户帐号中可以使用以下这样简单的命令清理源代码并重构建软件包：

note: type: Content of: <book><chapter><section><para>
en: You can clean the source tree as simply as:
zh_CN: 还可以这样简单地清理源代码树：

note: type: Content of: <book><chapter><section><title>
en: <systemitem role="package">pbuilder</systemitem> package
zh_CN: <systemitem role="package">pbuilder</systemitem> 软件包

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Since the <systemitem role="package">pbuilder</systemitem> package is still evolving, you should check the actual configuration situation by consulting the latest official documentation.
zh_CN: 由于 <systemitem role="package">pbuilder</systemitem> 软件包仍然在进化，你应当查阅最新的官方文档来检查实际的配置状况。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&buildd-do;"/> for more on Debian package auto-building.
zh_CN: 参见 <ulink url="&buildd-do;"/> 以获取更多关于 Debian 软件包 auto-building 的信息。

note: type: Content of: <book><chapter><section><para>
en: For a clean room (<command>chroot</command>) build environment to verify the build dependencies, the <systemitem role="package">pbuilder</systemitem> package is very useful.  <placeholder type="footnote" id="0"/> This ensures a clean build from the source under the <literal>sid</literal> auto-builder for different architectures and avoids a severity serious FTBFS (Fails To Build From Source) bug which is always in the RC (release critical) category.  <placeholder type="footnote" id="1"/>
zh_CN: 对于使用净室(<command>chroot</command>)编译环境来验证编译依赖而言，<systemitem role="package">pbuilder</systemitem> 软件包是非常有用的。<placeholder type="footnote" id="0"/>它确保了软件包在不同构架上的 <literal>sid</literal> 发行版环境中的自动编译器中能干净地编译，避免了总是被归类于 RC (Release Critical，影响发布)的严重 FTBFS (Fails To Build From Source，从源代码编译失败) Bug。<placeholder type="footnote" id="1"/>

note: type: Content of: <book><chapter><section><para>
en: Let's customize the <systemitem role="package">pbuilder</systemitem> package as follows:
zh_CN: 我们通过以下操作来定制 <systemitem role="package">pbuilder</systemitem> 软件包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: setting the <filename>/var/cache/pbuilder/result</filename> directory writable by your user account.
zh_CN: 设置 <filename>/var/cache/pbuilder/result</filename> 对当前用户可写。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: creating a directory, e.g.  <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>, writable by the user, to place hook scripts in.
zh_CN: 创建一个对用户可写的目录保存钩子脚本，例如 <filename><replaceable>/var/cache/pbuilder/hooks</replaceable></filename>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: configuring <filename>~/.pbuilderrc</filename> or <filename>/etc/pbuilderrc</filename> to include the following.
zh_CN: 在 <filename>~/.pbuilderrc</filename> 或 <filename>/etc/pbuilderrc</filename> 中添加以下内容：

note: type: Content of: <book><chapter><section><para>
en: First let's initialize the local <systemitem role="package">pbuilder</systemitem> <command>chroot</command> system as follows:
zh_CN: 首先使用以下命令初始化本地 <systemitem role="package">pbuilder</systemitem> <command>chroot</command> 系统：

note: type: Content of: <book><chapter><section><para>
en: If you already have a completed source package, issue the following commands in the directory where the <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>, <filename><replaceable>foo</replaceable>.debian.tar.gz</filename>, and <filename><replaceable>foo</replaceable>.dsc</filename> files exist to update the local <systemitem role="package">pbuilder</systemitem> <command>chroot</command> system and to build binary packages in it:
zh_CN: 如果你已经创建了源代码包，在包含 <filename><replaceable>foo</replaceable>.orig.tar.gz</filename>、<filename><replaceable>foo</replaceable>.debian.tar.gz</filename> 和 <filename><replaceable>foo</replaceable>.dsc</filename> 文件的目录中执行下面的命令来更新 <systemitem role="package">pbuilder</systemitem> <command>chroot</command> 系统以便在其中执行构建：

note: type: Content of: <book><chapter><section><para>
en: The newly built packages without the GPG signatures will be located in <filename>/var/cache/pbuilder/result/</filename> with non-root ownership.
zh_CN: 新构建的无 GPG 签名的软件包会被以非 root 属主放置于 <filename>/var/cache/pbuilder/result/</filename>。

note: type: Content of: <book><chapter><section><para>
en: The GPG signatures on the <filename>.dsc</filename> file and the <filename>.changes</filename> file can be generated as:
zh_CN: <filename>.dsc</filename> 文件和 <filename>.changes</filename> 文件中的 GPG 签名可以用如下方法生成：

note: type: Content of: <book><chapter><section><para>
en: If you have an updated source tree but have not generated the matching source package, issue the following commands in the source directory where the <filename>debian</filename> directory exists, instead:
zh_CN: 如果你已经更新了源代码树但没有生成对应的源代码包，在存放 <filename>debian</filename> 目录的源码目录里执行：

note: type: Content of: <book><chapter><section><para>
en: You can log into its <command>chroot</command> environment with the <literal>pbuilder --login --save-after-login</literal> command and configure it as you wish.  This environment can be saved by leaving its shell prompt with <literal>^D</literal> (Control-D).
zh_CN: 你可以使用 <literal>pbuilder --login --save-after-login</literal> 命令登录到这个 <command>chroot</command> 环境中并按照需要对其进行配置。通过 <literal>^D</literal> (Control-D)离开这个 shell 时环境会被保存。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: This assumes <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>.  You can find many examples of hook scripts in the <filename>/usr/share/doc/pbuilder/examples</filename> directory.
zh_CN: 此处默认 <literal>HOOKDIR=/var/cache/pbuilder/hooks</literal>。你可以在 <filename>/usr/share/doc/pbuilder/examples</filename> 目录中找到很多钩子脚本的例子。

note: type: Content of: <book><chapter><section><para>
en: The latest version of the <command>lintian</command> command can be executed in the <literal>chroot</literal> environment using the hook script <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename> configured as follows: <placeholder type="footnote" id="0"/>
zh_CN: 最新版的 <command>lintian</command> 命令可以通过设置钩子脚本 <filename><replaceable>/var/cache/pbuilder/hooks</replaceable>/B90lintian</filename> 在 <literal>chroot</literal> 环境中运行。脚本内容如下：<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: You need to have access to the latest <literal>sid</literal> environment to build packages properly for <literal>sid</literal>.  In practice, <literal>sid</literal> may be experiencing issues which makes it undesirable for you to migrate your whole system.  The <systemitem role="package">pbuilder</systemitem> package can help you to cope with this kind of situation.
zh_CN: 为 <literal>sid</literal> 编译软件包需要使用 <literal>sid</literal> 环境。在现实中 <literal>sid</literal> 存在很多问题以至于你不愿意将整个系统都迁移到其上。<systemitem role="package">pbuilder</systemitem> 软件包可以在这种情况下很好地解决问题。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: There are some restrictions for such updates of your <literal>stable</literal> package.
zh_CN: 升级你的 <literal>stable</literal> 软件包有一些规定的限制。

note: type: Content of: <book><chapter><section><para>
en: You may need to update your <literal>stable</literal> packages after their release for <literal>stable-proposed-updates</literal>, <literal>stable/updates</literal>, etc.  <placeholder type="footnote" id="0"/> For such occasions, the fact that you may be running a <literal>sid</literal> system is not a good enough excuse for failing to update them promptly.  The <systemitem role="package">pbuilder</systemitem> package can help you to access environments of almost any Debian derivative distribution of the same architecture.
zh_CN: 你可能需要在 <literal>stable</literal> 软件包发布后为 <literal>stable-proposed-updates</literal>、<literal>stable/updates</literal> 等仓库升级你维护的软件包。<placeholder type="footnote" id="0"/>对于这类情况，“我正在运行 <literal>sid</literal> 系统”并不是你不为它们进行升级的充分理由。<systemitem role="package">pbuilder</systemitem> 软件包可以帮助你使用到相同 CPU 体系结构下几乎所有 Debian 和 Debian 衍生版系统环境。

note: type: Content of: <book><chapter><section><para>
en: See <ulink url="&pbuilder;"/>, <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>pbuilderrc</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>, and <citerefentry> <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>.
zh_CN: 参见 <ulink url="&pbuilder;"/>, <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>, <citerefentry> <refentrytitle>pbuilderrc</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>, 和 <citerefentry> <refentrytitle>pbuilder</refentrytitle> <manvolnum>8</manvolnum> </citerefentry>.

note: type: Content of: <book><chapter><section><title>
en: <command>git-buildpackage</command> command and similar
zh_CN: <command>git-buildpackage</command> 及其相似命令

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&debref-vcs;">Version control systems</ulink> for more.
zh_CN: 参见 <ulink url="&debref-vcs;">Version control systems</ulink> 以获取更多信息。

note: type: Content of: <book><chapter><section><para>
en: If your upstream uses a source code management system (VCS)  <placeholder type="footnote" id="0"/> to maintain their code, you should consider using it as well.  This makes merging and cherry-picking upstream patches much easier.  There are several specialized wrapper script packages for Debian package building for each VCS.
zh_CN: 如果你的上游对源代码使用版本控制系统(VCS)<placeholder type="footnote" id="0"/>，你也应该考虑使用它们。这会使得合并和提取上游补丁更加简单。有多个为不同 VCS 设计的包装脚本包来协助 Debian 软件包构建。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">git-buildpackage</systemitem>: a suite to help with Debian packages in Git repositories.
zh_CN: <systemitem role="package">git-buildpackage</systemitem>：帮助维护 Git 仓库中 Debian 软件包的套件。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">svn-buildpackage</systemitem>: helper programs to maintain Debian packages with Subversion.
zh_CN: <systemitem role="package">svn-buildpackage</systemitem>：帮助维护 Subversion 仓库中 Debian 软件包的程序。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <systemitem role="package">cvs-buildpackage</systemitem>: a set of Debian package scripts for CVS source trees.
zh_CN: <systemitem role="package">cvs-buildpackage</systemitem>：为 CVS 源代码树设计的 Debian 软件包脚本集。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: <ulink url="&debian-alioth-wiki;">Debian wiki Alioth</ulink> documents how to use the <ulink url="&debian-alioth;">alioth.debian.org</ulink> service.
zh_CN: <ulink url="&debian-alioth-wiki;">Debian wiki Alioth</ulink> 这里说明了 如何使用 <ulink url="&debian-alioth;">alioth.debian.org</ulink> 服务。

note: type: Content of: <book><chapter><section><para>
en: Use of <systemitem role="package">git-buildpackage</systemitem> is becoming quite popular for Debian Developers to manage Debian packages with the Git server on <ulink url="&debian-alioth;">alioth.debian.org</ulink>. <placeholder type="footnote" id="0"/> This package offers many commands to <emphasis>automate</emphasis> packaging activities:
zh_CN: <systemitem role="package">git-buildpackage</systemitem> 的使用 在 Debian 开发者之中非常流行， 它可以使用 <ulink url="&debian-alioth;">alioth.debian.org</ulink> 上的 Git 服务器来管理 Debian 软件包。 <placeholder type="footnote" id="0"/> 这个软件包提供了许多命令来 <emphasis>自动化</emphasis> 打包操作：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <citerefentry> <refentrytitle>gbp-import-dsc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: import a previous Debian package to a Git repository.
zh_CN: <citerefentry> <refentrytitle>gbp-import-dsc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: 将一个早先的 Debian 软件包导入到 Git 仓库中。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <citerefentry> <refentrytitle>gbp-import-orig</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: import a new upstream tar to a Git repository.
zh_CN: <citerefentry> <refentrytitle>gbp-import-orig</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: 将上游 tar 文件导入到 Git 仓库中。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <citerefentry> <refentrytitle>gbp-dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: generate the Debian changelog from Git commit messages.
zh_CN: <citerefentry> <refentrytitle>gbp-dch</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: 用 Git commit 信息来生成 Debian changelog。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <citerefentry> <refentrytitle>git-buildpackage</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: build Debian packages from a Git repository.
zh_CN: <citerefentry> <refentrytitle>git-buildpackage</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: 从 Git 仓库中构建 Debian 软件包。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <citerefentry> <refentrytitle>git-pbuilder</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>: build Debian packages from a Git repository using <command>pbuilder</command>/<command>cowbuilder</command>.
zh_CN: <citerefentry> <refentrytitle>git-pbuilder</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>:  用 <command>pbuilder</command>/<command>cowbuilder</command> 从 Git 仓库来构建 Debian 软件包。

note: type: Content of: <book><chapter><section><para>
en: These commands use 3 branches to track packaging activity:
zh_CN: 这些命令使用 3 个分支来跟踪打包操作：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>main</literal> for Debian package source tree.
zh_CN: <literal>main</literal> 用于 Debian 软件源码树。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>upstream</literal> for upstream source tree.
zh_CN: <literal>upstream</literal> 用于上游源码树。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: The <literal>--pristine-tar</literal> option invokes the <command>pristine-tar</command> command, which can regenerate an exact copy of a pristine upstream tarball using only a small binary delta file and the contents of the tarball that are typically kept in an <literal>upstream</literal> branch in the VCS.
zh_CN: <literal>--pristine-tar</literal> 选项会调用 <command>pristine-tar</command> 命令，它能利用一个很小的二进制差量文件以及在版本控制系统中某个分支内保存的上游文件内容（分支名通常为 <literal>upstream</literal>）重新生成与上游 tarball 完全相同的一份副本。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>pristine-tar</literal> for upstream tarball generated by the <literal>--pristine-tar</literal> option.<placeholder type="footnote" id="0"/>
zh_CN: 由 <literal>--pristine-tar</literal> 为上游 tarball 生成的<literal>pristine-tar</literal> 。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Here are some web resources available for advanced audiences.
zh_CN: 这里有一些给高级读者参考的网页资源。

note: type: Content of: <book><chapter><section><para><footnote><itemizedlist><listitem><para>
en: Building Debian Packages with git-buildpackage (<filename>&git-buildpackage-doc;</filename>)
zh_CN: 用 git-buildpackage (<filename>&git-buildpackage-doc;</filename>) 构建 Debian 软件包

note: type: Content of: <book><chapter><section><para>
en: You can configure <systemitem role="package">git-buildpackage</systemitem> with <filename>~/.gbp.conf</filename>. See <citerefentry> <refentrytitle>gbp.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>.  <placeholder type="footnote" id="0"/>
zh_CN: 你可以设置 <systemitem role="package">git-buildpackage</systemitem>，通过修改 <filename>~/.gbp.conf</filename> 文件。参见 <citerefentry> <refentrytitle>gbp.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry>.  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><title>
en: Quick rebuild
zh_CN: 快速重构建

note: type: Content of: <book><chapter><section><para><footnote><para>
en: Environment variables that are normally configured to proper values are not set by this method.  Never create real packages to be uploaded using this <emphasis role="strong">quick</emphasis> method.
zh_CN: 常规情形下被配置好的环境变量在此时不会被自动设置。永远不要将使用这个 <emphasis role="strong">快速</emphasis> 方法构建的软件包上传到任何地方。

note: type: Content of: <book><chapter><section><para>
en: With a large package, you may not want to rebuild from scratch every time while you're tuning details in <filename>debian/rules</filename>.  For testing purposes, you can make a <filename>.deb</filename> file without rebuilding the upstream sources like this<placeholder type="footnote" id="0"/>:
zh_CN: 对于很大的软件包，在调试 <filename>debian/rules</filename> 的过程中你可能不想每次都对整个软件包进行重构建。仅用于测试目的，你可以不重新构建源代码包而使用以下的方法创建 <filename>.deb</filename> 文件<placeholder type="footnote" id="0"/>：

note: type: Content of: <book><chapter><section><para>
en: Or simply do the following to see if it builds or not:
zh_CN: 或者可以通过以下方法验证它是否能通过编译：

note: type: Content of: <book><chapter><section><para>
en: Once you are finished with your tuning, remember to rebuild following the proper procedure.  You may not be able to upload correctly if you try to upload <filename>.deb</filename> files built this way.
zh_CN: 一旦完成了调试，记住要按照前面所给出的正常过程重构建你的软件包。你可能无法正常上传用此种方法构建的 <filename>.deb</filename> 文件。

note: type: Content of: <book><chapter><section><title>
en: Command hierarchy
zh_CN: 命令层级

note: type: Content of: <book><chapter><section><para>
en: Here is a quick summary of how many commands to build packages fit together in the command hierarchy. There are many ways to do the same thing.
zh_CN: 这里有一个简练的总结，关于在命令层次结构中有多少用于构建软件包的命令能够组合到一起。做这件事情的方法非常多。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <filename>debian/rules</filename> = maintainer script for the package building
zh_CN: <filename>debian/rules</filename> = 软件包构建过程的专用 maintainer script

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>dpkg-buildpackage</command> = core of the package building tool
zh_CN: <command>dpkg-buildpackage</command> = 软件包构建之核心工具

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>debuild</command> = <command>dpkg-buildpackage</command> + <command>lintian</command> (build under the sanitized environment variables)
zh_CN: <command>debuild</command> = <command>dpkg-buildpackage</command> + <command>lintian</command> (在干净的环境变量下构建)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>pbuilder</command> = core of the Debian chroot environment tool
zh_CN: <command>pbuilder</command> = Debian chroot 环境核心工具

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>pdebuild</command> = <command>pbuilder</command> + <command>dpkg-buildpackage</command> (build in the chroot)
zh_CN: <command>pdebuild</command> = <command>pbuilder</command> + <command>dpkg-buildpackage</command> (在chroot环境中构建)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>cowbuilder</command> = speed up the <command>pbuilder</command> execution
zh_CN: <command>cowbuilder</command> = 加速 <command>pbuilder</command> 执行

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>git-pbuilder</command> = the easy-to-use commandline syntax for <command>pdebuild</command> (used by <command>gbp buildpackage</command>)
zh_CN: <command>git-pbuilder</command> = 命令行语法友好<command>pdebuild</command> (被 <command>gbp buildpackage</command> 使用)

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <command>gbp</command> = manage the Debian source under the git repo
zh_CN: <command>gbp</command> = 在 Git 仓库中管理 Debian 源码

note: type: Content of: <book><chapter><section><para>
en: Although use of higher level commands such as <command>gbp buildpackage</command> and <command>pbuilder</command> ensures the perfect package building environment, it is essential to understand how lower level commands such as <filename>debian/rules</filename> and <command>dpkg-buildpackage</command> are executed under them.
zh_CN: 即便像 <command>gbp buildpackage</command> 和 <command>pbuilder</command> 这样的高级命令的应用可以确保完美的软件包 构建环境，了解像 <filename>debian/rules</filename> 和 <command>dpkg-buildpackage</command> 这样的低级命令行工具如何被它们执行也是至关重要的。

note: type: Content of: <book><chapter><title>
en: Checking the package for errors
zh_CN: 检查软件包中的错误

note: type: Content of: <book><chapter><para>
en: There are some techniques you should know for checking a package for errors before uploading it to the public archives.
zh_CN: 在上传软件包到公共仓库前，你还需要知道一些检查软件包错误的技巧。

note: type: Content of: <book><chapter><para>
en: It's also a good idea to carry out testing on a machine other than your own.  You must watch closely for any warnings or errors for all the tests described here.
zh_CN: 不仅在自己的机器上测试总是一个好主意。你必须谨慎地对待以下叙述的测试中显示的任何一个警告或错误信息。

note: type: Content of: <book><chapter><section><title>
en: Suspicious changes
zh_CN: 诡异可疑的改动

note: type: Content of: <book><chapter><section><para>
en: If you find a new autogenerated patch file such as <filename>debian-changes-*</filename> in the <filename>debian/patches</filename> directory after building your non-native Debian package in <literal>3.0 (quilt)</literal> format, chances are you changed some files by accident or the build script modified the upstream source.  If it is your mistake, fix it.  If it is caused by the build script, fix the root cause with <command>dh-autoreconf</command> as in <xref linkend="customrules"/> or work around it with <filename>source/options</filename> as in <xref linkend="sourceopt"/>.
zh_CN: 如果你在构建以 <literal>3.0 (quilt)</literal> 格式的非本土 Debian 软件包后，发现一个新的自动生成的补丁，比如 <filename>debian-changes-*</filename> 在 <filename>debian/patches</filename> 目录中有可能是你不小心更改了一些文件，或者构建脚本修改了上游源代码。如果这是你犯下的小错误，那就修复它。如果这是构建脚本干的好事，那就用 <command>dh-autoreconf</command> 来解决其根本问题，可参照 <xref linkend="customrules"/> 或者可以变通一下， 处理 <filename>source/options</filename> 文件，参照 <xref linkend="sourceopt"/>.

note: type: Content of: <book><chapter><section><title>
en: Verifying a package's installation
zh_CN: 校验软件包安装过程

note: type: Content of: <book><chapter><section><para>
en: You must test your package for whether it installs without problems.  The <citerefentry> <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command helps you to test installing all the generated binary packages.
zh_CN: 你必须测试你的软件包看是否存在安装问题。<citerefentry> <refentrytitle>debi</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令可以帮助你测试所有生成的二进制软件包。

note: type: Content of: <book><chapter><section><para>
en: To prevent installation problems on different systems, you must make sure that there are no filenames conflicting with other existing packages, using the <filename>Contents-<replaceable>i386</replaceable></filename> file downloaded from the Debian archive.  The <command>apt-file</command> command may be handy for this task.  If there are collisions, please take action to avoid this real problem, whether by renaming the file, moving a common file to a separate package that multiple packages can depend on, using the alternatives mechanism (see <citerefentry><refentrytitle>update-alternatives</refentrytitle> <manvolnum>1</manvolnum></citerefentry>) in coordination with the maintainers of other affected packages, or declaring a <literal>Conflicts</literal> relationship in the <filename>debian/control</filename> file.
zh_CN: 你必须使用从 Debian 仓库下载的 <filename>Contents-<replaceable>i386</replaceable></filename> 文件校验是否在与不同包存在文件冲突，以阻止在不同的系统上发生安装故障。<command>apt-file</command> 命令正适合完成这个任务。如果存在冲突，请通过重命名、将公共文件分离到另一个受其他包依赖的包中、与受影响的软件包的维护者合作使用 alternatives 机制来避免实际问题(参看 <citerefentry> <refentrytitle>update-alternatives</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>)或在 <filename>debian/control</filename> 文件中设置 <literal>Conflicts</literal> 条目以声明冲突关系等方式避免问题的发生。

note: type: Content of: <book><chapter><section><title>
en: Verifying a package's maintainer scripts
zh_CN: 检验软件包的 maintainer scripts

note: type: Content of: <book><chapter><section><para>
en: All maintainer scripts (that is, <filename>preinst</filename>, <filename>prerm</filename>, <filename>postinst</filename>, and <filename>postrm</filename> files) are hard to write correctly unless they are auto-generated by the <systemitem role="package">debhelper</systemitem> programs.  So do not use them if you are a novice maintainer (see <xref linkend="maintscripts"/>).
zh_CN: 所有 maintainer scripts，包括 <filename>preinst</filename>、<filename>prerm</filename>、<filename>postinst</filename> 和 <filename>postrm</filename> 文件，都非常难以编写，除非是由 <systemitem role="package">debhelper</systemitem> 程序自动生成的。如果你是新维护人员则不要使用它们(参看 <xref linkend="maintscripts"/>)。

note: type: Content of: <book><chapter><section><para>
en: If the package makes use of these non-trivial maintainer scripts, be sure to test not only for install but also for remove, purge, and upgrade processes.  Many maintainer script bugs show up when packages are removed or purged.  Use the <command>dpkg</command> command as follows to test them:
zh_CN: 如果软件包使用了这些需要严格测试的 maintainer scripts，请确保不仅测试 install，还要测试 remove、purge 和 upgrade。很多 maintainer scripts 的 Bug 都显现于卸载或彻底删除软件包时。使用 <command>dpkg</command> 命令按以下方法来测试它们：

note: type: Content of: <book><chapter><section><para>
en: This should be done with sequences such as the following:
zh_CN: 整个测试过程应按照以下操作序列完成：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: install the previous version (if needed).
zh_CN: 如果可能，安装前一个版本的软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: upgrade it from the previous version.
zh_CN: 从前一个版本升级软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: downgrade it back to the previous version (optional).
zh_CN: 降级软件包到前一个版本(可选)；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: purge it.
zh_CN: 彻底删除该软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: install the new package.
zh_CN: 全新安装该软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: remove it.
zh_CN: 卸载该软件包；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: install it again.
zh_CN: 再次安装该软件包。

note: type: Content of: <book><chapter><section><para>
en: If this is your first package, you should create dummy packages with different versions to test your package in advance to prevent future problems.
zh_CN: 如果这是你的第一个软件包，你应该使用其他版本号创建一个测试用的软件包来完成升级测试，这样可以避免将来的问题。

note: type: Content of: <book><chapter><section><para>
en: Bear in mind that if your package has previously been released in Debian, people will often be upgrading to your package from the version that was in the last Debian release.  Remember to test upgrades from that version too.
zh_CN: 请牢记如果你的软件包已经在以往版本的 Debian 中发布，人们通常会从最近发布的 Debian 发布里的版本升级，所以也要测试从那个版本升级到当前的版本。

note: type: Content of: <book><chapter><section><para>
en: Although downgrading is not officially supported, supporting it is a friendly gesture.
zh_CN: 尽管降级没有被正式支持，支持它也总是友好的。

note: type: Content of: <book><chapter><section><title>
en: Using <systemitem role="package">lintian</systemitem>
zh_CN: 使用 <systemitem role="package">lintian</systemitem>

note: type: Content of: <book><chapter><section><para><footnote><para>
en: You do not need to provide the <command>lintian</command> option <literal>-i -I --show-overrides</literal> if you customized <filename>/etc/devscripts.conf</filename> or <filename>~/.devscripts</filename> as described in <xref linkend="debuild"/>.
zh_CN: 如果你按照 <xref linkend="debuild"/> 中的叙述定义了 <filename>/etc/devscripts.conf</filename> 或 <filename>~/.devscripts</filename> 文件，就不需要再添加 <command>lintian</command> 选项 <literal>-i -I --show-overrides</literal>。

note: type: Content of: <book><chapter><section><para>
en: Run <citerefentry> <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> on your <filename>.changes</filename> file.  The <command>lintian</command> command runs many test scripts to check for many common packaging errors.  <placeholder type="footnote" id="0"/>
zh_CN: 使用 <citerefentry> <refentrytitle>lintian</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 检查你的 <filename>.changes</filename> 文件。<command>lintian</command> 命令会运行很多测试脚本来检查常见的打包错误。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: Of course, replace the filename with the name of the <filename>.changes</filename> file generated for your package.  The output of the <command>lintian</command> command uses the following flags:
zh_CN: 当然，要替换你自己软件包所生成的 <filename>.changes</filename> 文件的文件名。<command>lintian</command> 命令的输出常带有以下几种标记：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>E:</literal> for error; a sure policy violation or packaging error.
zh_CN: <literal>E:</literal> 代表错误：确定违反了 Debian Policy 或是一个肯定的打包错误。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>W:</literal> for warning; a possible policy violation or packaging error.
zh_CN: <literal>W:</literal> 代表警告：可能违反了 Debian Policy 或是一个可能的打包错误。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>I:</literal> for info; information on certain aspects of packaging.
zh_CN: <literal>I:</literal> 代表信息：对于特定打包类别的信息。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>N:</literal> for note; a detailed message to help your debugging.
zh_CN: <literal>N:</literal> 代表注释：帮助你调试的详细信息。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>O:</literal> for overridden; a message overridden by the <filename>lintian-overrides</filename> files but displayed by the <literal>--show-overrides</literal> option.
zh_CN: <literal>O:</literal> 代表已覆盖：一个被 <filename>lintian-overrides</filename> 文件覆盖的信息，但由于使用 <literal>--show-overrides</literal> 选项而显示。

note: type: Content of: <book><chapter><section><para>
en: When you see warnings, tune the package to avoid them or verify that the warnings are spurious.  If spurious, set up <filename>lintian-overrides</filename> files as described in <xref linkend="lintian"/>.
zh_CN: 对于警告，你应该改进软件包或者检查警告是否的确无意义。如果确定没有意义，则按照 <xref linkend="lintian"/> 中的叙述使用 <filename>lintian-overrides</filename> 文件将其覆盖。

note: type: Content of: <book><chapter><section><para>
en: Note that you can build the package with <command>dpkg-buildpackage</command> and run <command>lintian</command> on it in one command, if you use <citerefentry> <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> or <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.
zh_CN: 注意，你可以用 <command>dpkg-buildpackage</command> 来构建软件包，并执行 <command>lintian</command>，只要你使用了 <citerefentry> <refentrytitle>debuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 或 <citerefentry> <refentrytitle>pdebuild</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.

note: type: Content of: <book><chapter><section><title>
en: The <command>debc</command> command
zh_CN: <command>debc</command> 命令

note: type: Content of: <book><chapter><section><para>
en: You can list files in the binary Debian package with the <citerefentry> <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command.
zh_CN: 你可以使用 <citerefentry> <refentrytitle>debc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令列出一个二进制 Debian 软件包中的文件。

note: type: Content of: <book><chapter><section><title>
en: The <command>debdiff</command> command
zh_CN: <command>debdiff</command> 命令

note: type: Content of: <book><chapter><section><para>
en: You can compare file contents in two source Debian packages with the <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command.
zh_CN: 你可以使用 <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令比较两个 Debian 源代码包的内容。

note: type: Content of: <book><chapter><section><para>
en: You can also compare file lists in two sets of binary Debian packages with the <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command.
zh_CN: 你还可以使用 <citerefentry> <refentrytitle>debdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令比较两个 Debian 二进制包的文件列表。

note: type: Content of: <book><chapter><section><para>
en: These are useful to identify what has been changed in the source packages and to check for inadvertent changes made when updating binary packages, such as unintentionally misplacing or removing files.
zh_CN: 这个命令对于检查源代码包中哪些文件被修改了非常有用，还可以发现二进制包中是否有文件在更新过程中发生的变动，比如被意外替换或删除。

note: type: Content of: <book><chapter><section><title>
en: The <command>interdiff</command> command
zh_CN: <command>interdiff</command> 命令

note: type: Content of: <book><chapter><section><para>
en: You can compare two <filename>diff.gz</filename> files with the <citerefentry> <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command.  This is useful for verifying that no inadvertent changes were made to the source by the maintainer when updating packages in the old <literal>1.0</literal> source format.
zh_CN: 你可以使用 <citerefentry> <refentrytitle>interdiff</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 命令比较两个 <filename>diff.gz</filename> 文件。这对于更新使用旧的 <literal>1.0</literal> 源代码格式的软件包时，检查是否有意外的变更非常有用。

note: type: Content of: <book><chapter><section><para>
en: The new <literal>3.0</literal> source format stores changes in multiple patch files as described in <xref linkend="patches"/>.  You can trace changes of each <filename>debian/patches/*</filename> file using <command>interdiff</command>, too.
zh_CN: 新的 <literal>3.0</literal> 源码格式会将更改保存在多个补丁文件中， 如 <xref linkend="patches"/> 所述。 你也可以使用 <command>interdiff</command> 跟踪 每一个 <filename>debian/patches/*</filename> 文件中的改动。

note: type: Content of: <book><chapter><section><title>
en: The <command>mc</command> command
zh_CN: <command>mc</command> 命令

note: type: Content of: <book><chapter><section><para>
en: Many of these file inspection operations can be made into an intuitive process by using a file manager like <citerefentry> <refentrytitle>mc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> which will let you browse not only the contents of <filename>*.deb</filename> package files but also <filename>*.udeb</filename>, <filename>*.debian.tar.gz</filename>, <filename>*.diff.gz</filename>, and <filename>*.orig.tar.gz</filename> files.
zh_CN: 很多文件检查操作可以通过使用类似 <citerefentry> <refentrytitle>mc</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 的文件管理器来完成，它可以帮助你直接查看 <filename>*.deb</filename> 文件的内容，除此之外还可以用于 <filename>*.udeb</filename>、<filename>*.debian.tar.gz</filename>、<filename>*.diff.gz</filename> 和 <filename>*.orig.tar.gz</filename> 文件。

note: type: Content of: <book><chapter><section><para>
en: Be on the lookout for extra unneeded files or zero length files, both in the binary and source package.  Often cruft doesn't get cleaned up properly; adjust your <filename>rules</filename> file to compensate for this.
zh_CN: 还要检查在二进制包和源代码包中是否有不需要的文件或者空文件。这些文件经常没有被正确清理，如果存在这种情况，要调整 <filename>rules</filename> 文件进行处理。

note: type: Content of: <book><chapter><title>
en: Updating the package
zh_CN: 更新软件包

note: type: Content of: <book><chapter><para>
en: After you release a package, you will soon need to update it.
zh_CN: 一旦你发布了一个软件包，在之后的某个时间里就需要对它进行更新。

note: type: Content of: <book><chapter><section><title>
en: New Debian revision
zh_CN: 新的 Debian 版本

note: type: Content of: <book><chapter><section><para>
en: Let's say that a bug report was filed against your package as <literal>#654321</literal>, and it describes a problem that you can solve.  Here's what you need to do to create a new Debian revision of the package:
zh_CN: 假设你收到一个针对你的软件包报告的 Bug ，其编号为 <literal>#654321</literal>，它描述了一个你可以解决的问题。要创建软件包的一个新 Debian 修订版本，你需要：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If this is to be recorded as a new patch, do the following:
zh_CN: 如果要将它记录于新的补丁中，这样做：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> to set the patch name;
zh_CN: <literal>dquilt new <replaceable>bugname.patch</replaceable></literal> 设置补丁名称；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt add <replaceable>buggy-file</replaceable></literal> to declare the file to be modified;
zh_CN: <literal>dquilt add <replaceable>buggy-file</replaceable></literal> 声明文件将被更改；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Correct the problem in the package source for the upstream bug;
zh_CN: 修正软件包代码中的上游 Bug；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt refresh</literal> to record it to <filename><replaceable>bugname.patch</replaceable></filename>;
zh_CN: <literal>dquilt refresh</literal> 将修改记录到 <filename><replaceable>bugname.patch</replaceable></filename>；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt header -e</literal> to add its description;
zh_CN: <literal>dquilt header -e</literal> 添加对它的描述；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If this is to update an existing patch, do the following:
zh_CN: 如果是更新一个已存在的补丁，这样做：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> to recall the existing <filename><replaceable>foo.patch</replaceable></filename>;
zh_CN: <literal>dquilt pop <replaceable>foo.patch</replaceable></literal> 重现已存在的 <filename><replaceable>foo.patch</replaceable></filename>；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Correct the problem in the old <filename><replaceable>foo.patch</replaceable></filename>;
zh_CN: 修正旧的 <filename><replaceable>foo.patch</replaceable></filename> 中的问题；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt refresh</literal> to update <filename><replaceable>foo.patch</replaceable></filename>;
zh_CN: <literal>dquilt refresh</literal> 更新 <filename><replaceable>foo.patch</replaceable></filename>；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt header -e</literal> to update its description;
zh_CN: <literal>dquilt header -e</literal> 更新对它的描述；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>while dquilt push; do dquilt refresh; done</literal> to apply all patches while removing <emphasis>fuzz</emphasis>;
zh_CN: <literal>while dquilt push; do dquilt refresh; done</literal> 应用所有补丁以确保它们 <emphasis>边界清晰</emphasis>；

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: To get the date in the required format, use <literal>LANG=C date -R</literal>.
zh_CN: 要获得需要的日期格式，使用 <literal>LANG=C date -R</literal>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Add a new revision at the top of the Debian <filename>changelog</filename> file, for example with <literal>dch -i</literal>, or explicitly with <literal>dch -v <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal> and then insert the comments using your preferred editor.  <placeholder type="footnote" id="0"/>
zh_CN: 在 Debian <filename>changelog</filename> 文件的顶部添加一个条目。例如可以使用 <literal>dch -i</literal> 或用 <literal>dch -v <replaceable>version</replaceable>-<replaceable>revision</replaceable></literal> 来指定版本，然后用你喜欢的编辑器插入信息。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Include a short description of the bug and the solution in the changelog entry, followed by <literal>Closes: #654321</literal>.  That way, the bug report will be <emphasis>automagically</emphasis> closed by the archive maintenance software the moment your package gets accepted into the Debian archive.
zh_CN: 在 changlog 条目中简要描述 Bug 和相应的解决办法，并在后面添加 <literal>Closes: #654321</literal>。这样 Bug 报告会在你的软件包被 Debian 仓库接受的同时被仓库管理软件 <emphasis>自动关闭</emphasis>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Repeat what you did in the above to fix more bugs while updating the Debian <filename>changelog</filename> file with <literal>dch</literal> as needed.
zh_CN: 重复上述操作来修复更多的 Bug，并在需要的时候使用 <literal>dch</literal> 更新 Debian <filename>changelog</filename> 文件。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Repeat what you did in <xref linkend="completebuild"/> and <xref linkend="checkit"/>.
zh_CN: 重复你在 <xref linkend="completebuild"/> 和 <xref linkend="checkit"/> 中所做的事情。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Once you are satisfied, you should change the distribution value in <filename>changelog</filename> from <literal>UNRELEASED</literal> to the target distribution value <literal>unstable</literal> (or even <literal>experimental</literal>).<placeholder type="footnote" id="0"/>
zh_CN: 一旦你满意了，那就将 <filename>changelog</filename> 中的发行版值由 <literal>UNRELEASED</literal> 修改成 目标发行版值 <literal>unstable</literal> (或者是 <literal>experimental</literal>)。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Upload the package as in <xref linkend="upload"/>.  The difference is that this time, the original source archive won't be included, as it hasn't been changed and it already exists in the Debian archive.
zh_CN: 按照 <xref linkend="upload"/> 来上传软件包。惟一的区别是这次不需要再包含原始代码文件，因为它们没有变化且已经存在于 Debian 仓库中。

note: type: Content of: <book><chapter><section><para>
en: One tricky case can occur when you make a local package, to experiment with the packaging before uploading the normal version to the official archive, e.g., <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>.  For smoother upgrades, it is a good idea to create a <filename>changelog</filename> entry with a version string such as <literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal>.  You may unclutter <filename>changelog</filename> by consolidating such local change entries into a single entry for the official package.  See <xref linkend="namever"/> for the order of version strings.
zh_CN: 有一种棘手的情况，当你在上传正常版本到官方仓库中之前，你制作了一个本地包以进行打包实验，例如, <literal><replaceable>1.0.1</replaceable>-<replaceable>1</replaceable></literal>。 为了平滑升级，创建一个 <filename>changelog</filename> 条目，其中包含类似<literal><replaceable>1.0.1</replaceable>-<replaceable>1~rc1</replaceable></literal> 这样的版本字符串不失为一剂良方。  你可以通过合并这样的本地修改条目到官方包的单个条目中来整理 <filename>changelog</filename>。 参见 <xref linkend="namever"/> 来了解版本字符串的排序。

note: type: Content of: <book><chapter><section><title>
en: Inspection of the new upstream release
zh_CN: 检查新上游版本

note: type: Content of: <book><chapter><section><para>
en: When preparing packages of a new upstream release for the Debian archive, you must check the new upstream release first.
zh_CN: 在为 Debian 仓库准备新上游版本的软件包前，你必须首先对新的上游发布版本进行检查。

note: type: Content of: <book><chapter><section><para>
en: Start by reading the upstream <filename>changelog</filename>, <filename>NEWS</filename>, and whatever other documentation they may have released with the new version.
zh_CN: 检查工作应从阅读上游 <filename>changelog</filename>、<filename>NEWS</filename> 以及所有随新版本一同发布的文档。

note: type: Content of: <book><chapter><section><para>
en: You can then inspect changes between the old and new upstream sources as follows, watching out for anything suspicious:
zh_CN: 然后应按照以下步骤检查新旧版本之间源码的差别，小心任何可疑的内容：

note: type: Content of: <book><chapter><section><para>
en: Changes to some auto-generated files by Autotools such as <filename>missing</filename>, <filename>aclocal.m4</filename>, <filename>config.guess</filename>, <filename>config.h.in</filename>, <filename>config.sub</filename>, <filename>configure</filename>, <filename>depcomp</filename>, <filename>install-sh</filename>, <filename>ltmain.sh</filename>, and <filename>Makefile.in</filename> may be ignored.  You may delete them before running <command>diff</command> on the source for inspection.
zh_CN: 对于 Autotools 自动生成的文件发生的改动，例如 <filename>missing</filename>、<filename>aclocal.m4</filename>、<filename>config.guess</filename>、<filename>config.h.in</filename>、<filename>config.sub</filename>、<filename>configure</filename>、<filename>depcomp</filename>、<filename>install-sh</filename>、<filename>ltmain.sh</filename> 和 <filename>Makefile.in</filename> 是可以忽略的。你可以在运行 <command>diff</command> 进行代码检查前删除它们。

note: type: Content of: <book><chapter><section><title>
en: New upstream release
zh_CN: 新上游版本

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If a package <systemitem role="package"><replaceable>foo</replaceable></systemitem> is packaged in the old <literal>1.0</literal> format, this can be done by running <literal>zcat /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.diff.gz|patch -p1</literal> in the new extracted source, instead.
zh_CN: 如果软件包 <systemitem role="package"><replaceable>foo</replaceable></systemitem> 是使用旧的 <literal>1.0</literal> 格式的，可以在新解压的源代码目录里运行 <literal>zcat /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.diff.gz|patch -p1</literal> 来完成。

note: type: Content of: <book><chapter><section><para>
en: If a package <systemitem role="package"><replaceable>foo</replaceable></systemitem> is properly packaged in the newer <literal>3.0 (native)</literal> or <literal>3.0 (quilt)</literal> formats, packaging a new upstream version is essentially moving the old <filename>debian</filename> directory to the new source.  This can be done by running <literal>tar xvzf /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.debian.tar.gz</literal> in the new extracted source.  <placeholder type="footnote" id="0"/> Of course, you need to do some obvious chores:
zh_CN: 如果软件包 <systemitem role="package"><replaceable>foo</replaceable></systemitem> 是使用新的 <literal>3.0 (native)</literal> 或 <literal>3.0 (quilt)</literal> 格式打包的，制作新的上游版本时需要先把旧的 <filename>debian</filename> 目录移至新的源代码内。这可以通过在新解压的源代码目录里运行 <literal>tar xvzf /<replaceable>path</replaceable>/<replaceable>to</replaceable>/<replaceable>foo</replaceable>_<replaceable>oldversion</replaceable>.debian.tar.gz</literal> 完成。<placeholder type="footnote" id="0"/>当然，你需要做几个很显然的杂事：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Create a copy of the upstream source as the <filename>foo_<replaceable>newversion</replaceable>.orig.tar.gz</filename> file.
zh_CN: 创建一份上游源代码的副本，命名为 <filename>foo_<replaceable>newversion</replaceable>.orig.tar.gz</filename>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Update the Debian <filename>changelog</filename> file with <literal>dch -v <replaceable>newversion</replaceable>-<replaceable>1</replaceable></literal>.
zh_CN: 使用 <literal>dch -v <replaceable>newversion</replaceable>-<replaceable>1</replaceable></literal> 更新 Debian <filename>changelog</filename> 文件。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Add an entry with <literal>New upstream release</literal>.
zh_CN: 添加一个条目，内容为 <literal>New upstream release</literal>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Describe concisely the changes <emphasis>in the new upstream release</emphasis> that fix reported bugs and close those bugs by adding <literal>Closes: #<replaceable>bug_number</replaceable></literal>.
zh_CN: 简明地介绍 <emphasis>在新上游版本中</emphasis> 上游修复和关闭的 Bug (添加 <literal>Closes: #<replaceable>bug_number</replaceable></literal>) 。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Describe concisely the changes <emphasis>to the new upstream release</emphasis> by the maintainer that fix reported bugs and close those bugs by adding <literal>Closes: #<replaceable>bug_number</replaceable></literal>.
zh_CN: 简明地介绍维护者对 <emphasis>本个新上游版本</emphasis> 做出的修改，修复和关闭的 Bug (添加 <literal>Closes: #<replaceable>bug_number</replaceable></literal>)。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: <literal>while dquilt push; do dquilt refresh; done</literal> to apply all patches while removing <emphasis>fuzz</emphasis>.
zh_CN: 运行 <literal>while dquilt push; do dquilt refresh; done</literal> 以应用全部补丁并使它们 <emphasis>边界清晰</emphasis>。

note: type: Content of: <book><chapter><section><para>
en: If the patch/merge did not apply cleanly, inspect the situation (clues are left in <filename>.rej</filename> files).
zh_CN: 如果补丁没有干净地被应用，检查原因(线索在 <filename>.rej</filename> 文件里)。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If a patch you applied to the source was integrated into the upstream source,
zh_CN: 如果你的补丁已经被上游接受，

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt delete</literal> to remove it.
zh_CN: 使用 <literal>dquilt delete</literal> 删除它。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If a patch you applied to the source conflicted with new changes in the upstream source,
zh_CN: 如果你的补丁与上游代码中的变更有冲突：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt push -f</literal> to apply old patches while forcing rejects as <filename><replaceable>baz</replaceable>.rej</filename>.
zh_CN: 使用 <literal>dquilt push -f</literal> 应用旧补丁，未应用的部分会被保存为 <filename><replaceable>baz</replaceable>.rej</filename>。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Edit the <filename><replaceable>baz</replaceable></filename> file manually to bring about the intended effect of <filename><replaceable>baz</replaceable>.rej</filename>.
zh_CN: 手工编辑 <filename><replaceable>baz</replaceable></filename> 文件来在新的代码中实现 <filename><replaceable>baz</replaceable>.rej</filename> 中应有的效果。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: <literal>dquilt refresh</literal> to update the patch.
zh_CN: 使用 <literal>dquilt refresh</literal> 更新补丁。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Continue as usual with <literal>while dquilt push; do dquilt refresh; done</literal>.
zh_CN: 正常继续，执行 <literal>while dquilt push; do dquilt refresh; done</literal>。

note: type: Content of: <book><chapter><section><para>
en: This process can be automated using the <citerefentry> <refentrytitle>uupdate</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> command as follows:
zh_CN: 这个过程可以通过使用 <citerefentry> <refentrytitle>uupdate</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来更自动化地完成：

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If the <command>uscan</command> command downloads the updated source but it does not run the <command>uupdate</command> command, you should correct the <filename>debian/watch</filename> file to have <literal>debian uupdate</literal> at the end of the URL.
zh_CN: 如果 <command>uscan</command> 命令下载并更新了源代码，但没有运行 <command>uupdate</command> 命令，你应该修正 <filename>debian/watch</filename> 文件，使 URL 末尾后带有 <literal>debian uupdate</literal>。

note: type: Content of: <book><chapter><section><para>
en: If you set up a <filename>debian/watch</filename> file as described in <xref linkend="watch"/>, you can skip the <command>wget</command> command.  You simply run <citerefentry> <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> in the <filename><replaceable>foo</replaceable>-<replaceable>oldversion</replaceable></filename> directory instead of the <command>uupdate</command> command.  This will <emphasis>automagically</emphasis> look for the updated source, download it, and run the <command>uupdate</command> command.  <placeholder type="footnote" id="0"/>
zh_CN: 如果你按照 <xref linkend="watch"/> 的叙述设置了 <filename>debian/watch</filename> 文件，你可以跳过这个 <command>wget</command> 命令，转而在 <filename><replaceable>foo</replaceable>-<replaceable>oldversion</replaceable></filename> 目录中运行 <citerefentry> <refentrytitle>uscan</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>，且无需再执行 <command>uupdate</command> 命令。它会 <emphasis>自动</emphasis> 查找新的源代码、下载并运行 <command>uupdate</command> 命令。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: You can release this updated source by repeating what you did in <xref linkend="completebuild"/>, <xref linkend="checkit"/>, and <xref linkend="upload"/>.
zh_CN: 重复 <xref linkend="completebuild"/> 、<xref linkend="checkit"/> 和 <xref linkend="upload"/> 中的操作，即可发布此更新的软件包。

note: type: Content of: <book><chapter><section><title>
en: Updating the packaging style
zh_CN: 更新打包风格

note: type: Content of: <book><chapter><section><para><footnote><para>
en: If your sponsor or other maintainers object to updating the existing packaging style, don't bother arguing.  There are more important things to do.
zh_CN: 如果你的 sponsor 或其他维护者一定反对更新已有的打包风格，则不值得去为此烦恼或争论，总是有更重要的事要做。

note: type: Content of: <book><chapter><section><para>
en: Updating the package style is not a required activity for the update of a package.  However, doing so lets you use the full capabilities of the modern <systemitem role="package">debhelper</systemitem> system and the <literal>3.0</literal> source format.  <placeholder type="footnote" id="0"/>
zh_CN: 更新打包风格不是更新软件包的必须步骤，但是这样可以使你的软件包得到对现代的 <systemitem role="package">debhelper</systemitem> 系统和 <literal>3.0</literal> 源代码包格式完整的兼容性。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If you need to recreate deleted template files for any reason, you can run <command>dh_make</command> again in the same Debian package source tree with the <literal>--addmissing</literal> option.  Then edit them appropriately.
zh_CN: 如果你需要重新添加已删除的模板文件，可以在同一个 debian 软件包源代码树中运行 <command>dh_make</command>，并添加 <literal>--addmissing</literal> 选项。然后对模板进行相应的编辑。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If the package has not been updated to use the <systemitem role="package">debhelper</systemitem> v7+ <command>dh</command> syntax for the <filename>debian/rules</filename> file, update it to use <command>dh</command>.  Update the <filename>debian/control</filename> file accordingly.
zh_CN: 如果软件包的 <filename>debian/rules</filename> 文件没有更新为使用 <systemitem role="package">debhelper</systemitem> v7+ 的 <command>dh</command> 语法，则更新它使用 <command>dh</command>。在需要的时候更新 <filename>debian/control</filename> 文件。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If you want to update the <filename>rules</filename> file created with the <filename>Makefile</filename> inclusion mechanism of the Common Debian Build System (<systemitem role="package">cdbs</systemitem>) to the <command>dh</command> syntax, see the following to understand its <literal>DEB_*</literal> configuration variables.
zh_CN: 如果你希望将使用 <systemitem role="package">cdbs</systemitem> 的 <filename>Makefile</filename> 包含机制创建的 <filename>rules</filename> 文件更新为 <command>dh</command> 语法，参看下文并理解各 <literal>DEB_*</literal> 配置变量。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: local copy of <filename>&cdbs-doc;</filename>
zh_CN: <filename>&cdbs-doc;</filename> 的本地副本

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If you have a <literal>1.0</literal> source package without the <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can update it to the newer <literal>3.0 (native)</literal> source format by creating <filename>debian/source/format</filename> with <literal>3.0 (native)</literal>.  The rest of the <filename>debian/*</filename> files can just be copied.
zh_CN: 如果你有一个不带有 <filename><replaceable>foo</replaceable>.diff.gz</filename> 文件的 <literal>1.0</literal> 格式的源代码包，你可以通过创建 <filename>debian/source/format</filename> 文件并在其中添加 <literal>3.0 (native)</literal> 来将其更新为新的 <literal>3.0 (native)</literal> 源代码包格式。<filename>debian</filename> 目录中的其他文件可以直接复制过来。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para><footnote><para>
en: You can split <filename>big.diff</filename> into many small incremental patches using the <command>splitdiff</command> command.
zh_CN: 你可能使用 <command>splitdiff</command> 命令将 <filename>big.diff</filename> 分割为多个增量补丁。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If you have a <literal>1.0</literal> source package with the <filename><replaceable>foo</replaceable>.diff.gz</filename> file, you can update it to the newer <literal>3.0 (quilt)</literal> source format by creating <filename>debian/source/format</filename> with <literal>3.0 (quilt)</literal>.  The rest of the <filename>debian/*</filename> files can just be copied.  Import the <filename>big.diff</filename> file generated by the command <literal>filterdiff -z -x '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal> to your <command>quilt</command> system, if needed.  <placeholder type="footnote" id="0"/>
zh_CN: 如果你有一个带有 <filename><replaceable>foo</replaceable>.diff.gz</filename> 文件的 <literal>1.0</literal> 格式的源代码包，你可以通过创建 <filename>debian/source/format</filename> 文件并在其中添加 <literal>3.0 (quilt)</literal> 来将其更新为新的 <literal>3.0 (quilt)</literal> 源代码包格式。<filename>debian</filename> 目录中的其他文件可以直接复制过来。如果需要，把 <literal>filterdiff -z -x '*/debian/*' <replaceable>foo</replaceable>.diff.gz &gt; big.diff</literal> 生成的 <filename>big.diff</filename> 文件导入到 <command>quilt</command> 系统。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If it was packaged using another patch system such as <systemitem role="package">dpatch</systemitem>, <systemitem role="package">dbs</systemitem>, or <systemitem role="package">cdbs</systemitem> with <literal>-p0</literal>, <literal>-p1</literal>, or <literal>-p2</literal>, convert it to <systemitem role="package">quilt</systemitem> using <filename>deb3</filename> at <ulink url="&deb3;"/>.
zh_CN: 如果它使用了其他的补丁系统，例如 <systemitem role="package">dpatch</systemitem>、<systemitem role="package">dbs</systemitem> 或 <systemitem role="package">cdbs</systemitem>，使用 <literal>-p0</literal>、<literal>-p1</literal> 或 <literal>-p2</literal> 级别，使用 <ulink url="&deb3;">&deb3;</ulink> 的 <filename>deb3</filename> 命令将其转换到 <systemitem role="package">quilt</systemitem> 系统。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If it was packaged with the <command>dh</command> command with the <literal>--with quilt</literal> option or with the <command>dh_quilt_patch</command> and <command>dh_quilt_unpatch</command> commands, remove these and make it use the newer <literal>3.0 (quilt)</literal> source format.
zh_CN: 如果它使用 <command>dh</command> 命令的 <literal>--with quilt</literal> 选项，或 <command>dh_quilt_patch</command> 和 <command>dh_quilt_unpatch</command> 命令，删除它们并使其使用新的 <literal>3.0 (native)</literal> 源代码包格式。

note: type: Content of: <book><chapter><section><para>
en: You should check <ulink url="&dep;">DEP - Debian Enhancement Proposals</ulink> and adopt ACCEPTED proposals.
zh_CN: 你应当查看 <ulink url="&dep;">DEP - Debian Enhancement Proposals</ulink> 并采纳 ACCEPTED 建议。

note: type: Content of: <book><chapter><section><para>
en: You need to do the other tasks described in <xref linkend="newupstream"/>, too.
zh_CN: 当然你还需要按照 <xref linkend="newupstream"/> 完成其他的步骤。

note: type: Content of: <book><chapter><section><title>
en: UTF-8 conversion
zh_CN: UTF-8 转换

note: type: Content of: <book><chapter><section><para>
en: If upstream documents are encoded in old encoding schemes, converting them to <ulink url="&utf8;">UTF-8</ulink> is a good idea.
zh_CN: 如果上游文档采用了老式编码，那么将其转换为 <ulink url="&utf8;">UTF-8</ulink> 不失为一良方。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Use <citerefentry> <refentrytitle>iconv</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> to convert encodings of plain text files.
zh_CN: 用 <citerefentry> <refentrytitle>iconv</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来转换普通文本文件的编码。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Use <citerefentry> <refentrytitle>w3m</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> to convert from HTML files to UTF-8 plain text files.  When you do this, make sure to execute it under UTF-8 locale.
zh_CN: 使用 <citerefentry> <refentrytitle>w3m</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 来把 HTML 文件转换为 UTF-8 普通文本文件。 当你这样做的时候，请确认在 UTF-8 locale 下执行。

note: type: Content of: <book><chapter><section><title>
en: Reminders for updating packages
zh_CN: 对更新软件包的几点提示

note: type: Content of: <book><chapter><section><para>
en: Here are a few reminders for updating packages:
zh_CN: 以下是对更新软件包的几点提示：

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Preserve old <filename>changelog</filename> entries (sounds obvious, but there have been cases of people typing <literal>dch</literal> when they should have typed <literal>dch -i</literal>.)
zh_CN: 保留旧的 <filename>changelog</filename> 条目(看似显然，但是总有可能把 <literal>dch -i</literal> 输入为 <literal>dch</literal>)。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Existing Debian changes need to be reevaluated; throw away stuff that upstream has incorporated (in one form or another) and remember to keep stuff that hasn't been incorporated by upstream, unless there is a compelling reason not to.
zh_CN: 已存在的 debian 修改需要被重新校验，去除上游已经合并的东西 (一种或多种形式)，除非有必要的原因，还要保留尚未被上游接受的部分。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: If any changes were made to the build system (hopefully you'd know from inspecting upstream changes) then update the <filename>debian/rules</filename> and <filename>debian/control</filename> build dependencies if necessary.
zh_CN: 如果对编译系统作出了修改(希望你已经在检查上游变更时了解了这些)，那么要在必要时更新 <filename>debian/rules</filename> 和 <filename>debian/control</filename> 编译依赖关系。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Check the <ulink url="&bts;">Debian Bug Tracking System (BTS)</ulink> to see if someone has provided patches to bugs that are currently open.
zh_CN: 检查 <ulink url="&bts;">Debian Bug Tracking System (BTS)</ulink> 是否有人为某些仍然未修复的 bug 提供了补丁。

note: type: Content of: <book><chapter><section><itemizedlist><listitem><para>
en: Check the contents of the <filename>.changes</filename> file to make sure you are uploading to the correct distribution, the proper bug closures are listed in the <literal>Closes</literal> field, the <literal>Maintainer</literal> and <literal>Changed-By</literal> fields match, the file is GPG-signed, etc.
zh_CN: 检查 <filename>.changes</filename> 文件以确保你正要上传到正确的发行版、正确的列出BUG关闭 <literal>Closes</literal> 字段、<literal>Maintainer</literal> 和 <literal>Changed-By</literal> 字段相匹配，以及文件是否已经使用 GPG 签署等。

note: type: Content of: <book><chapter><title>
en: Uploading the package
zh_CN: 上传软件包

note: type: Content of: <book><chapter><para>
en: Now that you have tested your new package thoroughly, you want to release it to a public archive to share it.
zh_CN: 现在你完成了对软件包的彻底测试，接下来将其释出到公共归档中分享它吧。

note: type: Content of: <book><chapter><section><title>
en: Uploading to the Debian archive
zh_CN: 上传到 Debian 仓库

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <xref linkend="socialdynamics"/>.
zh_CN: 参见 <xref linkend="socialdynamics"/>。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: There are publicly accessible archives such as <ulink url="&mentors-dn;"/> which work almost the same way as the Debian archive and provide an upload area for non-DDs.  You can set up an equivalent archive by yourself using the tools listed at <ulink url="&deb-archive;"/>.  So this section is useful for non-DDs, too.
zh_CN: 有许多公开的档案比如 <ulink url="&mentors-dn;"/> ，它们的运作方式几乎与 Debian 档案一致，并提供了一个非开发者的上传区域。你可以自己建立一个等效档案，只要使用 <ulink url="&deb-archive;"/> 里边列举出来的工具。  所以这一小节也对非开发者特别有用。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: The <systemitem role="package">dput</systemitem> package seems to come with more features and to be becoming more popular than the <systemitem role="package">dupload</systemitem> package.  It uses the file <filename>/etc/dput</filename> for its global configuration and the file <filename>~/.dput.cf</filename> for per-user configuration.  It supports Ubuntu-related services out-of-the-box, too.
zh_CN: <systemitem role="package">dput</systemitem> 软件包提供了更多的特性，相比于 <systemitem role="package">dupload</systemitem> 也越来越受欢迎。它使用 <filename>/etc/dput</filename> 文件作为全局配置文件、<filename>~/.dput.cf</filename> 作为用户配置文件。它也直接支持 ubuntu 相关的服务。

note: type: Content of: <book><chapter><section><para>
en: Once you become an official developer, <placeholder type="footnote" id="0"/> you can upload the package to the Debian archive.  <placeholder type="footnote" id="1"/> You can do this manually, but it's easier to use the existing automated tools, like <citerefentry> <refentrytitle>dupload</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> or <citerefentry> <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry>.  We'll describe how it's done with <command>dupload</command>.  <placeholder type="footnote" id="2"/>
zh_CN: 当你成为正式的开发人员<placeholder type="footnote" id="0"/>，你可以把软件包上传到 Debian 仓库<placeholder type="footnote" id="1"/>。你可以手工进行这项工作，但使用例如 <citerefentry> <refentrytitle>dupload</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 或 <citerefentry> <refentrytitle>dput</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 的自动化工具可以帮你更好地完成这项操作。在此我们将叙述如何使用 <command>dupload</command> 操作。<placeholder type="footnote" id="2"/>

note: type: Content of: <book><chapter><section><para>
en: First you have to set up <command>dupload</command>'s config file.  You can either edit the system-wide <filename>/etc/dupload.conf</filename> file, or have your own <filename>~/.dupload.conf</filename> file override the few things you want to change.
zh_CN: 首先需要设置 <command>dupload</command> 的配置文件。你既可以编辑系统级的 <filename>/etc/dupload.conf</filename> 文件，也可以使用自己的 <filename>~/.dupload.conf</filename> 文件凌驾一些需要修改的设置。

note: type: Content of: <book><chapter><section><para>
en: You can read the <citerefentry> <refentrytitle>dupload.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> manual page to understand what each of these options means.
zh_CN: 你可以阅读 <citerefentry> <refentrytitle>dupload.conf</refentrytitle> <manvolnum>5</manvolnum> </citerefentry> man 手册页来了解各选项的含义。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&devref-upload;">Debian Developer's Reference 5.6, "Uploading a package"</ulink>.
zh_CN: 参见 <ulink url="&devref-upload;">Debian Developer's Reference 5.6. "Uploading a package"</ulink>.

note: type: Content of: <book><chapter><section><para>
en: The <literal>$default_host</literal> option determines which of the upload queues will be used by default.  <literal>anonymous-ftp-master</literal> is the primary one, but it's possible that you will want to use another one.  <placeholder type="footnote" id="0"/>
zh_CN: <literal>$default_host</literal> 选项决定了默认使用哪个上传队列，<literal>anonymous-ftp-master</literal> 是最基本的一个，但你很可能希望改用其他的。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><chapter><section><para>
en: While connected to the Internet, you can upload your package as follows:
zh_CN: 连接到互联网后，可以使用以下命令上传你的软件包：

note: type: Content of: <book><chapter><section><para>
en: <command>dupload</command> checks that the SHA1/SHA256 file checksums match those listed in the <filename>.changes</filename> file.  If they do not match, it will warn you to rebuild it as described in <xref linkend="completebuild"/> so it can be properly uploaded.
zh_CN: <command>dupload</command> 会检查文件的 SHA1/SHA256 校验和是否与 <filename>.changes</filename> 文件中的相匹配，如果不匹配它会做出警告。你应按照如 <xref linkend="completebuild"/> 所述来重构建软件包使得它可以被正常上传。

note: type: Content of: <book><chapter><section><para><footnote><para>
en: See <ulink url="&uploadqueue-readme;"/>.  Alternatively, you can use the <command>dcut</command> command from the <systemitem role="package">dput</systemitem> package.
zh_CN: 参见 <ulink url="&uploadqueue-readme;"/>。 或者是， 你可以使用 <command>dcut</command> 命令，它来自 <systemitem role="package">dput</systemitem> 软件包。

note: type: Content of: <book><chapter><section><para>
en: If you encounter an upload problem at <ulink url="&uploadqueue;"/>, you can fix this by manually uploading a GPG-signed <filename>*.commands</filename> file to there with <command>ftp</command>.  <placeholder type="footnote" id="0"/> For example, using <filename>hello.commands</filename>:
zh_CN: 如果你在 <ulink url="&uploadqueue;"/> 遇到了上传问题，你可以通过 <command>ftp</command> 来手动上传 GPG 签署的 <filename>*.commands</filename> 文件。  <placeholder type="footnote" id="0"/> 比如说，使用 <filename>hello.commands</filename> 命令：

note: type: Content of: <book><chapter><section><title>
en: Including <filename>orig.tar.gz</filename> for upload
zh_CN: 在上传时包含 <filename>orig.tar.gz</filename> 文件

note: type: Content of: <book><chapter><section><para>
en: When you first upload the package to the archive, you need to include the original <filename>orig.tar.gz</filename> source, too.  If the Debian revision number of this package is neither <literal>1</literal> nor <literal>0</literal>, you must provide the <command>dpkg-buildpackage</command> option <literal>-sa</literal>.
zh_CN: 第一次向仓库上传软件包时要包含 <filename>orig.tar.gz</filename> 源代码归档。如果这个软件包的修订号既不是  <literal>1</literal> 也不是 <literal>0</literal>, 那你就必须给 <command>dpkg-buildpackage</command> 加上选项 <literal>-sa</literal>。

note: type: Content of: <book><chapter><section><para>
en: For the <command>dpkg-buildpackage</command> command:
zh_CN: 对于 <command>dpkg-buildpackage</command> 命令：

note: type: Content of: <book><chapter><section><para>
en: For the <command>debuild</command> command:
zh_CN: 对于 <command>debuild</command> 命令：

note: type: Content of: <book><chapter><section><para>
en: For the <command>pdebuild</command> command:
zh_CN: 对于 <command>pdebuild</command> 命令：

note: type: Content of: <book><chapter><section><para>
en: On the other hand, the <literal>-sd</literal> option will force the exclusion of the original <filename>orig.tar.gz</filename> source.
zh_CN: 另一方面，请注意 <literal>-sd</literal> 选项会强制 排除原始的 <filename>orig.tar.gz</filename> 源代码。

note: type: Content of: <book><chapter><section><title>
en: Skipped uploads
zh_CN: 跳过的上传

note: type: Content of: <book><chapter><section><para>
en: If you created multiple entries in <filename>debian/changelog</filename> by skipping uploads, you must create a proper <filename>*_.changes</filename> file that includes all changes since the last upload.  This can be done by specifying the <command>dpkg-buildpackage</command> option <literal>-v</literal> with the version, e.g., <literal><replaceable>1.2</replaceable></literal>.
zh_CN: 如果你在 <filename>debian/changelog</filename> 创建了多个条目并跳过了上传，你必须创建一个相应的 <filename>*_.changes</filename> 文件，其中包含自上次上传以来的全部变更记录。这可以通过指定 <command>dpkg-buildpackage</command> 的 <literal>-v</literal> 并将版本传递给它来完成。比如， <literal><replaceable>1.2</replaceable></literal>.

note: type: Content of: <book><appendix><title>
en: Advanced packaging
zh_CN: 高级打包

note: type: Content of: <book><appendix><para>
en: Here are some hints and pointers for advanced packaging topics that you are most likely to deal with.  You are strongly advised to read all the references suggested here.
zh_CN: 这里有一些关于你可能遇到的高级打包问题的提示。如果有需要的话，本教程强烈建议阅读这里引用和建议的文档。

note: type: Content of: <book><appendix><para>
en: You may need to manually edit the packaging template files generated by the <command>dh_make</command> command to address topics covered in this chapter.  The newer <command>debmake</command> command should address these topics better.
zh_CN: 你可能需要手工编辑由 <command>dh_make</command> 命令生成的打包模板文件，以此来解决本章中所讨论的问题。 新的 <command>debmake</command> 命令应该能更好地解决这些问题。

note: type: Content of: <book><appendix><section><title>
en: Shared libraries
zh_CN: 共享库

note: type: Content of: <book><appendix><section><para>
en: Before packaging shared <ulink url="&library;">libraries</ulink>, you should read the following primary references in detail:
zh_CN: 在打包 <ulink url="&library;">共享库</ulink> 之前，你 应该阅读以下的主要参考资料：

note: type: Content of: <book><appendix><section><para>
en: Here are some oversimplified hints for you to get started:
zh_CN: 以下是帮助你开始的极简解释：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Shared libraries are <ulink url="&elf;">ELF</ulink> object files containing compiled code.
zh_CN: 共享库均为 <ulink url="&elf;">elf</ulink> 对象文件，其包含编译好的机器码。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Shared libraries are distributed as <filename>*.so</filename> files. (Neither <filename>*.a</filename> files nor <filename>*.la</filename> files)
zh_CN: 共享库以 <filename>*.so</filename> 文件的形式发放。(既非 <filename>*.a</filename> 文件也非 <filename>*.la</filename> 文件)

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Shared libraries are mainly used to share common codes among multiple executables with the <command>ld</command> mechanism.
zh_CN: 共享库主要用于在不同的二进制可执行程序之间共享代码，这背后使用了 <command>ld</command> （译注：链接）机制。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Shared libraries are sometimes used to provide multiple plugins to an executable with the <command>dlopen</command> mechanism.
zh_CN: 共享库有时会为一个可执行程序提供多个插件，这背后使用了 <command>dlopen</command> 机制。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Shared libraries export <ulink url="&symbol;">symbols</ulink>, which represent compiled objects such as variables, functions, and classes; and enable access to them from the linked executables.
zh_CN: 共享库能导出代表着变量，函数和类的 <ulink url="&symbol;">symbols</ulink>（符号）；并允许链接到它的可执行文件访问之。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: Alternatively: <literal>readelf -d lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep SONAME</literal>
zh_CN: 或者这样： <literal>readelf -d lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep SONAME</literal>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: The <ulink url="&soname;">SONAME</ulink> of a shared library <filename>lib<replaceable>foo</replaceable>.so</filename>.<replaceable>1</replaceable>: <literal>objdump -p lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep SONAME</literal> <placeholder type="footnote" id="0"/>
zh_CN: 共享库 <filename>lib<replaceable>foo</replaceable>.so</filename>.<replaceable>1</replaceable> 中的 <ulink url="&soname;">SONAME</ulink> : <literal>objdump -p lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep SONAME</literal> <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: The SONAME of a shared library usually matches the library file name (but not always).
zh_CN: 共享库的 SONAME 常常与库文件自身文件名一致(不过有特例)。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: Alternatively: <literal>readelf -d lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep NEEDED</literal>
zh_CN: 或者这样： <literal>readelf -d lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable> | grep NEEDED</literal>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: The SONAME of shared libraries linked to <filename><replaceable>/usr/bin/foo</replaceable></filename>: <literal>objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED</literal> <placeholder type="footnote" id="0"/>
zh_CN: 链接到 <filename><replaceable>/usr/bin/foo</replaceable></filename> 的共享库的 SONAME ： <literal>objdump -p <replaceable>/usr/bin/foo</replaceable> | grep NEEDED</literal> <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&policy-runtime;">Debian Policy Manual, 8.1 "Run-time shared libraries"</ulink>.
zh_CN: 参见 <ulink url="&policy-runtime;">Debian Policy Manual, 8.1 "Run-time shared libraries"</ulink>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable></systemitem>: the library package for the shared library <filename>lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable></filename> with the SONAME ABI version <replaceable>1</replaceable>.<placeholder type="footnote" id="0"/>
zh_CN: <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable></systemitem>:  共享库 <filename>lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable></filename> 的库文件包，其 SONAME ABI 版本为 <replaceable>1</replaceable>.<placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&policy-ldconfig;">Debian Policy Manual, 8.1.1 "ldconfig"</ulink>.
zh_CN: 参见 <ulink url="&policy-ldconfig;">Debian Policy Manual, 8.1.1 "ldconfig"</ulink>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: The package maintainer scripts of the library package must call <command>ldconfig</command> under the specific circumstances to create the necessary symbolic links for the SONAME.<placeholder type="footnote" id="0"/>
zh_CN: 在某些情况下，库软件包的 maintainer scripts 必须调用 <command>ldconfig</command> 来为 SONAME 创建 必要的符号链接。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable>-dbg</systemitem>: the debugging symbols package that contains the debugging symbols for the shared library package <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable></systemitem>.
zh_CN: <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable>-dbg</systemitem>: 包含了调试共享库包用的调试符号的软件包 <systemitem role="package">lib<replaceable>foo</replaceable><replaceable>1</replaceable></systemitem>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&policy-static;">Debian Policy Manual, 8.3 "Static libraries"</ulink> and <ulink url="&policy-dev;">Debian Policy Manual, 8.4 "Development files"</ulink>.
zh_CN: 参见 <ulink url="&policy-static;">Debian Policy Manual, 8.3 "Static libraries"</ulink> and <ulink url="&policy-dev;">Debian Policy Manual, 8.4 "Development files"</ulink>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: <systemitem role="package">lib<replaceable>foo</replaceable>-dev</systemitem>: the development package that contains the header files etc. for the shared library <filename>lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable></filename>.<placeholder type="footnote" id="0"/>
zh_CN: <systemitem role="package">lib<replaceable>foo</replaceable>-dev</systemitem>: 包含了头文件等内容的开发包。用于 <filename>lib<replaceable>foo</replaceable>.so.<replaceable>1</replaceable></filename>.<placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&removela;">Debian wiki ReleaseGoals/LAFileRemoval</ulink>.
zh_CN: 参见 <ulink url="&removela;">Debian wiki ReleaseGoals/LAFileRemoval</ulink>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Debian packages should not contain <filename>*.la</filename> Libtool archive files in general.<placeholder type="footnote" id="0"/>
zh_CN: 一般而言，Debian 软件包不应当包含 <filename>*.la</filename> Libtool 归档文件。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: See <ulink url="&rpathissues;">Debian wiki RpathIssue</ulink>.
zh_CN: 参见 <ulink url="&rpathissues;">Debian wiki RpathIssue</ulink>.

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Debian packages should not use RPATH in general.<placeholder type="footnote" id="0"/>
zh_CN: 一般来说，Debian 软件包不应当使用 RPATH。<placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Although it is somewhat outdated and is only a secondary reference, <ulink url="&debianlibrarypackagingguide;">Debian Library Packaging Guide</ulink> may still be useful.
zh_CN: 虽然这有点过时，而且是第二参考， <ulink url="&debianlibrarypackagingguide;">Debian Library Packaging Guide</ulink> 可能仍然对你有用。

note: type: Content of: <book><appendix><section><title>
en: Managing <filename>debian/<replaceable>package</replaceable>.symbols</filename>
zh_CN: 管理 <filename>debian/<replaceable>package</replaceable>.symbols</filename>

note: type: Content of: <book><appendix><section><para><footnote><para>
en: Backward-incompatible ABI changes normally require you to update the SONAME of the library and the shared library package name to new ones.
zh_CN: 向后不兼容的 ABI 变更常常需要你更新共享库的 SONAME，并把共享库名称换成新的。

note: type: Content of: <book><appendix><section><para>
en: When you package a shared library, you should create a <filename>debian/<replaceable>package</replaceable>.symbols</filename> file to manage the minimal version associated with each symbol for backward-compatible ABI changes under the same SONAME of the library for the same shared library package name.<placeholder type="footnote" id="0"/> You should read the following primary references in detail:
zh_CN: 当你给共享库打包时，你应当创建 <filename>debian/<replaceable>package</replaceable>.symbols</filename> 文件来管理在共享库名称不变，在同一个 SONAME 下又要提供 ABI 向后兼容性的情况下每个符号关联到的最小版本号。 <placeholder type="footnote" id="0"/> 你可以阅读下边的主要参考以获知细节：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: For C++ libraries and other cases where tracking individual symbols is too difficult, follow <ulink url="&policy-library-shlibs;">Debian Policy Manual, 8.6.4 "The shlibs system"</ulink>, instead.
zh_CN: 对于 C++ 库和其他追踪单个符号过于困难的情况下，请遵循  <ulink url="&policy-library-shlibs;">Debian Policy Manual, 8.6.4 "The shlibs system"</ulink>。

note: type: Content of: <book><appendix><section><para>
en: Here is a rough example of how to create the <systemitem role="package">libfoo1</systemitem> package from the upstream version <literal>1.3</literal> with the proper <filename>debian/libfoo1.symbols</filename> file:
zh_CN: 这是个粗略的例子，用来来演示创建 <systemitem role="package">libfoo1</systemitem> 软件包的方法，此时使用上游 <literal>1.3</literal> 版本，有着妥当的<filename>debian/libfoo1.symbols</filename> 文件：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Prepare the skeleton debianized source tree using the upstream <filename>libfoo-1.3.tar.gz</filename> file.
zh_CN: 使用上游提供的 <filename>libfoo-1.3.tar.gz</filename> 文件来准备 Debian化 的源码骨架。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: If this is the first packaging of the <systemitem role="package">libfoo1</systemitem> package, create the <filename>debian/libfoo1.symbols</filename> file with empty content.
zh_CN: 如果这是库软件包 <systemitem role="package">libfoo1</systemitem> 的第一次打包，那么以空内容创建 <filename>debian/libfoo1.symbols</filename> 文件。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: If the previous upstream version <literal>1.2</literal> was packaged as the <systemitem role="package">libfoo1</systemitem> package with the proper <filename>debian/libfoo1.symbols</filename> in its source package, use it again.
zh_CN: 如果之前的上游版本 <literal>1.2</literal> 已经被 <systemitem role="package">libfoo1</systemitem> 软件包打包了，并且其源码包中有妥当的 <filename>debian/libfoo1.symbols</filename>， 再用它一次。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para><footnote><para>
en: All previous versions of Debian packages are available at <ulink url="&snapshot;">http://snapshot.debian.org/</ulink>.  The Debian revision is dropped from the version to make it easier to backport the package: <literal>1.1</literal> &lt;&lt; <literal>1.1-1~bpo70+1</literal> &lt;&lt; <literal>1.1-1</literal> and <literal>1.2</literal> &lt;&lt; <literal>1.2-1~bpo70+1</literal> &lt;&lt; <literal>1.2-1</literal>
zh_CN: 所有先前的 Debian 软件包版本都能在 <ulink url="&snapshot;">http://snapshot.debian.org/</ulink> 找到。不过 Debian 修订号 被去掉了，以使软件包的 backport 更为容易： <literal>1.1</literal> &lt;&lt; <literal>1.1-1~bpo70+1</literal> &lt;&lt; <literal>1.1-1</literal> and <literal>1.2</literal> &lt;&lt; <literal>1.2-1~bpo70+1</literal> &lt;&lt; <literal>1.2-1</literal>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: If the previous upstream version <literal>1.2</literal> was not packaged with <filename>debian/libfoo1.symbols</filename>, create it as the <filename>symbols</filename> file from all available binary packages of the same shared library package name containing the same SONAME of the library, for example, versions <literal>1.1-1</literal> and <literal>1.2-1</literal>.  <placeholder type="footnote" id="0"/>
zh_CN: 如果前一个上游 <literal>1.2</literal> 版本打包时没有 <filename>debian/libfoo1.symbols</filename>，那就从具有相同库 SONAME 的同一个共享库包的所有可用的二进制软件包中创建它并命名为 <filename>symbols</filename> 文件。比如 <literal>1.1-1</literal> 和 <literal>1.2-1</literal>。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Make trial builds of the source tree with tools such as <command>debuild</command> and <command>pdebuild</command>.  (If this fails due to missing symbols etc., there were some backward-incompatible ABI changes that require you to bump the shared library package name to something like <systemitem role="package">libfoo1a</systemitem> and you should start over again.)
zh_CN: 尝试用像 <command>debuild</command> 和 <command>pdebuild</command> 这样的工具来对源码树进行试构建。 (如果这因为缺失符号之类原因而失败，那么这里就有一些不向后兼容的 ABI 改变，这就需要你转移(bump)共享库的名称到诸如 <systemitem role="package">libfoo1a</systemitem> ，并重新开始一次。）

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para><footnote><para>
en: The Debian revision is dropped from the version to make it easier to backport the package: <literal>1.3</literal> &lt;&lt; <literal>1.3-1~bpo70+1</literal> &lt;&lt; <literal>1.3-1</literal>
zh_CN: Debian 修订号已被从版本中去掉，这能让软件包的 backport 更为容易： <literal>1.3</literal> &lt;&lt; <literal>1.3-1~bpo70+1</literal> &lt;&lt; <literal>1.3-1</literal>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: If you see the diff printed by the <command>dpkg-gensymbols</command> as above, extract the proper updated <filename>symbols</filename> file from the generated binary package of the shared library.  <placeholder type="footnote" id="0"/>
zh_CN: 如果你如上述看见由 <command>dpkg-gensymbols</command> 命令打印出来的差异， 那就从生成的二进制库包中抽取妥当更新的 <filename>symbols</filename> 文件。 <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Build release packages with tools such as <command>debuild</command> and <command>pdebuild</command>.
zh_CN: 使用像 <command>debuild</command> 和 <command>pdebuild</command> 这样的工具来构建发行软件包。

note: type: Content of: <book><appendix><section><para><footnote><para>
en: See <ulink url="&policy-library-abi;">Debian Policy Manual, 8.6.2 "Shared library ABI changes"</ulink>.
zh_CN: 参见 <ulink url="&policy-library-abi;">Debian Policy Manual, 8.6.2 "Shared library ABI changes"</ulink>.

note: type: Content of: <book><appendix><section><para>
en: In addition to the above examples, we need to check the ABI compatibility further and bump versions for some symbols manually as needed.  <placeholder type="footnote" id="0"/>
zh_CN: 对上边这个例子补充一点，我们需要进一步检查 ABI (应用程序二进制接口) 兼容性 并在需要的时候手动更新一些符号的版本。  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><para>
en: Although it is only a secondary reference, <ulink url="&usingsymbolsfiles;">Debian wiki UsingSymbolsFiles</ulink> and its linked web pages may be useful.
zh_CN: 虽然这只是第二参考， <ulink url="&usingsymbolsfiles;">Debian wiki UsingSymbolsFiles</ulink> 和它指向的页面可能会有所帮助。

note: type: Content of: <book><appendix><section><title>
en: Multiarch
zh_CN: 多体系结构

note: type: Content of: <book><appendix><section><para>
en: The multiarch feature introduced to Debian wheezy integrates support for cross-architecture installation of binary packages (particularly <literal>i386</literal>&lt;-&gt;<literal>amd64</literal>, but also other combinations) in <systemitem role="package">dpkg</systemitem> and <systemitem role="package">apt</systemitem>. You should read the following references in detail:
zh_CN: Debian wheezy 引入的多体系结构特性，集成了对 二进制包跨体系结构安装的支持 (尤其是 <literal>i386</literal>&lt;-&gt;<literal>amd64</literal>，其他的组合也有) 于 <systemitem role="package">dpkg</systemitem> 和 <systemitem role="package">apt</systemitem> 中。你可以阅读下边的参考：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: <ulink url="&multiarchspec;">Ubuntu wiki MultiarchSpec</ulink> (upstream)
zh_CN: <ulink url="&multiarchspec;">Ubuntu wiki MultiarchSpec</ulink> (上游)

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: <ulink url="&multiarchimplementation;">Debian wiki Multiarch/Implementation</ulink> (Debian situation)
zh_CN: <ulink url="&multiarchimplementation;">Debian wiki Multiarch/Implementation</ulink> (Debian 的局势)

note: type: Content of: <book><appendix><section><para><footnote><para>
en: Old special purpose library paths such as <filename>/lib32/</filename> and <filename>/lib64/</filename> are not used anymore.
zh_CN: 老旧且具有特殊用途的库路径，比如 <filename>/lib32/</filename> 和 <filename>/lib64/</filename> 已不再使用。

note: type: Content of: <book><appendix><section><para>
en: It uses the triplet such as <literal>i386-linux-gnu</literal> and <literal>x86_64-linux-gnu</literal> for the install path of shared libraries. The actual triplet path is dynamically set into the <literal>$(DEB_HOST_MULTIARCH)</literal> variable using the <citerefentry> <refentrytitle>dpkg-architecture</refentrytitle><manvolnum>1</manvolnum></citerefentry> command for each binary package build. For example, the path to install multiarch libraries are changed as follows:<placeholder type="footnote" id="0"/>
zh_CN: 它为每个共享库的安装路径使用了类似 <literal>i386-linux-gnu</literal> 和 <literal>x86_64-linux-gnu</literal> 这样的三元名字。实际上每个二进制软件包构建的三元路径是被动态设置到 <literal>$(DEB_HOST_MULTIARCH)</literal> 变量中的，经由 <citerefentry> <refentrytitle>dpkg-architecture</refentrytitle><manvolnum>1</manvolnum></citerefentry> 命令。举个例子， 安装多体系结构库文件的路径被按照下表进行了修改：<placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: Old path
zh_CN: 旧路径

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: i386 multiarch path
zh_CN: i386 多体系结构路径

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: amd64 multiarch path
zh_CN: amd64 多体系结构路径

note: type: Content of: <book><appendix><section><para>
en: Here are some typical multiarch package split scenario examples for the following:
zh_CN: 下面是一些典型的多体系结构软件包分离情景：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: a library source <filename>lib<replaceable>foo</replaceable>-1.tar.gz</filename>
zh_CN: 库源码 <filename>lib<replaceable>foo</replaceable>-1.tar.gz</filename>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: a tool source <filename><replaceable>bar</replaceable>-1.tar.gz</filename> written in a compiled language
zh_CN: 一个用编译型语言编写的工具的源码 <filename><replaceable>bar</replaceable>-1.tar.gz</filename>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: a tool source <filename><replaceable>baz</replaceable>-1.tar.gz</filename> written in an interpreted language
zh_CN: 一个用解释型语言编写的工具的源码 <filename><replaceable>bar</replaceable>-1.tar.gz</filename>

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: Package
zh_CN: 软件包

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: Architecture:
zh_CN: 体系结构：

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: Multi-Arch:
zh_CN: 多体系结构：

note: type: Content of: <book><appendix><section><informaltable><tgroup><thead><row><entry>
en: Package content
zh_CN: 软件包内容

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: any
zh_CN: 任何

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: same
zh_CN: 相同

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the shared library, co-installable
zh_CN: 共享库，可共同安装

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the shared library debug symbols, co-installable
zh_CN: 共享库调试符号，可共同安装

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the shared library header files etc., co-installable
zh_CN: 共享库头文件之类，可共同安装

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: foreign
zh_CN: 外来

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the run-time support programs, not co-installable
zh_CN: 运行时支持程序，不可共同安装

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: all
zh_CN: 全部

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the shared library documentation files
zh_CN: 共享库文档

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the compiled program files, not co-installable
zh_CN: 编译好的程序文件，不可共同安装

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the documentation files for the program
zh_CN: 程序的配套文档文件

note: type: Content of: <book><appendix><section><informaltable><tgroup><tbody><row><entry>
en: the interpreted program files
zh_CN: 解释型程序文件

note: type: Content of: <book><appendix><section><para>
en: Please note that the development package should contain a symlink for the associated shared library <emphasis role="strong">without a version number</emphasis>.  E.g.: <filename>/usr/lib/x86_64-linux-gnu/libfoo.so</filename> -&gt; <filename>libfoo.so.1</filename>
zh_CN: 请注意，开发软件包应该包含一个指向共享库的符号链接并且 <emphasis role="strong">不带有版本号</emphasis>。 比如： <filename>/usr/lib/x86_64-linux-gnu/libfoo.so</filename> -&gt; <filename>libfoo.so.1</filename>

note: type: Content of: <book><appendix><section><title>
en: Building a shared library package
zh_CN: 构建共享库包

note: type: Content of: <book><appendix><section><para>
en: You can build a Debian library package enabling multiarch support using <citerefentry> <refentrytitle>dh</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> as follows:
zh_CN: 你可以用 <citerefentry> <refentrytitle>dh</refentrytitle> <manvolnum>1</manvolnum> </citerefentry> 通过以下方法构建一个支持多体系结构的 Debian 库软件包：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Update <filename>debian/control</filename>.
zh_CN: 更新 <filename>debian/control</filename>。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Add <literal>Build-Depends: debhelper (>=10)</literal> for the source package section.
zh_CN: 为源码包部分添加 <literal>Build-Depends: debhelper (>=10)</literal> 部分。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Add <literal>Pre-Depends: ${misc:Pre-Depends}</literal> for each shared library binary package.
zh_CN: 为每个二进制库软件包添加 <literal>Pre-Depends: ${misc:Pre-Depends}</literal>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Add <literal>Multi-Arch:</literal> stanza for each binary package section.
zh_CN: 在每个二进制包的段中添加 <literal>Multi-Arch:</literal> 小节。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Set <filename>debian/compat</filename> to "10".
zh_CN: 设置 <filename>debian/compat</filename> 为"10"。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Adjust the path from the normal <literal>/usr/lib/</literal> to the multiarch <literal>/usr/lib/$(DEB_HOST_MULTIARCH)/</literal> for all packaging scripts.
zh_CN: 将所有打包脚本中的路径从普通的 <literal>/usr/lib/</literal> 调整到多体系结构的 <literal>/usr/lib/$(DEB_HOST_MULTIARCH)/</literal>。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Call <literal>DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)</literal> in <filename>debian/rules</filename> to set the <literal>DEB_HOST_MULTIARCH</literal> variable first.
zh_CN: 首先，在 <filename>debian/rules</filename> 中调用 <literal>DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)</literal> 以设置 <literal>DEB_HOST_MULTIARCH</literal> 变量。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Replace <literal>/usr/lib/</literal> with <literal>/usr/lib/$(DEB_HOST_MULTIARCH)/</literal> in <filename>debian/rules</filename>.
zh_CN: 在 <filename>debian/rules</filename> 中用 <literal>/usr/lib/$(DEB_HOST_MULTIARCH)/</literal> 替换 <literal>/usr/lib/</literal>。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para><footnote><para>
en: Alternatively, you can add <literal>--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)</literal> and <literal>--libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)</literal> arguments to <literal>./configure</literal>.  Please note that <literal>--libexecdir</literal> specifies the default path to install executable programs run by other programs rather than by users.  Its Autotools default is <filename>/usr/libexec/</filename> but its Debian default is <filename>/usr/lib/</filename>.
zh_CN: 作为替代，你可以添加 <literal>--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)</literal> 和 <literal>--libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)</literal> 参数到 <literal>./configure</literal> 后头。 请注意 <literal>--libexecdir</literal> 指定了 安装可执行程序(它们被其他程序使用，而更少是用户)的默认路径。它的 Autotools 默认设置为 <filename>/usr/libexec/</filename> 但是 Debian 的设置为 <filename>/usr/lib/</filename>。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: If <literal>./configure</literal> is used in part of the <literal>override_dh_auto_configure</literal> target in <filename>debian/rules</filename>, make sure to replace it with <literal>dh_auto_configure -- </literal>.  <placeholder type="footnote" id="0"/>
zh_CN: 如果 <filename>debian/rules</filename> 文件中的 <literal>override_dh_auto_configure</literal> 目标使用了 <literal>./configure</literal> 文件，那么请确认用 <literal>dh_auto_configure -- </literal> 来替换它。  <placeholder type="footnote" id="0"/>

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Replace all occurrences of <literal>/usr/lib/</literal> with <literal>/usr/lib/*/</literal> in <filename>debian/<replaceable>foo</replaceable>.install</filename> files.
zh_CN: 在<filename>debian/<replaceable>foo</replaceable>.install</filename> 文件中将所有 <literal>/usr/lib/</literal> 的事件替换为 <literal>/usr/lib/*/</literal> 。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><itemizedlist><listitem><para>
en: Generate files like <filename>debian/<replaceable>foo</replaceable>.links</filename> from <filename>debian/<replaceable>foo</replaceable>.links.in</filename> dynamically by adding a script to the <literal>override_dh_auto_configure</literal> target in <filename>debian/rules</filename>.
zh_CN: 如需从 <filename>debian/<replaceable>foo</replaceable>.links.in</filename> 动态地生成像 <filename>debian/<replaceable>foo</replaceable>.links</filename> 这样的文件，可以添加一个脚本到 <filename>debian/rules</filename> 文件的 <literal>override_dh_auto_configure</literal> 目标中。

note: type: Content of: <book><appendix><section><para>
en: Please make sure to verify that the shared library package contains only the expected files, and that your -dev package still works.
zh_CN: 请确认该共享库软件包仅仅包含预期中的文件，并且你的 -dev 软件包还奏效。

note: type: Content of: <book><appendix><section><para>
en: All files installed simultaneously as the multiarch package to the same file path should have exactly the same file content.  You must be careful of differences generated by the data byte order and by the compression algorithm.
zh_CN: 所有作为多体系结构软件包而同时安装到同一个文件路径的所有文件应当具有完全一致的文件内容。你必须小心由数据字节序和压缩算法造成的区别。

note: type: Content of: <book><appendix><section><title>
en: Native Debian package
zh_CN: Debian 本土软件包

note: type: Content of: <book><appendix><section><para>
en: If a package is maintained only for Debian or possibly only for local use, its source may contain all the <filename>debian/*</filename> files in it.  There are 2 ways to package it.
zh_CN: 如果一个软件包是仅仅为 Debian 维护的，或者是可能的本地使用，那么它的源码可以容纳所有的 <filename>debian/*</filename> 于其中。这里有它的两种打包方式。

note: type: Content of: <book><appendix><section><para>
en: You can make the upstream tarball by excluding the <filename>debian/*</filename> files and package it as a non-native Debian package as in <xref linkend="workflow"/>.  This is the normal way, which some people encourage using.
zh_CN: 你可以将除 <filename>debian/*</filename> 文件之外的部分制作成上游 tarball，然后将其作为非本土 Debian 软件包来打包，正如 <xref linkend="workflow"/> 所述。 这是一些人鼓励使用的普通方法。

note: type: Content of: <book><appendix><section><para>
en: The alternative is the workflow of the native Debian package.
zh_CN: 另一种方法就是本土 Debian 软件包的打包工作流。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Create a native Debian source package in the <literal>3.0 (native)</literal> format using a single compressed tar file in which all files are included.
zh_CN: 用包含所有文件的，单一压缩过的 tar 文件，以 <literal>3.0 (native)</literal> 格式来创建本土 Debian 源码包。

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: Build Debian binary packages from the native Debian source package.
zh_CN: 用 Debian 本土源码包构建二进制包。

note: type: Content of: <book><appendix><section><para>
en: For example, if you have source files in <filename>~/mypackage-1.0</filename> without the <filename>debian/*</filename> files, you can create a native Debian package by issuing the <command>dh_make</command> command as follows:
zh_CN: 比如说，如果你的源代码文件都存放在 <filename>~/mypackage-1.0</filename> 中，而且没有 <filename>debian/*</filename> 这些文件，那么你可以用它创建 一个本土 Debian 软件包，只要按照下边的方法使用 <command>dh_make</command> 命令：

note: type: Content of: <book><appendix><section><para>
en: Then the <filename>debian</filename> directory and its contents are created just like in <xref linkend="non-native-dh-make"/>.  This does not create a tarball, since this is a native Debian package.  But that is the only difference.  The rest of the packaging activities are practically the same.
zh_CN: 接下来 <filename>debian</filename> 目录和它的内容都会被创建， 正如 <xref linkend="non-native-dh-make"/> 中那样。 这不会创建一个 tarball，因为这是个本土 Debian 软件包。不过这也是唯一的区别。 剩下的打包操作就是完全一致的了。

note: type: Content of: <book><appendix><section><para>
en: After execution of the <command>dpkg-buildpackage</command> command, you will see the following files in the parent directory:
zh_CN: 在执行了 <command>dpkg-buildpackage</command> 命令后，你将会在上一级目录中看到这些文件：

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: This is the source code tarball created from the <filename>mypackage-1.0</filename> directory by the <command>dpkg-source</command> command.  (Its suffix is not <filename>orig.tar.gz</filename>.)
zh_CN: 这是 <command>dpkg-source</command> 命令用 <filename>mypackage-1.0</filename> 目录创建出来的源代码 tarball 。 (它的 文件名后缀不是 <filename>orig.tar.gz</filename>)

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: This is a summary of the contents of the source code, as in the non-native Debian package. (There is no Debian revision.)
zh_CN: 这是对源码内容的简述，正如在非本土 Debian 软件包中那样。（没有 Debian 修订号。）

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: This is your completed binary package, as in the non-native Debian package.  (There is no Debian revision.)
zh_CN: 这是完成的二进制包，正如在非本土 Debian 软件包中那样。（没有 Debian 修订号。）

note: type: Content of: <book><appendix><section><itemizedlist><listitem><para>
en: This file describes all the changes made in the current package version as in the non-native Debian package. (There is no Debian revision.)
zh_CN: 这个文件描述了这个软件作为外来 Debian 包，在当前版本所作出的所有更改。（没有 Debian 修订）
