Scroll to navigation

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).

ファイル

List the files to install into each package and the directory they should be installed to. The format is a set of lines, where each line lists a file or files to install, and at the end of the line tells the directory it should be installed in. The name of the files (or directories) to install should be given relative to the current directory, while the installation directory is given relative to the package build directory. You may use wildcards in the names of the files to install.

明示的にインストール先を記述せず、ただ1つのファイル名もしくはワイルドカードパターンを指定した行を列挙した場合は、--autodest オプションが使われた時同様に dh_install は自動的に利用されるインストール先を推測します。

Used with the deprecated --list-missing and --fail-missing options. Please refer to dh_missing(1) for the documentation of this file.

オプション

Deprecated: Please use dh_missing --list-missing instead. If you use this option, dh_install will call dh_missing with that option after it has processed all the files. Please see dh_missing(1) for the documentation of this option.

This option is removed in compat 12.

Deprecated: Please use dh_missing --fail-missing instead. If you use this option, dh_install will call dh_missing with that option after it has processed all the files. Please see dh_missing(1) for the documentation of this option.

This option is removed in compat 12.

インストールするファイルを指定されたディレクトリ内で探します。

このオプションは、dh_auto_* にあるような --sourcedirectory とは異なる事に注意が必要です。このコマンドではあまりこのオプションは利用する機会がありません。というのも dh_install は互換性レベル v7 以上では自動的に debian/tmp へファイルを探しに行く為です。

Guess as the destination directory to install things to. If this is specified, you should not list destination directories in debian/package.install files or on the command line. Instead, dh_install will guess as follows:

まず、インストール元のファイル名の先頭から debian/tmp の文字列 (あるいは指定されていればソースディレクトリ名) を取り除きます。ファイル名が残っていれば、これをディレクトリ名としてその中にインストールします。つまり、ソースディレクトリとして debian/tmp/usr/bin が与えられると、ファイルのコピー先のディレクトリは debian/package/usr/ となります。ファイル名が debian/tmp/etc/passwd であれば、debian/package/etc/ へ行われます。

インストールするファイル (またはディレクトリ) と、どこへインストールするかについて列挙します。ファイルは dh_install が処理する最初のパッケージへインストールされます。

制限事項

dh_install はファイルやディレクトリをリネームできません。パッケージビルドツリー内のどこへでも望む場所へ、既に付けられた名前でそれらをインストールすることだけが可能です。

ですが、リネームは互換性レベル 9 以上で dh-exec を使うことで実現できます。dh-exec を使う debian/package.install ファイルの例は以下のようになります:

 #!/usr/bin/dh-exec
 debian/default.conf => /etc/my-package/start.conf

以下の 3 点に留意して下さい:

  • パッケージは互換性レベル 9 以降を使う必要があります (debhelper(7) 参照)
  • パッケージは dh-exec へのビルド依存が必要になります。
  • install ファイルは実行可能になっている必要があります。

参照

debhelper(7)

このプログラムは debhelper の一部です。

作者

Joey Hess <joeyh@debian.org>

2019-12-29 12.7.3