packetbeat 5.0.1 (new formula)
Closes #7127. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
e991e67485
commit
b040b1bb25
1 changed files with 56 additions and 0 deletions
56
Formula/packetbeat.rb
Normal file
56
Formula/packetbeat.rb
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
class Packetbeat < Formula
|
||||||
|
desc "Lightweight Shipper for Network Data"
|
||||||
|
homepage "https://www.elastic.co/products/beats/packetbeat"
|
||||||
|
url "https://github.com/elastic/beats/archive/v5.0.1.tar.gz"
|
||||||
|
sha256 "707bea8d8eb8cc358bddfcaffa5e90da2a09fab00f2fc53608cc013c79743117"
|
||||||
|
|
||||||
|
head "https://github.com/elastic/beats.git"
|
||||||
|
|
||||||
|
depends_on "go" => :build
|
||||||
|
|
||||||
|
def install
|
||||||
|
gopath = buildpath/"gopath"
|
||||||
|
(gopath/"src/github.com/elastic/beats").install Dir["{*,.git,.gitignore}"]
|
||||||
|
|
||||||
|
ENV["GOPATH"] = gopath
|
||||||
|
|
||||||
|
cd gopath/"src/github.com/elastic/beats/packetbeat" do
|
||||||
|
system "make"
|
||||||
|
libexec.install "packetbeat"
|
||||||
|
|
||||||
|
inreplace "packetbeat.yml", "packetbeat.interfaces.device: any", "packetbeat.interfaces.device: en0"
|
||||||
|
|
||||||
|
(etc/"packetbeat").install("packetbeat.yml", "packetbeat.template.json", "packetbeat.template-es2x.json")
|
||||||
|
end
|
||||||
|
|
||||||
|
(bin/"packetbeat").write <<-EOS.undent
|
||||||
|
#!/bin/sh
|
||||||
|
exec #{libexec}/packetbeat -path.config #{etc}/packetbeat \
|
||||||
|
-path.home #{prefix} -path.logs #{var}/log/packetbeat \
|
||||||
|
-path.data #{var}/packetbeat $@
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
plist_options :manual => "packetbeat"
|
||||||
|
|
||||||
|
def plist; <<-EOS.undent
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
|
||||||
|
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>Label</key>
|
||||||
|
<string>#{plist_name}</string>
|
||||||
|
<key>Program</key>
|
||||||
|
<string>#{opt_bin}/packetbeat</string>
|
||||||
|
<key>RunAtLoad</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
|
EOS
|
||||||
|
end
|
||||||
|
|
||||||
|
test do
|
||||||
|
system "#{bin}/packetbeat", "--devices"
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue