#title よくある間違い <> == dh_makeのサンプルファイル == When you use dh_make to create the initial "debianization", example files for various tasks are created in the `debian/` directory. The templates have a .ex extension. If you want to use one, rename it to remove the extension. If you do not need it, remove it to keep the `debian/` directory clean. 最初の"debianization"としてdh_makeを利用したとき、さまざまな作業に対する実例ファイルが`debian/`ディレクトリに作成されます。これらのファイルは .ex という拡張子を持っています。これらを利用する場合は、この拡張子の部分を削除してください。必要ない場合は、ファイルそのものを削除し、`debian/`ディレクトリをきれいにしておいてください。 <> == オリジナルアーカイブへの修正 == There are two types of source packages, native and non-native. A native package is one that is specific to Ubuntu/Debian. It has the '''debian/''' directory containing the packaging information and any changes to the source included in the tarball (usually _.tar.gz). Non-native packages are more common. A non-native package splits the source package into a _.orig.tar.gz tarball that is identical (hopefully including md5sum) to the source tarball downloaded from the project's homepage and a .diff.gz file that contains all the differences (`debian/` directory and patches) from the original source tarball. ソースパッケージにはネイティブと非ネイティブの二種類が存在します。ネイティブパッケージとは、Ubuntu/Debianに特化したパッケージです。その場合は、ソースコードの変更点やパッケージの情報などが記載された'''debian/'''ディレクトリがアーカイブファイル(通常は_.tar.gz)に含まれています。非ネイティブパッケージはより一般的なパッケージです。非ネイティブパッケージでは、プロジェクトのサイトからダウンロードしたソースアーカイブとまったく同じ(md5sumが含まれていることも期待される)アーカイブファイルである_.orig.tar.gzと、そのオリジナルソースアーカイブとの差分(`debian/`ディレクトリやパッチ)である.diff.gzファイルに分離されています。 Here is a list of potential problems that can occur if you change the original tarball: オリジナルアーカイブに修正を加えた場合、以下の点で問題が生じる可能性があります: 1. Reproducibility If you take just the .diff.gz and .dsc, you or someone else has no means to reproduce the changes in the original tarball. 1. 再現性 ほんのちょっと.diff.gzや.dscを修正したい場合でも、あなたや他の誰かがオリジナルソースアーカイブに加えた変更を再現する手段が存在しません。 1. Upgradeability It is much easier to upgrade to a new upstream (from the author) version if the .orig.tar.gz is preserved and there is a clear separation between the upstream source and the changes made to produce the Ubuntu source package. 1. アップグレード時の利便性 .orig.tar.gzに変更が加えられず、(ソフトウェア作成者による)上流のソースコードとUbuntuのソースパッケージ作成の際の変更点が明確に分けられていれば、上流の新しいバージョンにアップグレードする場合も簡単になります。 1. Debian to Ubuntu Synchronization Changing original tarballs makes it hard to automatically sync from Debian to Ubuntu. Normally, only the .diff.gz and .dsc files change within the same upstream version, since the .orig.tar.gz file is shared by all the Debian or Ubuntu revisions. It is much more difficult to sync if the md5sums of the .orig.tar.gz files are not the same. 1. DebianとUbuntuの同期 オリジナルのソースアーカイブに変更を加えると、DebianからUbuntuへの同期作業が難しくなります。普通は、同じ上流バージョンに対して、DebianとUbuntuで同じ.orig.tar.gzファイルが共有されるので、.diff.gzと.dscファイルのみを修正するだけで済みます。もし、.orig.tar.gzファイルのmd5sum値が異なる場合は、同期作業がより難しくなります。 1. Usage of Revision Control for Debian package If you use svn ('''svn-buildpackage''') to handle your Debian package, you usually don't store the original tarball inside. If someone else does a checkout, he'll need to get the original tarball separately. Other revision control systems can be used to track only the packaging files (`debian/`, etc.) and not the whole source. However, if the .orig.tar.gz is not the same, then obviously problems can occur. 1. Debianパッケージ用のリビジョン管理システムの利用 Debianパッケージの管理にsvn('''svn-buildpackage''')を利用している場合、通常はオリジナルのソースアーカイブをそのパッケージの中に含みません。そのため誰かがチェックアウトするとき、オリジナルのソースアーカイブを別途取得する必要があります。他のリビジョン管理システムでは、パッケージに関するファイル(`debian/`など)のみを追跡し、ソースコードは扱いません。もし、.orig.tar.gzに修正が加えられている場合は、何らかの問題が生じるでしょう。 1. Security tracking Consider a situation where someone ''wants'' to introduce a backdoor/rootkit or other evil stuff. If the original tarball is intact, it can be scanned easily through the .diff.gz to see if the person who modified the package tried to do something evil. If the tarball has changed, however, you also need to check the differences between the tarball and the original source. 1. 安全性の確認 誰かがバックドアやルートキット、その他危険なものを''導入したい''という状況を考えてみましょう。もしオリジナルのソースアーカイブに変更が加えられていない場合、.diff.gzをチェックするだけで、何か悪さがされていないかを確認することができます。ところがソースアーカイブに変更が加えられていた場合、その修正後のアーカイブとオリジナルソースアーカイブの違いも確認する必要があります。 . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] You still have to trust the authors of the software not to do anything evil, but that is the case regardless of whether the original is changed. . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] オリジナルのソースアーカイブに変更が加えられているかどうかに関わらず、ソフトウェアの作成者はそのソフトウェアに悪さをしないと信頼するべきでしょう。 1. The .diff.gz The option to use the .diff.gz to reflect changes to the original tarball already exists, so it is easy to make changes without touching the original tarball. 1. .diff.gz すでに存在するオリジナルソースアーカイブへの変更点を反映した.diff.gzを使うことにより、そのオリジナルアーカイブを触ることなく簡単に変更点を加えることができます。 '''It is acceptable to change the original tarball if one or more of the following hold true:''' '''以下のうち、一つ以上が該当する場合は、オリジナルアーカイブへの変更が許可されます:''' * It contains non-free parts that cannot be redistributed. Remove those parts, and note it in the packaging. Often such packages use "dfsg" (which stands for Debian Free Software Guidelines) in the package name and/or versioning to indicate that non-free parts have been removed. * 再配布できないようなフリーでないものが含まれている場合は、それらが取り除かれて、パッケージの中で注意書きが書かれます。そのようなパッケージでは、フリーでない部分が取り除かれたことを示すために、パッケージ名やバージョン番号に"dfsg"(Debian Free Software Guidelinesの略称です)という名前がつけらることがあります。 * The authors only provide bzip2'ed source. * ソフトウェアの作者が、bzip2で圧縮されたソースのみを提供している場合。 * Just '''bunzip2''' the .tar.bz2 and '''gzip -9 ''' the resulting tar. * .tar.bz2ファイルを'''bunzip2'''にかけ、'''gzip -9 '''でtarファイルにします。 * The md5sums of the .tar you provide and the original .tar must match! * .tarファイルのmd5sum値をとり、オリジナルの.tarファイルと一致することを確認します。 * Eventually provide a get-orig-source rule in debian/rules that does this conversion automatically. * 結局のところこれらは、debian/rulesにget-orig-sourceを指定することで、自動的に行われます。 * Directly imported from SVN * SVNから直接取り込む場合。 * Provide get-orig-source in debian/rules. * debian/rulesにget-orig-sourceを指定します。 '''The following are ''not'' reasons to change the original tarball:''' '''以下は、オリジナルアーカイブへ変更を加える理由には''なりません'':''' * Wrong Directory Layout * ディレクトリの構成が適切ではない場合。 . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] '''dpkg-source''' is quite flexible and manages to produce the correct directory layout even if: . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] '''dpkg-source'''は以下のようなディレクトリ構成でも柔軟に対応します: * The directory inside the tarball is not named -. * ソースアーカイブの中のディレクトリ名が-でない場合。 * There is no subdirectory inside the tarball. * ソースアーカイブの中にサブディレクトリが存在しない場合。 * Files need to be removed to keep the .diff.gz small (e.g., files created by autotools). Everything that needs to be deleted should be removed in the '''clean''' rule. Since the .diff.gz is created with diff -u, you will not see removed files in the .diff.gz. * .diff.gzを小さくするために、ファイルを削除する必要がある場合(例えばautotoolsによって作成されたファイルなど)。削除が必要なファイルはすべて、'''clean'''ルールによって削除されるべきです。.diff.gzはdiff -uによって作成されるので、.diff.gzの中で削除されたファイルを見ることはないでしょう。 * Files need to be modified. Files that need to be modified should to go into .diff.gz. That is its purpose! * ファイルに修正を加えなければならない場合。修正はすべて.diff.gzを使って行うべきです。それがその差分ファイルの存在意義なのですから。 * Wrong permissions on files. You can use `debian/rules` to do this. * ファイルのパーミッションが間違っている場合。それは`debian/rules`で修正すべきです。 . [[attachment:UbuntuPackagingGuideJa/conventions/tip.png|{{attachment:UbuntuPackagingGuideJa/conventions/tip.png}}]] What do I do with an .orig.tar.gz that already includes a `debian/` dir? . Do not repackage it. You can ask the author(s) to delete the debian/ dir and provide a diff.gz instead. This makes it easier to review their work, and it separates packaging from program source. . [[attachment:UbuntuPackagingGuideJa/conventions/tip.png|{{attachment:UbuntuPackagingGuideJa/conventions/tip.png}}]] .orig.tar.gzファイルにすでに`debian/rules`ディレクトリが含まれている場合はどうすべきでしょうか? . それを再パッケージ化しないでください。プログラムの作者にdebian/ディレクトリを削除し、かわりにdiff.gzを提供するよう頼むとよいでしょう。これによりその作業の確認が楽になり、プログラムソースからパッケージに関わる部分を分離することができます。 . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] It is always a good idea to contact the program's author(s) and ask if you may correct autoconf issues, directory layout, an outdated Free Software Foundation address in COPYRIGHT files, or other things that are not specific to the packaging but would be convenient for you so you do not need to "patch" the source in .diff.gz. . [[attachment:UbuntuPackagingGuideJa/conventions/note.png|{{attachment:UbuntuPackagingGuideJa/conventions/note.png}}]] ソフトウェアの作者に連絡を取り、autoconfの問題やディレクトリの構成、COPYRIGHTファイルにあるFree Software Foundationの古いアドレス、その他パッケージングそのものには関係ないけれども.diff.gzでソースに"patch"を当てる必要がなくなるいろいろなものを修正してもらうことは、良いことでしょう。 <> == copyrightの取り扱い == The `debian/copyright` file should contain: `debian/copyright`ファイルには以下の内容が含まれているべきです: * The licensing information for ''all'' files in the source. Sometimes author(s) put a license in `COPYING` but have different licensing information for some files in the source. * ソースにある''すべての''ファイルのライセンス情報。ソースのいくつかのファイルに対して`COPYING`とは別のライセンスを与えている作者がたまにいます。 * The copyright holder(s) and year(s). * 著作権の保持者(holder)とその年(year)。 * The ''entire'' license unless it is one of the licenses found in `/usr/share/common-licenses`, in which case you should just include the preamble. * `/usr/share/common-licenses`にはないライセンスについては、''完全な''ライセンス文。その場合は、序文も含めておくべきです。 ||<:20%>,,<=,, ||<:60%>||<:20%> ,,=>,,|| ||<:20%>[[UbuntuPackagingGuideJa/basic-cdbs|CDBSによるパッケージング]]||<:60%>'''よくある間違い'''||<:20%> [[UbuntuPackagingGuideJa/ch04|debian/rules]]||