2013-05-31 01:14:33 +00:00
|
|
|
class Beansdb < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Yet another distributed key-value storage system"
|
2014-06-01 01:27:43 +00:00
|
|
|
homepage "https://github.com/douban/beansdb"
|
|
|
|
url "https://github.com/douban/beansdb/archive/v0.6.tar.gz"
|
2015-08-03 12:55:31 +00:00
|
|
|
sha256 "b24512862f948d5191f5c43316a41f632bc386f43dcbb69b03ffffe95122a33e"
|
2013-05-31 01:14:33 +00:00
|
|
|
|
2014-06-01 01:27:43 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/douban/beansdb.git"
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
end
|
2013-05-31 01:14:33 +00:00
|
|
|
|
|
|
|
def install
|
2014-06-01 01:27:43 +00:00
|
|
|
ENV.append "CFLAGS", "-std=gnu89"
|
|
|
|
system "./autogen.sh" if build.head?
|
|
|
|
system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
|
2013-05-31 01:14:33 +00:00
|
|
|
system "make"
|
2014-06-01 01:27:43 +00:00
|
|
|
system "make", "install"
|
2013-05-31 01:14:33 +00:00
|
|
|
|
2014-06-01 01:27:43 +00:00
|
|
|
(var/"db/beansdb").mkpath
|
|
|
|
(var/"log").mkpath
|
2013-05-31 01:14:33 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<dict>
|
|
|
|
<key>SuccessfulExit</key>
|
|
|
|
<false/>
|
|
|
|
</dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_bin}/beansdb</string>
|
2013-05-31 01:14:33 +00:00
|
|
|
<string>-p</string>
|
|
|
|
<string>7900</string>
|
|
|
|
<string>-H</string>
|
|
|
|
<string>#{var}/db/beansdb</string>
|
|
|
|
<string>-T</string>
|
|
|
|
<string>1</string>
|
|
|
|
<string>-vv</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{var}</string>
|
|
|
|
<key>StandardErrorPath</key>
|
|
|
|
<string>#{var}/log/beansdb.log</string>
|
|
|
|
<key>StandardOutPath</key>
|
|
|
|
<string>#{var}/log/beansdb.log</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|