Debian 維護者指南

杨博远

Chinese zh-cn Translation (2017-2019) 

Fonzie Huang

Chinese zh-cn Translation (2018) 

鄭原真

Chinese zh-tw Translation (2019) 

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

本指南在撰寫過程中參考了以下幾篇文件:

  • “Making a Debian Package (AKA the Debmake Manual)”, 版權所有 © 1997 Jaldhar Vyas.
  • “The New-Maintainer’s Debian Packaging Howto”, 版權所有 © 1997 Will Lowe.
  • “Debian New Maintainers’ Guide”, 版權所有 © 1998-2002 Josip Rodin, 2005-2017 Osamu Aoki, 2010 Craig Small 以及 2010 Raphaël Hertzog。

本指南的最新版本應當可以在下列位置找到:

Abstract

本篇《Debian 維護者指南》(2022-05-09)教材文件針對普通 Debian 使用者和未來的開發者,描述了使用 debmake 命令構建 Debian 套件的方法。

本指南注重描述現代的打包風格,同時提供了許多簡單的範例。

  • POSIX shell 指令碼打包
  • Python3 指令碼打包
  • C 和 Makefile/Autotools/CMake
  • 含有共享程式庫的多個二進位制套件的打包,等等。

本篇《Debian 維護者指南》可看作《Debian 新維護者手冊》的繼承文件。


Table of Contents

前言
1. 概覽
2. 預備知識
2.1. Debian 社群的工作者
2.2. 如何做出貢獻
2.3. Debian 的社會驅動力
2.4. 技術提醒
2.5. Debian 文件
2.6. 幫助資源
2.7. 倉庫狀況
2.8. 貢獻流程
2.9. 新手貢獻者和維護者
3. 工具的配置
3.1. 電子郵件地址
3.2. mc
3.3. git
3.4. quilt
3.5. devscripts
3.6. sbuild
3.7. git-buildpackage
3.8. HTTP 代理
3.9. 私有 Debian 倉庫
3.10. Virtual machines
3.11. Local network with virtual machines
4. 簡單例子
4.1. Packaging tarball
4.2. 大致流程
4.3. 什麼是 debmake?
4.4. 什麼是 debuild?
4.5. 第一步:取得上游原始碼
4.6. 第二步:使用 debmake 產生模板檔案
4.7. 第三步:編輯模板檔案
4.8. 第四步:使用 debuild 構建套件
4.9. 第三步(備選):修改上游原始碼
4.9.1. 使用 diff -u 處理補丁
4.9.2. 使用 dquilt 處理補丁
4.9.3. 使用 dpkg-source --commit 處理補丁
5. 基本內容
5.1. 打包工作流
5.1.1. debhelper 套件
5.2. Historical perspective of Debian packaging practices
5.3. Future perspective on Debian packaging practices
5.4. 套件名稱和版本
5.5. 原生 Debian 套件
5.6. debian/rules
5.6.1. dh
5.6.2. 簡單的 debian/rules
5.6.3. 設定 debian/rules
5.6.4. debian/rules 中的變數
5.6.5. 可重現的構建
5.7. debian/control
5.7.1. Debian 二進位制套件的拆分
5.7.1.1. debmake -b
5.7.1.2. 拆包的場景和例子
5.7.1.3. 程式庫套件名稱
5.7.2. Substvar
5.7.3. binNMU 安全
5.8. debian/changelog
5.9. debian/copyright
5.10. debian/patches/*
5.10.1. dpkg-source -x
5.10.2. dquilt 和 dpkg-source
5.11. debian/upstream/signing-key.asc
5.12. debian/watch 和 DFSG
5.13. 其它 debian/* 檔案
5.14. Debian 打包的定製化
5.15. 在版本控制系統中進行記錄(標準)
5.16. 在版本控制系統中進行記錄(備選方案)
5.17. 構建套件時排除不必要的內容
5.17.1. 使用 debian/rules clean 進行修復
5.17.2. 使用版本控制系統修復
5.17.3. 使用 extend-diff-ignore 修復
5.17.4. 使用 tar-ignore 修復
5.18. 上游構建系統
5.18.1. Autotools
5.18.2. CMake
5.18.3. Meson
5.18.4. Python distutils
5.19. 除錯資訊
5.19.1. 新的 -dbgsym 套件(Stretch 9.0 或更新)
5.20. 程式庫套件
5.20.1. 程式庫符號
5.20.2. 程式庫變遷
5.21. debconf
5.22. 多體系架構
5.22.1. 多架構程式庫路徑
5.22.2. 多架構標頭檔案路徑
5.22.3. 多架構支援下的 *.pc 檔案路徑
5.23. 編譯強化
5.24. 持續整合
5.25. Other new requirements
5.26. 自主生成 (Bootstrapping)
5.27. 錯誤報告
6. debmake 選項
6.1. 快捷選項(-a,-i)
6.1.1. Python 模組
6.2. Snapshot upstream tarball (-d, -t)
6.3. debmake -cc
6.4. debmake -k
6.5. debmake -j
6.6. debmake -x
6.7. debmake -P
6.8. debmake -T
7. 小技巧
7.1. debdiff
7.2. dget
7.3. debc
7.4. piuparts
7.5. debsign
7.6. dput
7.7. bts
7.8. git-buildpackage
7.8.1. gbp import-dscs --debsnap
7.8.2. 上游 git 倉庫
7.9. dgit
7.9.1. Snapshot upstream tarball (alternative git deborig approach)
7.10. chroot
7.11. 新的 Debian 版本
7.12. 新上游版本
7.12.1. uupdate + tarball
7.12.2. uscan
7.12.3. gbp
7.12.4. gbp + uscan
7.13. 3.0 原始碼格式
7.14. CDBS
7.15. 在 UTF-8 環境下構建
7.16. UTF-8 轉換
7.17. 上傳 orig.tar.gz
7.18. 跳過的上傳
7.19. 高階打包
7.20. 其他發行版
7.21. 除錯
8. 更多範例
8.1. 挑選最好的模板
8.2. 無 Makefile(shell,命令列介面)
8.3. Makefile(shell,命令列介面)
8.4. setup.py(Python3,命令列介面)
8.5. Makefile(shell,圖形介面)
8.6. setup.py(Python3,圖形介面)
8.7. Makefile(單個二進位制套件)
8.8. Makefile.in + configure(單個二進位制套件)
8.9. Autotools(單個二進位制檔案)
8.10. CMake(單個二進位制套件)
8.11. Autotools(多個二進位制套件)
8.12. CMake(多個二進位制套件)
8.13. 國際化
8.14. 細節
A. debmake(1) 手冊頁
A.1. 名稱
A.2. 概述
A.3. 描述
A.3.1. 可選引數:
A.4. 範例
A.5. 幫助套件
A.6. 注意事項
A.7. 除錯
A.8. 作者
A.9. 許可證
A.10. 參見