-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0074f54
commit 9cd41e5
Showing
1 changed file
with
3 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ class Packetbeat < Formula | |
|
||
depends_on "go" => :build | ||
depends_on "mage" => :build | ||
depends_on "[email protected]" => :build | ||
|
||
uses_from_macos "libpcap" | ||
|
||
|
@@ -27,15 +26,13 @@ def install | |
rm_r("x-pack") | ||
|
||
cd "packetbeat" do | ||
# prevent downloading binary wheels during python setup | ||
system "make", "PIP_INSTALL_PARAMS=--no-binary :all", "python-env" | ||
system "mage", "-v", "build" | ||
ENV.deparallelize | ||
system "mage", "-v", "update" | ||
|
||
inreplace "packetbeat.yml", "packetbeat.interfaces.device: any", "packetbeat.interfaces.device: en0" | ||
|
||
(etc/"packetbeat").install Dir["packetbeat.*", "fields.yml"] | ||
pkgetc.install Dir["packetbeat.*", "fields.yml"] | ||
(libexec/"bin").install "packetbeat" | ||
prefix.install "_meta/kibana" | ||
end | ||
|
@@ -50,20 +47,15 @@ def install | |
"$@" | ||
SH | ||
|
||
chmod 0555, bin/"packetbeat" # generate_completions_from_executable fails otherwise | ||
generate_completions_from_executable(bin/"packetbeat", "completion", shells: [:bash, :zsh]) | ||
generate_completions_from_executable(libexec/"bin/packetbeat", "completion", shells: [:bash, :zsh]) | ||
end | ||
|
||
service do | ||
run opt_bin/"packetbeat" | ||
end | ||
|
||
test do | ||
eth = if OS.mac? | ||
"en" | ||
else | ||
"eth" | ||
end | ||
eth = OS.mac? ? "en" : "eth" | ||
assert_match "0: #{eth}0", shell_output("#{bin}/packetbeat devices") | ||
assert_match version.to_s, shell_output("#{bin}/packetbeat version") | ||
end | ||
|