#title CDBSによるパッケージング CDBS is a tool that uses debhelper to make building and maintaining Debian packages even easier. It has many advantages: CDBSはdebhelperを利用し、より簡単にDebianパッケージの作成と管理を行うためのツールです。これには多くの利点があります: * It produces a short, readable, and efficient `debian/rules` * 短く、読みやすく、効率的な`debian/rules`を生成します。 * It automates debhelper and autotools for you, so you do not have to worry about repetitive tasks * debhelperとautotoolsを自動化します。繰り返し手作業を行う必要はありません。 * It helps you focus on more important packaging problems, because it helps without limiting customization * カスタマイズに制限がないので、パッケージングで遭遇するより重要な問題点を重点的に助けてくれます。 * Its classes have been well tested, so you can avoid dirty hacks to solve common problems * よくテストされたクラスがあり、よくある問題を解決するために小ずるい回避策を講じる必要はありません。 * Switching to CDBS is easy * CDBSへの移行は簡単に行えます。 * It is extensible * 高い拡張性を持っています。 <> == CDBSを利用する == Using CDBS for Ubuntu packages is very easy. After adding '''cdbs''' to the Build-Depends in `debian/control`, a basic `debian/rules` file using CDBS can fit in 2 lines. For a simple C/C++ application with no extra rules, such as '''hello''', `debian/rules` can look like this : UbuntuパッケージでCDBSを使う方法はとても簡単です。`debian/control`のBuild-Dpendsに'''cdbs'''を追加すれば、CDBSを利用した基本的な`debian/rules`ファイルは2行に収まります。'''hello'''のような拡張ルールのないシンプルなC/C++アプリケーションの場合、`debian/rules`は次のようになります: {{{ #!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/autotools.mk }}} That is all you need to build the program! CDBS handles installing and cleaning. You can then use the `.install` and `.info` files to tune your package with the usual debhelper functions in the various sections for `debian/rules`. これだけでビルドするために必要なものがそろっています。CDBSはインストールと掃除を適切に行ってくれます。`debian/rules`のさまざまなセクションに対して、debhelperの関数を使ってパッケージにあわせて調整を行いたい場合は、`.install`ファイルや`.info`ファイルを使うこともできます。 . [[attachment:UbuntuPackagingGuideJa/conventions/warning.png|{{attachment:UbuntuPackagingGuideJa/conventions/warning.png}}]] Do not use DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes to automatically change `debian/control`. It can cause bad things, and Debian considers it a reason to reject a package from entering the archives. See [[http://ftp-master.debian.org/REJECT-FAQ.html|http://ftp-master.debian.org/REJECT-FAQ.html]] for more information. . [[attachment:UbuntuPackagingGuideJa/conventions/warning.png|{{attachment:UbuntuPackagingGuideJa/conventions/warning.png}}]] `debian/control`を自動で変更するために DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes を使用しないでください。これはよくないことの原因になりうるので、Debianはアーカイブからそのパッケージを排除する一つの理由と考えています。詳しいことは[[http://ftp-master.debian.org/REJECT-FAQ.html|http://ftp-master.debian.org/REJECT-FAQ.html]]を読んでください。 As you can see, CDBS mostly works by including `.mk` Makefiles in `debian/rules`. The '''cdbs''' package provides such files in `/usr/share/cdbs/1/` that allow you to do quite a lot of packaging tasks. Other packages, such as '''quilt''', add modules to CDBS and can be used as Build-Depends. Note that you can also use your own CDBS rules and include them in the package. The most useful modules included with the '''cdbs''' package are: 見るとわかるように、CDBSは`debian/rules`に`.mk`というMakefileを読み込むことで、ほとんどのことを行っています。'''cdbs'''パッケージは`/usr/share/cdbs/1/`にそれらのファイルを提供し、数多くのパッケージングの作業を行ってくれます。'''quilt'''のようないくつかのパッケージはCDBSにモジュールを追加し、Build-Dpendsで指定することで利用できます。自分自身でCDBSルールを作成し、パッケージで読み込むこともできます。'''cdbs'''でも便利なモジュールは次のようになっています: * `rules/debhelper.mk`: Calls debhelper in all required sections * `rules/debhelper.mk`: 必要になるセクションでdebhelperを呼び出してくれます。 * `rules/dpatch.mk`: Allows you to use dpatch to ease patching the source * `rules/dpatch.mk`: ソースに簡単にパッチを適用してくれるdpatchを使うことができます。 * `rules/simple-patchsys.mk`: Provides a very easy way to patch the source * `rules/simple-patchsys.mk`: ソースにパッチを適用するとても簡単な方法を適用してくれます。 * `rules/tarball.mk`: Allows you to build packages using the compressed tarball in the package * `rules/tarball.mk`: アーカイブファイルを圧縮してパッケージを作成してくれます。 * `class/autotools.mk`: Calls autotools in all required sections * `class/autotools.mk`: 必要になるセクションでautotoolsを呼び出してくれます。 * `class/gnome.mk`: Builds GNOME programs (requires the proper Build-Depends in `debian/control`) * `class/gnome.mk`: GNOMEプログラムをビルドします(`debian/control`のBuild-Dpendsに必要なものを指定してくれます) * `class/kde.mk`: Builds KDE programs (requires the proper Build-Depends in `debian/control`) * `class/kde.mk`: KDEプログラムをビルドします(`debian/control`のBuild-Dpendsに必要なものを指定してくれます) * `class/python-distutils.mk`: Facilitates packaging Python programs * `class/python-distutils.mk`: Pythonプログラムのパッケージングを手助けしてくれます。 <> == さらなる情報 == For more information on CDBS, see Marc Dequènes's guide at [[https://perso.duckcorp.org/duck/cdbs-doc/cdbs-doc.xhtml|https://perso.duckcorp.org/duck/cdbs-doc/cdbs-doc.xhtml]]. CDBSに関する詳しい情報は、[[https://perso.duckcorp.org/duck/cdbs-doc/cdbs-doc.xhtml|https://perso.duckcorp.org/duck/cdbs-doc/cdbs-doc.xhtml]]にあるMarc Dequènesのガイドを参考にしてください。 ||<:20%>,,<=,, ||<:60%>||<:20%> ,,=>,,|| ||<:20%>[[UbuntuPackagingGuideJa/basic-debhelper|Debhelperによるパッケージング]]||<:60%>'''CDBSによるパッケージング'''||<:20%> [[UbuntuPackagingGuideJa/basic-mistakes|よくある間違い]]||