DH_INSTALL(1) | Debhelper | DH_INSTALL(1) |
dh_install - パッケージビルドディレクトリにファイルをインストールする
dh_install [-Xitem] [--autodest] [--sourcedir=dir] [debhelper options] [file|dir ... destdir]
dh_install はパッケージビルドディレクトリにファイルをインストールする debhelper プログラムです。なお、沢山の dh_install* コマンドは、文章や例、あるいは man ページ等のファイルの種類に応じたインストールを担います。こちらのコマンドは、特定の処理を行う為に各々専用の処理を持っていますので、可能な限り、これらのファイルをインストールするときには、dh_install* コマンドを使ってください。なお、dh_install は、ファイルにあわせた特別な処理が不要なファイルをインストールする時に使うと良いでしょう。dh_install は、以前存在した dh_movefiles コマンドを置き換えるコマンドです。
このプログラムは2つの用途で利用されます。1つ目は、単に1つ2つのファイルについて開発元 (upstream) の Makefile がインストールをしようとしない時、dh_install を使ってこれらのファイルを目的の場所へ移動できます。2つ目としては、複数のバイナリパッケージをビルドするような大きなパッケージの元で利用する場合であり、開発元 (upstream) の Makefile により、debian/tmp へ一旦インストールしてから、dh_install を使って適切なパッケージビルドディレクトリへディレクトリとファイルをコピーするのに使うというものです。
From debhelper compatibility level 7 on, dh_install will fall back to looking in debian/tmp for files, if it does not find them in the current directory (or wherever you've told it to look using --sourcedir).
明示的にインストール先を記述せず、ただ1つのファイル名もしくはワイルドカードパターンを指定した行を列挙した場合は、--autodest オプションが使われた時同様に dh_install は自動的に利用されるインストール先を推測します。
This option is removed in compat 12.
This option is removed in compat 12.
このオプションは、dh_auto_* にあるような --sourcedirectory とは異なる事に注意が必要です。このコマンドではあまりこのオプションは利用する機会がありません。というのも dh_install は互換性レベル v7 以上では自動的に debian/tmp へファイルを探しに行く為です。
まず、インストール元のファイル名の先頭から debian/tmp の文字列 (あるいは指定されていればソースディレクトリ名) を取り除きます。ファイル名が残っていれば、これをディレクトリ名としてその中にインストールします。つまり、ソースディレクトリとして debian/tmp/usr/bin が与えられると、ファイルのコピー先のディレクトリは debian/package/usr/ となります。ファイル名が debian/tmp/etc/passwd であれば、debian/package/etc/ へ行われます。
dh_install はファイルやディレクトリをリネームできません。パッケージビルドツリー内のどこへでも望む場所へ、既に付けられた名前でそれらをインストールすることだけが可能です。
ですが、リネームは互換性レベル 9 以上で dh-exec を使うことで実現できます。dh-exec を使う debian/package.install ファイルの例は以下のようになります:
#!/usr/bin/dh-exec debian/default.conf => /etc/my-package/start.conf
以下の 3 点に留意して下さい:
このプログラムは debhelper の一部です。
Joey Hess <joeyh@debian.org>
2019-02-23 | 12.1.1 |