第 2 章 预备知识

目录

2.1. Debian 社区的工作者
2.2. 如何做出贡献
2.3. Debian 的社会驱动力
2.4. 技术提醒
2.5. Debian 文档
2.6. 帮助资源
2.7. 仓库状况
2.8. 贡献流程
2.9. 新手贡献者和维护者

这里给出你在投入 Debian 相关工作之前应当理解掌握的一些必备的预备知识。

在 Debian 社区中有这几类常见的角色:

  • 上游作者(upstream author):程序的原始作者。
  • 上游维护者(upstream maintainer):目前在上游维护程序代码的人。
  • 软件包维护者(maintainer):制作并维护该程序 Debian 软件包的人。
  • 赞助者(sponsor):帮助维护者上传软件包到 Debian 官方仓库的人(在通过内容检查之后)。
  • 导师(mentor):帮助新手维护者熟悉和深入打包的人。
  • Debian 开发者(DD, Debian Developer):Debian 社区的官方成员。DD 拥有向 Debian 官方仓库上传的全部权限。
  • Debian 维护者(Debian Maintainer, DM):拥有对 Debian 官方仓库部分上传权限的人。

注意,你不可能在一夜之间成为 Debian 开发者(DD),因为成为 DD 所需要的远不只是技术技巧。不过别因此而气馁,如果你的软件包对其他人有用,你可以当这个软件的软件包维护者,然后通过一位赞助者来上传这份软件,或者你可以申请成为 Debian 维护者

还有,要成为 Debian 开发者不一定要创建新软件包。对已有软件做出贡献也是成为 Debian 开发者的理想途径。眼下正有很多软件包等着好的维护者来接手(参见 第 2.8 节 “贡献流程”)。

请参考下列文档来了解应当如何为 Debian 作出贡献:

为做好准备和 Debian 进行交互,请理解 Debian 的社会动力学:

  • 我们都是志愿者。

    • 任何人都不能把事情强加给他人。
    • 你应该主动地做自己想做的事情。
  • 友好的合作是我们前行的动力。

    • 你的贡献不应致使他人增加负担。
    • 只有当别人欣赏和感激你的贡献时,它才有真正的价值。
  • Debian 并不是一所学校,在这里没有所谓的老师会自动地注意到你。

    • 你需要有自学大量知识和技能的能力。
    • 其他志愿者的关注是非常稀缺的资源。
  • Debian 一直在不断进步。

    • Debian 期望你制作出高质量的软件包。
    • You should adapt yourself to change.

在这篇指南之后的部分中,我们只关注打包的技术方面。因此,请参考下面的文档来理解 Debian 的社会动力学:

这里给出一些技术上的建议,参考行事可以让你与其他维护者共同维护软件包时变得更加轻松有效,从而让 Debian 项目的输出成果最大化。

[注意] 注意

对软件进行除错(debug)通常会比编写初始可用的软件花费更多的时间。

请在阅读本指南的同时按需阅览下面这些 Debian 官方文档中的相关部分;这些文档提供的信息有助于创建质量优良的 Debian 软件包:

If this guide contradicts the official Debian documentation, the official Debian documentation is correct. Please file a bug report on the debmake-doc package using the reportbug command.

Here are alternative tutorial documents, which you may read along with this guide:

[提示] 提示

When reading these tutorials, you should consider using the debmake command in place of the dh_make command for better template files.

Before you decide to ask your question in some public place, please do your part of the effort, i.e., read the fine documentation:

Your desired information can be found effectively by using a well-formed search string such as “keyword site:lists.debian.org” to limit the search domain of the web search engine.

制作一个小型测试用软件包也是了解打包细节的一个好办法。对当前已有的维护良好的软件包进行检查则是了解其他人如何制作软件包的最好方法。

如果你对打包仍然存在疑问,你可以使用以下方式与他人进行沟通:

如果你在做好功课后能在这些场合中合适地提出你的疑问的话,那些更有经验的 Debian 开发者会很愿意帮助你。

[小心] 小心

Debian development is a moving target. Some information found on the web may be outdated, incorrect, and non-applicable. Please use it carefully.

请了解 Debian 仓库的当前状况。

  • Debian 已经包含了绝大多数种类程序的软件包。
  • Debian 仓库内软件包的数量是活跃维护者的数十倍。
  • Unfortunately, some packages lack an appropriate level of attention by the maintainer.

Thus, contributions to packages already in the archive are far more appreciated (and more likely to receive sponsorship for uploading) by other maintainers.

[提示] 提示

来自 devscripts 软件包的 wnpp-alert 命令可以检查已安装软件中需要接手或已被丢弃的软件包。

Here is pseudo-Python code for your contribution approaches to Debian with a program:

if exist_in_debian(program):
  if is_team_maintained(program):
    join_team(program)
  if is_orphaned(program) # maintainer: Debian QA Group
    adopt_it(program)
  elif is_RFA(program) # Request for Adoption
    adopt_it(program)
  else:
    if need_help(program):
      contact_maintainer(program)
      triaging_bugs(program)
      preparing_QA_or_NMU_uploads(program)
    else:
      leave_it(program)
else: # new packages
  if not is_good_program(program):
    give_up_packaging(program)
  elif not is_distributable(program):
    give_up_packaging(program)
  else: # worth packaging
    if is_ITPed_by_others(program):
      if need_help(program):
        contact_ITPer_for_collaboration(program)
      else:
        leave_it_to_ITPer(program)
    else: # really new
      if is_applicable_team(program):
        join_team(program)
      if is_DFSG(program) and is_DFSG(dependency(program)):
        file_ITP(program, area="main") # This is Debian
      elif is_DFSG(program):
        file_ITP(program, area="contrib") # This is not Debian
      else: # non-DFSG
        file_ITP(program, area="non-free") # This is not Debian
      package_it_and_close_ITP(program)

其中:

你或是需要填写并提交一份 ITP,或是需要“收养”一个软件包并开始为其工作。请见“Debian 开发者参考(Debian Developer's Reference)”文档:

新手贡献者和维护者可能想知道在开始向 Debian 进行贡献之前需要事先学习哪些知识。根据你个人的侧重点不同,下面有我的一些建议供你参考:

  • 打包

    • Basics of the POSIX shell and make.
    • 一些 PerlPython 的入门知识。
  • 翻译

    • Basics of how the PO based translation system works.
  • 文档

    • 文本标记语言的基础知识(XML、ReST、Wiki 等)。

新手贡献者和维护者可能想知道从哪里开始向 Debian 进行贡献。根据你掌握的技能,下面有我的一些建议供你参考:

这些活动应当能让您在各位 Debian 社区成员之间得到存在感,从而建立您的信誉与名气。

新手维护者应当避免打包具有潜在高度安全隐患的程序:

  • setuidsetgid 程序
  • 守护进程(daemon)程序
  • 安装至 /sbin//usr/sbin/ 目录的程序

在积累足够的打包经验后,你可以再尝试打包这样的程序。



[4] 绝大多数 Debian 维护者使用 git 而非其它版本控制系统,如 hgbzr 等等。

[5] This is not the absolute requirement. The hostile upstream may become a major resource drain for us all. The friendly upstream can be consulted to solve any problems with the program.