2008年05月05日

Subject: New README.source documentation for Debian packages

Russ Allberyよりdebian-devel-announceへ。4月28日付け。

Debianのパッケージにはいろいろ異なるビルド/パッチシステムがあり、場合によっては非常に複雑なわけだけど、ソースパッケージ中にdebian/README.sourceというファイルを用意するようポリシーで推奨することになるらしい(現時点ではRCバグではなく推奨のみ。#250202)。

README.sourceファイルには、パッチシステムが使われているパッケージをカスタマイズしてdpkg-buildpackageを行いたい人向けのドキュメントが記述される。 パッチを適用したソース生成方法の手順、ソースの変更とその変更の保持の方法、パッチ適用を外す方法、それにできれば新しいupstreamバージョンへのアップグレード手順。

パッチシステムのメンテナがこのドキュメントを作って、それを各メンテナが採用するというアイデアもある。以下はquiltパッケージ向けの一例。

This package uses quilt to manage all modifications to the upstream
source.  Changes are stored in the source package as diffs in
debian/patches and applied during the build.

To get the fully patched source after unpacking the source package, cd to
the root level of the source package and run:

    quilt push -a

The last patch listed in debian/patches/series will become the current
patch.

To add a new set of changes, first run quilt push -a, and then run:

    quilt new <patch>

where <patch> is a descriptive name for the patch, used as the filename in
debian/patches.  Then, for every file that will be modified by this patch,
run:

    quilt add <file>

before editing those files.  You must tell quilt with quilt add what files
will be part of the patch before making changes or quilt will not work
properly.  After editing the files, run:

    quilt refresh

to save the results as a patch.

Alternately, if you already have an external patch and you just want to
add it to the build system, run quilt push -a and then:

    quilt import -P <patch> /path/to/patch
    quilt push -a

(add -p 0 to quilt import if needed). <patch> as above is the filename to
use in debian/patches.  The last quilt push -a will apply the patch to
make sure it works properly.

To remove an existing patch from the list of patches that will be applied,
run:

    quilt delete <patch>

You may need to run quilt pop -a to unapply patches first before running
this command.