diff --git a/Formula/f/filebeat.rb b/Formula/f/filebeat.rb index 69f79e0181359..71c2001e3fdaf 100644 --- a/Formula/f/filebeat.rb +++ b/Formula/f/filebeat.rb @@ -20,8 +20,8 @@ class Filebeat < Formula depends_on "go" => :build depends_on "mage" => :build - depends_on "python@3.12" => :build + uses_from_macos "python" => :build uses_from_macos "rsync" => :build def install @@ -39,8 +39,8 @@ def install system "mage", "-v", "build" system "mage", "-v", "update" - (etc/"filebeat").install Dir["filebeat.*", "fields.yml", "modules.d"] - (etc/"filebeat"/"module").install Dir["build/package/modules/*"] + pkgetc.install Dir["filebeat.*", "fields.yml", "modules.d"] + (pkgetc/"module").install Dir["build/package/modules/*"] (libexec/"bin").install "filebeat" prefix.install "build/kibana" end @@ -55,8 +55,7 @@ def install "$@" EOS - chmod 0555, bin/"filebeat" # generate_completions_from_executable fails otherwise - generate_completions_from_executable(bin/"filebeat", "completion", shells: [:bash, :zsh]) + generate_completions_from_executable(libexec/"bin/filebeat", "completion", shells: [:bash, :zsh]) end service do @@ -92,8 +91,8 @@ def install log_file.append_lines "foo bar baz" sleep 5 - assert_predicate testpath/"meta.json", :exist? - assert_predicate testpath/"registry/filebeat", :exist? + assert_path_exists testpath/"meta.json" + assert_path_exists testpath/"registry/filebeat" ensure Process.kill("TERM", pid) Process.wait(pid) diff --git a/Formula/h/heartbeat.rb b/Formula/h/heartbeat.rb index 9cdc7680ca776..9f6b39a3e7eaf 100644 --- a/Formula/h/heartbeat.rb +++ b/Formula/h/heartbeat.rb @@ -18,8 +18,8 @@ class Heartbeat < Formula depends_on "go" => :build depends_on "mage" => :build - depends_on "python@3.12" => :build + uses_from_macos "python" => :build uses_from_macos "netcat" => :test def install @@ -33,7 +33,7 @@ def install ENV.deparallelize system "mage", "-v", "update" - (etc/"heartbeat").install Dir["heartbeat.*", "fields.yml"] + pkgetc.install Dir["heartbeat.*", "fields.yml"] (libexec/"bin").install "heartbeat" end @@ -47,8 +47,7 @@ def install "$@" EOS - chmod 0555, bin/"heartbeat" # generate_completions_from_executable fails otherwise - generate_completions_from_executable(bin/"heartbeat", "completion", shells: [:bash, :zsh]) + generate_completions_from_executable(libexec/"bin/heartbeat", "completion", shells: [:bash, :zsh]) end def post_install diff --git a/Formula/p/packetbeat.rb b/Formula/p/packetbeat.rb index 97943e1ab54b9..57aa863e4b697 100644 --- a/Formula/p/packetbeat.rb +++ b/Formula/p/packetbeat.rb @@ -18,8 +18,8 @@ class Packetbeat < Formula depends_on "go" => :build depends_on "mage" => :build - depends_on "python@3.12" => :build + uses_from_macos "python" => :build uses_from_macos "libpcap" def install @@ -35,7 +35,7 @@ def install 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,8 +50,7 @@ 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 @@ -59,11 +58,7 @@ def install 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