Chapter 2. 預備知識

Table of Contents

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 開發者的理想途徑。眼下正有很多套件等著好的維護者來接手(參見 Section 2.8, “貢獻流程”)。

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

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

  • 我們都是志願者。

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

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

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

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

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

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

[Note] Note

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

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 (Section 7.10, “chroot”).[5]

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

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

[Tip] Tip

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

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

要取得您所需要的資訊,一種有效的方法是在網頁搜尋引擎中構建類似“關鍵字 site:lists.debian.org”這樣具有限制條件的搜尋字串來限定搜尋的域名。

製作一個小型測試用套件也是瞭解打包細節的一個好辦法。對當前已有的維護良好的套件進行檢查則是瞭解其他人如何製作套件的最好方法。

如果您對打包仍然存在疑問,您可以使用以下方式與他人進行溝通:

如果您在做好功課後能在這些場合中合適地提出您的疑問的話,那些更有經驗的 Debian 開發者會很願意幫助您。

[Caution] Caution

Debian 的開發是一個不斷變動的目標。您在網上找到的某些資訊可能是過時的、不正確的或者不適用的,使用時請留意。

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

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

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

[Tip] Tip

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

[Tip] Tip

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)

其中:

您或是需要填寫並提交一份 ITP,或是需要“收養”一個套件並開始為其工作。請見“Debian 開發者參考(Debian Developer's Reference)”文件:

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

  • 打包

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

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

    • 文字標記語言的基礎知識(XML、ReST、Wiki 等)。

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

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

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

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

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



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

[5] It is unwise to run your base system under the pure unstable suite even for the development system. Normally, most package development activities use unstable chroot as in Section 7.10, “chroot”. By using virtualization, you can test demanding situation such as the full Desktop system, network daemons, and system installer in the unstable suite environment even from the base system running the stable suite.

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