Ebuild

ebuild は、Gentoo Linux の Portage で使われるパッケージ管理用の Bash スクリプトである。

Ebuild

ebuild は、Gentoo LinuxPortage で使われるパッケージ管理用の Bash スクリプトである。

なお、Portage には同名のコマンドも存在するが、ここでは ebuild スクリプトに話を限定する。

概要

ebuild スクリプトは「(パッケージ名)-(バージョン)-(リビジョン).ebuild」という命名規則に従ったファイル名で、Portage ツリーの中の (カテゴリー名)/(パッケージ名) という ディレクトリ に納められる。ファイルの中にはパッケージの依存関係やライセンスなどのメタデータと実際のソフトウェアの構築手順が書かれている。構築に際して、Portage は使用されているアーキテクチャと事前に設定されたUSEフラグに従って細かい構成を選択する。これによって、バイナリーパッケージでは得られない構成の柔軟性が得られ、また最適化されたバイナリーの構築が可能となる。

Gentoo Portage リポジトリ にあるほとんどの ebuild はソースコードからプログラムをコンパイルするのに用いられる。しかし、中には mozilla-firefox-bin のようにバイナリパッケージをインストールするものや、ドキュメントやフォントのようなデータをインストールするものがある。

eclass

多くの ebuild に共通の処理を eclass というファイルにまとめてあり、それを継承(inherit)することで記述量を減らすことができる。 たとえば、Python で書かれたソフトウェアのパッケージは distutils という標準モジュールを利用してインストールされるものが多いが、このようなパッケージのために distutils.eclass というものが用意されており、これを利用するとほとんど具体的なインストール手順を ebuild スクリプトには書かなくて済む。

メタデータ

全ての ebuild で必須のメタデータは、

  • DESCRIPTION (パッケージの概要)
  • SRC_URI (ソフトウェア配布元)
  • LICENSE (ソフトウェアライセンス)
  • DEPEND (依存関係)

である。 依存関係には直接的なものだけを記述すれば、間接的に依存するパッケージは Portage が自動で辿る。

構築手順

ソースコードからの手動でのインストールに使われる手順と、ほぼ同じ処理が自動で実行される。

多くのパッケージでは、ソフトウェアの構築は大きく分けて「展開」「コンパイル」「インストール」の3段階で行われる。「展開」の段階では、主にダウンロードしたソースコードの tarball などを展開する。「コンパイル」の段階では、多くの場合、configure を実行し、make を実行する。「インストール」の段階では、多くの場合、make install を実行する。

なお、Portage では、sandbag と呼ばれる保護機能が標準で動作していて、すべての手順が完了するまでの間に、稼動中のルートファイルシステムには変更が及ばないようになっている。

関連項目

外部リンク

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.