debパッケージの作成にチャレンジ
・
Debianベースのシステムでパッケージを自作する・
Debian 新メンテナガイドこの辺りを見ながら四苦八苦。作り方がRPMに比べて難しい、ややこしい、嫌になる。頭が混乱。慣れの問題? まず最初に最低限ビルドに必要そうな以下のパッケージをインストール
$ sudo apt-get -y install build-essential dh-make devscripts fakeroot patch diff \
patchutils dpatch devscripts autoconf automake libtool debhelper devscripts
鍵署名するなら "gnupg" も必要。
次にソースを展開したディレクトリに移動して
$ dh_make -e MailAddress -s -n
すると debian/ ディレクトリに雛形が作成される。
debian/control → パッケージの紹介分、依存関係
debian/copyright → 誰が作ったとか、著作権、ライセンスの記述
debian/changelog → バージョン、変更履歴を記述
debian/rules → ビルドの方法。触るな危険
これらのファイルを自分で適当に編集。rules は一般的な「./configure && make install」でインストールできる場合は触らなくても良い。終わったら
$ debuild -us -uc
これでコンパイルやらチェックやらが行われて、エラーがなければパッケージの構築完了。一からではなく *.dsc, *.orig.tar.gz, *.diff.gz からパッケージを作り直すなら
$ dpkg-source -x package.dsc
とするとソースが展開。(手動でパッチ当ててもいける?) 新しいバージョンの deb を作る時は、古いソースツリーの中で
$ uupdate -u new-1.1.tar.gz
とすると、新しいソースが展開されて debian/ ディレクトリが移植される
最後にUbuntuのリリース番号(レビジョン)のポリシーを見ておく
Ubuntu and Debian have slightly different package versioning schemes to avoid conflicting packages with the same source version. If a Debian package has been changed in Ubuntu, it has ubuntuX (where X is the Ubuntu revision number) appended to the end of the Debian version. So if the Debian hello package was changed by Ubuntu, the version string would be 2.1.1-1ubuntu1. If a package for the application does not exist in Debian, then the Ubuntu version is 0 (e.g., 2.1.1-0ubuntu1).
→The Ubuntu Packaging Guide
Debianと被らない物は「0ubuntu1」でいいのかな…
≪2008/08/16≫
いつの頃からか
$ debuild --linda -us -uc
debuild: unknown dpkg-buildpackage/debuild option: --linda
dpkg-buildpackage -rfakeroot -D -us -uc --linda
dpkg-buildpackage: unknown option or argument --linda
と言われるようになった。よくワカランが --linda を抜いとく