homebrew-core/Formula/influxdb.rb
BrewTestBot aeb631718f influxdb: update 0.5.1 bottle.
Closes Homebrew/homebrew#27860.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2014-03-25 17:08:57 +00:00

80 lines
2.3 KiB
Ruby

require "formula"
class Influxdb < Formula
homepage "http://influxdb.org"
url "http://get.influxdb.org/influxdb-0.5.1.src.tar.gz"
sha1 "71ea1c187ead04620330ae15aadd5bd6f190950d"
bottle do
sha1 "d8f4c8a13ffa9e72d597457f136d161d7ffe175b" => :mavericks
sha1 "0abd67ed3c3a3beabe202d030dea16701188c704" => :mountain_lion
sha1 "a93b0df3a9177bd94bd843f7486c140c1aae8379" => :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