class Beansdb < Formula desc "Yet another distributed key-value storage system" homepage "https://github.com/douban/beansdb" url "https://github.com/douban/beansdb/archive/v0.6.tar.gz" sha256 "b24512862f948d5191f5c43316a41f632bc386f43dcbb69b03ffffe95122a33e" head do url "https://github.com/douban/beansdb.git" depends_on "autoconf" => :build depends_on "automake" => :build end def install ENV.append "CFLAGS", "-std=gnu89" system "./autogen.sh" if build.head? system "./configure", "--disable-dependency-tracking", "--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