diff options
| author | Pivotal Labs | 2013-11-05 14:42:21 -0500 |
|---|---|---|
| committer | Mike McQuaid | 2013-11-07 11:30:30 +0000 |
| commit | bbf1631542ec1746b35c525e988a15c55caab991 (patch) | |
| tree | b232be251ff8c589693237a89c8c2cd6ac693733 /Library | |
| parent | 1b941207253fe3584f3c4576a7ce619ba0cf2d29 (diff) | |
| download | homebrew-bbf1631542ec1746b35c525e988a15c55caab991.tar.bz2 | |
influxdb 0.0.7 (new formula)
Closes #24009.
Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/influxdb.rb | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/Library/Formula/influxdb.rb b/Library/Formula/influxdb.rb new file mode 100644 index 000000000..eb234da7a --- /dev/null +++ b/Library/Formula/influxdb.rb @@ -0,0 +1,71 @@ +require "formula" + +class Influxdb < Formula + homepage "http://influxdb.org" + url "http://get.influxdb.org/src/influxdb-0.0.7.tar.gz" + sha1 "2ee3e88112a9f3f7fa4423acbdb686711bd42595" + + depends_on "leveldb" + depends_on "protobuf" => :build + depends_on "bison" => :build + depends_on "flex" => :build + depends_on "go" => :build + + fails_with :clang do + cause "clang: error: argument unused during compilation: '-fno-eliminate-unused-debug-types'" + end + + def install + ENV["GOPATH"] = buildpath + + system "go build src/server/server.go" + + inreplace "config.json.sample" do |s| + s.gsub! "/tmp/influxdb/development/db", "#{var}/influxdb/data" + s.gsub! "/tmp/influxdb/development/raft", "#{var}/influxdb/raft" + s.gsub! "./admin/", "#{share}/admin/" + end + + bin.install "server" => "influxdb" + etc.install "config.json.sample" => "influxdb.conf" + share.install "admin" + + %w[influxdb infludxb/data influxdb/raft].each { |p| (var+p).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_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 + system "#{bin}/influxdb -v" + end +end |
