homebrew-core/Formula/influxdb.rb
BrewTestBot 95e49a4936 influxdb: update 0.5.6 bottle.
Closes Homebrew/homebrew#28261.

Signed-off-by: Brett Koonce <koonce@gmail.com>
2014-04-08 22:00:01 -05:00

80 lines
2.3 KiB
Ruby

require "formula"
class Influxdb < Formula
homepage "http://influxdb.org"
url "http://get.influxdb.org/influxdb-0.5.6.src.tar.gz"
sha1 "4648493900c14f9b1d66bd6550286449ebb3a806"
bottle do
sha1 "716280592919111dc42e634de74472397e7413d0" => :mavericks
sha1 "7df05e3de7720ab56a3582f90cfd18518aa5c1af" => :mountain_lion
sha1 "68ebbd6d869f155583a5256a5b350e5b62a2d776" => :lion
end
depends_on "leveldb"
depends_on "protobuf" => :build
depends_on "bison" => :build
depends_on "flex" => :build
depends_on "go" => :build
def install
ENV["GOPATH"] = buildpath
flex = Formula["flex"].bin/"flex"
bison = Formula["bison"].bin/"bison"
system "./configure", "--with-flex=#{flex}", "--with-bison=#{bison}"
system "make", "dependencies", "protobuf", "parser"
system "go", "build", "daemon"
inreplace "config.toml.sample" do |s|
s.gsub! "/tmp/influxdb/development/db", "#{var}/influxdb/data"
s.gsub! "/tmp/influxdb/development/raft", "#{var}/influxdb/raft"
s.gsub! "/tmp/influxdb/development/wal", "#{var}/influxdb/wal"
s.gsub! "./admin", "#{opt_share}/admin"
end
bin.install "daemon" => "influxdb"
etc.install "config.toml.sample" => "influxdb.conf"
share.install "admin"
(var/"influxdb/data").mkpath
(var/"influxdb/raft").mkpath
end
plist_options :manual => "influxdb -config=#{HOMEBREW_PREFIX}/etc/influxdb.conf"
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>
<string>#{opt_bin}/influxdb</string>
<string>-config=#{etc}/influxdb.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>WorkingDirectory</key>
<string>#{var}</string>
<key>StandardErrorPath</key>
<string>#{var}/log/influxdb.log</string>
<key>StandardOutPath</key>
<string>#{var}/log/influxdb.log</string>
</dict>
</plist>
EOS
end
test do
system "#{bin}/influxdb", "-v"
end
end