Skip to content

Commit

Permalink
packetbeat: remove python
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Dec 16, 2024
1 parent 0074f54 commit 9cd41e5
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions Formula/p/packetbeat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Packetbeat < Formula

depends_on "go" => :build
depends_on "mage" => :build
depends_on "[email protected]" => :build

uses_from_macos "libpcap"

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 9cd41e5

Please sign in to comment.