章 3. 預備知識

內容目錄

3.1. Debian 社群的工作者
3.2. 如何做出貢獻
3.3. Debian 的社會驅動力
3.4. 技術提醒
3.5. Debian 文件
3.6. 幫助資源
3.7. 倉庫狀況
3.8. 貢獻流程
3.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 維護者

Please note that you do not need to create any new packages 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 "`節 3.8, “貢獻流程””`").

請參考下列文件來了解應當如何為 Debian 作出貢獻:

為做好準備和 Debian 進行互動,請理解 Debian 的社會動力學:

  • 我們都是志願者。

    • 任何人都不能把事情強加給他人。
    • 您應該主動地做自己想做的事情。
  • 友好的合作是我們前行的動力。

    • 您的貢獻不應致使他人增加負擔。
    • 只有當別人欣賞和感激您的貢獻時,它才有真正的價值。
  • Debian 並不是一所學校,在這裡沒有所謂的老師會自動地注意到您。

    • 您需要有自學大量知識和技能的能力。
    • 其他志願者的關注是非常稀缺的資源。
  • Debian 一直在不斷進步。

    • Debian 期望您製作出高質量的套件。
    • 您應該隨時調整自己來適應變化。

在這篇指南之後的部分中,我們只關注打包的技術方面。因此,請參考下面的文件來理解 Debian 的社會動力學:

這裡給出一些技術上的建議,參考行事可以讓您與其他維護者共同維護套件時變得更加輕鬆有效,從而讓 Debian 專案的輸出成果最大化。

[注意]注意

對軟體進行除錯(debug)通常會比編寫初始可用的軟體花費更多的時間。

It is unwise to run your base system under the unstable suite even for the development system.

[注意]注意

Advanced package development activities such as testing of full Desktop systems, network daemons, and system installer packages, should use unstable suite running under the virtualization.

Please make yourself ready to read the pertinent part of the latest Debian documentation to generate perfect Debian packages:

All these documents are published to https://www.debian.org using the unstable suite versions of corresponding Debian packages. If you wish to have local accesses to all these documents from your base system, please consider to use techniques such as apt-pinning and chroot.

如果本指南文件的內容與官方的 Debian 文件有所衝突,那麼官方的那些總是對的。請使用 reportbug 工具對 debmake-doc 套件報告問題。

這裡有一些替代性的教材文件,您可以與本指南一起閱讀進行參考:

[提示]提示

When reading these, you may consider using the debmake command in place of the dh_make command.

在您決定在某些公共場合問出您的問題之前,請先做好自己能做到的事情,例如,閱讀能找到的文件:

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 them carefully.

請了解 Debian 倉庫的當前狀況。

  • Debian 已經包含了絕大多數種類程式的套件。
  • Debian 倉庫內套件的數量是活躍維護者的數十倍。
  • 遺憾的是,某些套件缺乏維護者的足夠關注。

因此,對已經存在於倉庫內的套件做出貢獻是十分歡迎的(這也更有可能得到其他維護者的支援和協助上傳)。

[提示]提示

來自 devscripts 套件的 wnpp-alert 命令可以檢查已安裝軟體中需要接手或已被丟棄的套件。

[提示]提示

The how-can-i-help package can show opportunities for contributing to Debian on packages installed locally.

這裡使用類 Python 虛擬碼,給出了對 Debian 貢獻名為 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)

其中:

You either need to file an ITP or adopt a package to start working on it. See the Debian Developer’s Reference:

新手貢獻者和維護者可能想知道在開始對 Debian 進行貢獻之前需要事先學習哪些知識。根據您個人的側重點不同,下面有我的一些建議供您參考:

  • 打包

    • POSIX shellmake 的基本知識。
    • 一些 PerlPython 的入門知識。
  • 翻譯

    • 基於 PO 的翻譯系統的工作原理和基本知識。
  • 文件

    • Basics of text markups (XML, ReST, Wiki, …​).

新手貢獻者和維護者可能想知道從哪裡開始對 Debian 進行貢獻。根據您掌握的技能,下面有我的一些建議供您參考:

這些活動應當能讓您在各位 Debian 社群成員之間得到存在感,從而建立您的信譽與名聲。

新手維護者應當避免打包具有潛在高度安全隱患的程式:

  • setuidsetgid 程式
  • 背景服務程序(daemon)程式
  • 安裝至 /sbin//usr/sbin/ 目錄的程式

在積累足夠的打包經驗後,您可以再嘗試打包這樣的程式。



[4] 絕大多數 Debian 維護者使用 git 而非其它版本控制系統,如 hgbzr 等等。

[5] 這一條不是絕對的要求,但請注意:遇上不友好的上游可能需要大家為此投入大量精力,而一個友好的上游則能協助解決程式的各類問題。