OS X用パッケージマネージャー
HomebrewはAppleが用意していないあなたが必要なものをインストールします。
$ brew install wget
Homebrewは個別のディレクトリにパッケージをインストールし、それらへのシンボリックリンクを/usr/local
に作ります。
$ cd /usr/local
$ find Cellar
Cellar/wget/1.15
Cellar/wget/1.15/bin/wget
Cellar/wget/1.15/share/man/man1/wget.1
$ ls -l bin
bin/wget -> ../Cellar/wget/1.15/bin/wget
Homebrewは決められたディレクトリの中だけにファイルをインストールします。また、Homebrewをインストールする場所は自由に決めることができます。
Homebrewのパッケージは簡単に作成できます。
$ brew create http://foo.com/bar-1.0.tgz
Created /usr/local/Library/Formula/bar.rb
HomebrewはすべてGitとRubyで動いているため、あなたが既に持っている知識で変更したり更新をマージしたりできます。
$ brew edit wget # opens in $EDITOR!
HomebrewのformulaはシンプルなRubyスクリプトです:
class Wget < Formula
homepage "https://www.gnu.org/software/wget/"
url "https://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
sha1 "f3c925f19dfe5ed386daae4f339175c108c50574"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
end
HomebrewはOS Xの機能を補完します。gem
コマンドでgemを、そしてbrew
コマンドでそれらの依存関係をインストールします。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
これをターミナルのプロンプトに貼り付けてください。
スクリプトは何をするのか説明し、実行する前に一度中断します。こちらでインストールオプションを確認できます(10.5が必要)。
Original code by Max Howell. Website by Rémi Prévost. Translation by Ryuichi Okumura.