require 'formula' class Beansdb < Formula homepage 'https://github.com/douban/beansdb' head 'https://github.com/douban/beansdb.git', :branch => 'master' url 'https://github.com/douban/beansdb/archive/v0.6.tar.gz' sha1 '9099ce607ff3c3eba251ee34ae65a08c4e3715b9' depends_on :autoconf depends_on :automake def install ENV.append 'CFLAGS', '-std=gnu89' system "./autogen.sh" system "./configure", "--prefix=#{prefix}" system "make" system "make install" (var + 'db/beansdb').mkpath (var + 'log').mkpath end def plist; <<-EOS.undent KeepAlive SuccessfulExit Label #{plist_name} ProgramArguments #{opt_bin}/beansdb -p 7900 -H #{var}/db/beansdb -T 1 -vv RunAtLoad WorkingDirectory #{var} StandardErrorPath #{var}/log/beansdb.log StandardOutPath #{var}/log/beansdb.log EOS end end