require 'formula' class Tmux < Formula homepage 'http://tmux.sourceforge.net' url 'http://sourceforge.net/projects/tmux/files/tmux/tmux-1.7/tmux-1.7.tar.gz' sha1 'ee6942a1bc3fc650036f26921d80bc4b73d56df6' head 'git://tmux.git.sourceforge.net/gitroot/tmux/tmux' depends_on 'pkg-config' => :build depends_on 'libevent' if build.head? depends_on :automake depends_on :libtool end def install system "sh", "autogen.sh" if build.head? ENV.append "LDFLAGS", '-lresolv' system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}", "--sysconfdir=#{etc}" system "make install" (prefix+'etc/bash_completion.d').install "examples/bash_completion_tmux.sh" => 'tmux' # Install addtional meta file prefix.install 'NOTES' end def caveats; <<-EOS.undent Additional information can be found in: #{prefix}/NOTES EOS end def test system "#{bin}/tmux", "-V" end end