mac os brew

 

  • Homebrew installs the stuff you need that Apple didn’t.

    $ brew install wget
  • Homebrew installs packages to their own directory and then symlinks their files into /usr/local.

    $ cd /usr/local $ find Cellar Cellar/wget/1.12 Cellar/wget/1.12/bin/wget Cellar/wget/1.12/share/man/man1/wget.1  $ ls -l bin bin/wget -> ../Cellar/wget/1.12/bin/wget
  • Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.

  • Trivially create your own Homebrew packages.

    $ brew create http://foo.com/bar-1.0.tgz Created /usr/local/Library/Formula/bar.rb 
  • It's all git and ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.

    $ brew edit wget # opens in $EDITOR!
  • Homebrew formula are simple Ruby scripts:

    require 'formula'  class Wget < Formula   homepage 'http://www.gnu.org/wget/'   url 'http://ftp.gnu.org/wget-1.12.tar.gz'   md5 '308a5476fc096a8a525d07279a6f6aa3'    def install     system "./configure --prefix=#{prefix}"     system 'make install'   end end
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章