提示缺乏套件啦?别担忧,Homebrew 随时守候。git
$ brew install wget
Homebrew 会将套件安装到独立目录,并将文件软连接至/usr/local
。github
$ 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 的安装位置。ruby
轻松建立您的 Homebrew 程式。bash
$ brew create http://foo.com/bar-1.0.tgz Created /usr/local/Library/Formula/bar.rb
以 git、 ruby 为其筋骨,因此借助您的相关知识,自由修改,而且能够简单撤回您的调改或者合并上游更新。curl
$ brew edit wget # opens in $EDITOR!
Homebrew 的程式都是简单的 Ruby 脚本:ui
require "formula" class Wget < Formula homepage "http://www.gnu.org/software/wget/" url "http://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
来安装 gems、用brew
来搞定那些依赖包。url
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
打开终端窗口, 粘贴以上脚本。spa
脚本会解释它的做用,而后在您的确认下执行安装。高级安装选项请看 这里(须要10.5)。code