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-03-10 15:38:15 +00:00
|
|
|
revision 1
|
|
|
|
sha1 "53a44dbefeeff41290b56aba3d19cf6e023d0365" => :mavericks
|
|
|
|
sha1 "401465576c5d57e0e57c2c4cf4a9d51a4f657f6f" => :mountain_lion
|
|
|
|
sha1 "28ef892dd211dbb8f9262b77f6c687c6ddafe33f" => :lion
|
2013-12-04 06:24:52 +00:00
|
|
|
end
|
|
|
|
|
2014-02-25 23:13:10 +00:00
|
|
|
devel do
|
2014-03-12 00:07:38 +00:00
|
|
|
url "http://get.influxdb.org/influxdb-0.5.0-rc.5.src.tar.gz"
|
|
|
|
sha1 "8dd4a61d7557446b0846921c9d93111445d35a72"
|
2014-02-25 23:13:10 +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-02-25 07:00:56 +00:00
|
|
|
flex = Formula["flex"].bin/"flex"
|
|
|
|
bison = Formula["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-03-10 15:12:48 +00:00
|
|
|
s.gsub! "/tmp/influxdb/development/wal", "#{var}/influxdb/wal"
|
2014-03-06 05:28:31 +00:00
|
|
|
s.gsub! "./admin", "#{opt_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>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_bin}/influxdb</string>
|
2013-11-05 19:42:21 +00:00
|
|
|
<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
|