Mac OS X のパッケージ管理システムといえば、 MacPorts とか Fink があるけど今回は Homebrew をインストールしてみた。

環境: Mac OS X Lion

Ruby とインターネットにつながる環境があればらくらくインストールできる。
Ruby は最初から Mac OS X Lion に入っているから楽勝。


$ uname -svmr
Darwin 11.0.1 Darwin Kernel Version 11.0.1: Wed Jun 29 19:53:22 PDT 2011; root:xnu-1699.23.2~1/RELEASE_X86_64 x86_64
 
$ ruby -v
ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin11.0]

Mac OS X Lion に Homebrew をインストール。
公式サイトの Installation - GitHub 書いてある通りでOK。
途中で sudo によってパスワードを訊ねてくるので入力する。


$ ruby -e "$(curl -fsSL https://raw.github.com/gist/323731)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/Formula/...
/usr/local/Library/Homebrew/...
 
Press enter to continue
==> /usr/bin/sudo /bin/mkdir /usr/local
Password:
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local
==> /usr/bin/sudo /usr/bin/chgrp admin /usr/local
==> Downloading and Installing Homebrew...
==> Installation successful!
Now type: brew help

brew のヘルプを表示してみる。


$ brew help
Example usage:
  brew install FORMULA...
  brew uninstall FORMULA...
  brew search [foo]
  brew list [FORMULA...]
  brew update
  brew upgrade [FORMULA...]
  brew [info | home] [FORMULA...]
 
Troubleshooting:
  brew doctor
  brew install -vd FORMULA
  brew [--env | --config]
 
Brewing:
  brew create [URL [--no-fetch]]
  brew edit [FORMULA...]
  open https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
 
Further help:
  man brew
  brew home

brew のバージョンを表示してみる。


$ brew -v
0.8

試しに、 jhead というアプリを探してみる。


$ brew search jhead
jhead

jhead をインストールしてみる。


$ brew install jhead
==> Downloading http://www.sentex.net/~mwandel/jhead/jhead-2.90.tar.gz
######################################################################## 100.0%
==> make
==> chmod +x jhead
/usr/local/Cellar/jhead/2.90: 2 files, 76K, built in 2 seconds
 
$ jhead -V
Jhead version: 2.90   Compiled: Oct  9 2011
 
$ which jhead
/usr/local/bin/jhead

さくっと /usr/local/bin 以下にインストールされた。

お手軽で(・∀・)イイ!!

Ref.
- Homebrew — MacPorts driving you to drink? Try Homebrew!
- mxcl/homebrew - GitHub
- Home - GitHub
- Installation - GitHub

tags: mac_os_x homebrew

Posted by NI-Lab. (@nilab)