Homebrew
Below is an excerpt from http://www.engineyard.com/blog/2010/homebrew-os-xs-missing-package-manager/:
The first (and only) dependency that Homebrew has is the OS X Developer Tools, which are on the OS X installer disc, and available from Apple as a free download.
Unless you have a reason not to, the easiest place to install Homebrew is in /usr/local. You can do that in just a few steps on the command line:
- Take ownership of /usr/local so you don't have to sudo
sudo chown -R `whoami` /usr/local
- Fix the permissions on your mysql installation, if you have one
sudo chown -R mysql:mysql /usr/local/mysql*
- Download and install Homebrew from github
curl -L http://github.com/mxcl/homebrew/tarball/master | tar xz --strip 1 -C /usr/local
Once you’ve done that, you’re good to go! Assuming /usr/local/bin is in your PATH, feel free to try it out:
brew install wget brew info git
The Homebrew wiki also has more about integrating with RubyGems, CPAN, and Python’s EasyInstall.
Keeping your copy of Homebrew up to date is easy, too:
brew install git brew update
Once you have git installed, you can just run brew update any time you want to pull down the latest formulae.
Here is another good overview of setting your mac up for Homebrew http://www.bigfastblog.com/homebrew-intro-to-the-mac-os-x-package-installer
How to install a particular version of a package
brew versions FORMULA
cd `brew --prefix`
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions"
brew install FORMULA
brew switch FORMULA VERSION
git checkout -- Library/Formula/FORMULA.rb # reset formula
## Example: Using Subversion 1.6.17
#
# $ brew versions subversion
# 1.7.3 git checkout f8bf2f3 /usr/local/Library/Formula/subversion.rb
# 1.7.2 git checkout d89bf83 /usr/local/Library/Formula/subversion.rb
# 1.6.17 git checkout 6e2d550 /usr/local/Library/Formula/subversion.rb
# 1.6.16 git checkout 83ed494 /usr/local/Library/Formula/subversion.rb
# 1.6.15 git checkout 809a18a /usr/local/Library/Formula/subversion.rb
# 1.6.13 git checkout 7871a99 /usr/local/Library/Formula/subversion.rb
# 1.6.12 git checkout c99b3ac /usr/local/Library/Formula/subversion.rb
# 1.6.6 git checkout 8774131 /usr/local/Library/Formula/subversion.rb
# 1.6.5 git checkout a82e823 /usr/local/Library/Formula/subversion.rb
# 1.6.3 git checkout 6b6d369 /usr/local/Library/Formula/subversion.rb
# $ cd `brew --prefix`
# $ git checkout 6e2d550 /usr/local/Library/Formula/subversion.rb
# $ brew install subversion
# $ brew switch subversion 1.6.17
# $ git checkout -- Library/Formula/subversion.rb