2013-11-05 19:42:21 +00:00
|
|
|
require "formula"
|
|
|
|
|
|
|
|
class Influxdb < Formula
|
|
|
|
homepage "http://influxdb.org"
|
2014-01-30 22:07:16 +00:00
|
|
|
url "http://get.influxdb.org/influxdb-0.4.1.src.tar.gz"
|
|
|
|
sha1 "f452cfce6e08f56e0fd6071d2a127446c165e08b"
|
2013-12-06 21:41:15 +00:00
|
|
|
|
2013-12-04 06:24:52 +00:00
|
|
|
bottle do
|
2014-01-31 18:13:11 +00:00
|
|
|
sha1 "90d21ae22304b058954ce5deaba6b3f9c77eb16c" => :mavericks
|
|
|
|
sha1 "d38c2781c2f81cb2ad5ad12e8789d511235ec908" => :mountain_lion
|
|
|
|
sha1 "be6df288b6d385c27e48ba221a12970be0eb0beb" => :lion
|
2013-12-04 06:24:52 +00:00
|
|
|
end
|
|
|
|
|
2013-11-05 19:42:21 +00:00
|
|
|
depends_on "leveldb"
|
|
|
|
depends_on "protobuf" => :build
|
|
|
|
depends_on "bison" => :build
|
|
|
|
depends_on "flex" => :build
|
|
|
|
depends_on "go" => :build
|
|
|
|
|
|
|
|
def install
|
|
|
|
ENV["GOPATH"] = buildpath
|
|
|
|
|
2014-01-17 23:02:12 +00:00
|
|
|
flex = Formula.factory("flex").bin/"flex"
|
|
|
|
bison = Formula.factory("bison").bin/"bison"
|
2013-12-02 22:17:11 +00:00
|
|
|
|
|
|
|
system "./configure", "--with-flex=#{flex}", "--with-bison=#{bison}"
|
2014-01-17 23:02:12 +00:00
|
|
|
system "make", "dependencies", "protobuf", "parser"
|
|
|
|
system "go", "build", "daemon"
|
2013-11-05 19:42:21 +00:00
|
|
|
|
2014-01-17 19:00:35 +00:00
|
|
|
inreplace "config.toml.sample" do |s|
|
2013-11-05 19:42:21 +00:00
|
|
|
s.gsub! "/tmp/influxdb/development/db", "#{var}/influxdb/data"
|
|
|
|
s.gsub! "/tmp/influxdb/development/raft", "#{var}/influxdb/raft"
|
2014-01-06 20:22:22 +00:00
|
|
|
s.gsub! "./admin", "#{opt_prefix}/share/admin"
|
2013-11-05 19:42:21 +00:00
|
|
|
end
|
|
|
|
|
2014-01-17 19:00:35 +00:00
|
|
|
bin.install "daemon" => "influxdb"
|
|
|
|
etc.install "config.toml.sample" => "influxdb.conf"
|
2013-11-05 19:42:21 +00:00
|
|
|
share.install "admin"
|
|
|
|
|
2014-01-17 23:02:12 +00:00
|
|
|
(var/"influxdb/data").mkpath
|
|
|
|
(var/"influxdb/raft").mkpath
|
2013-11-05 19:42:21 +00:00
|
|
|
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_prefix}/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
|
2014-01-17 23:02:12 +00:00
|
|
|
system "#{bin}/influxdb", "-v"
|
2013-11-05 19:42:21 +00:00
|
|
|
end
|
|
|
|
end
|