章 1. 前言

# 章 1. 前言

If you are a somewhat experienced Debian user [1], you may have encountered the following situations:

- 您想要安裝某一個套件，但是該軟體在 Debian 倉庫中尚不存在。
- 您想要將一個 Debian 套件更新為上游的新版本。
- 您想要新增某些補丁來修復某個 Debian 套件中的缺陷。

If you want to create a Debian package to fulfill these needs and share your work with the community, you are the target audience of this guide as a prospective Debian maintainer. [2] Welcome to the Debian community.

Debian has many social and technical rules and conventions to follow, as it is a large volunteer organization with a rich history. Debian has also developed an extensive array of packaging and archive maintenance tools to build consistent sets of binary packages that address many technical objectives:

- packages have clearly specified package dependencies and patches and build correctly from scratch in a clean build environment (“節 6.6, “debian/control file””, “節 6.9, “debian/patches/* files””, “節 4.7, “sbuild setup””)
- packages build across many architectures (“節 9.3, “Variables for debian/rules””)
- builds are reproducible (“節 10.7, “可重現的構建””)
- multiarch is supported (“節 10.10, “多體系架構””)
- bootstrapping new architectures is possible (“節 10.5, “自主生成 (Bootstrapping)””)
- builds use specific compiler flags to harden security (“節 10.6, “編譯強化””)
- packages are split optimally into multiple binary packages (“節 10.11, “Debian 二進位制套件的拆分””)
- library names and contents are managed to ensure smooth transitions on upgrades (“節 10.18, “程式庫變遷””)
- installations use interactive prompts correctly (if at all) (“節 10.22, “debconf””)
- continuous integration is used to ensure quality (“節 10.4, “持續整合””)
- …​

These factors can be overwhelming for many new prospective Debian maintainers. This guide aims to provide entry points to help them get started. It covers the following:

- 作為未來潛在的維護者，您在參與 Debian 工作之前應該瞭解的東西。
- 製作一個簡單的 Debian 套件大概流程如何。
- 製作 Debian 套件時有哪些規則。
- Tips for making the Debian package with minimal effort.
- Examples of making Debian packages in typical scenarios.

The author recognized the limitations of updating the original “New Maintainers' Guide” with the dh-make package and decided to create an alternative tool with accompanying documentation to address modern requirements such as multi-arch. This resulted in the debmake package, initially released as version 4.0 in 2013. The current debmake version is 5.1.4. It comes with this updated “Guide for Debian Maintainers” in the debmake-doc package (version: 1.28-1). (In 2016, dh-make was ported from Perl to Python with updated features.)

Many chores and tips have been integrated into the debmake command allowing this guide to be terse. This guide also offers many packaging examples for you to get started.

| 注意
合適地建立並維護 Debian 套件需要佔用許多時間。Debian 維護者在接受這項挑戰時一定要確保 既能精通技術又能勤勉投入精力。

Some important topics are explained in detail. While some may seem irrelevant to you, please be patient. Certain corner cases are omitted, and some topics are only covered through external references. These are intentional choices to keep this guide simple and maintainable.

[1] You need to know a little about Unix programming, but you don’t need to be an expert. You can learn about basic Debian system handling from the “Debian Reference”. It also contains pointers for learning about Unix programming.

[2] If you’re not interested in sharing the Debian package, you can address your local needs by compiling and installing the fixed upstream source package into /usr/local/.

Debian 維護者指南 |  | 章 2. 概覽