heartbeat: install metafiles properly and unify pattern with other beats

This commit is contained in:
Tyler Langlois 2018-03-20 11:28:41 -06:00 committed by commitay
parent 1abb95d47f
commit f759d1ebf5

View file

@ -37,20 +37,21 @@ class Heartbeat < Formula
# prevent downloading binary wheels during python setup
system "make", "PIP_INSTALL_COMMANDS=--no-binary :all", "python-env"
system "make", "DEV_OS=darwin", "update"
(libexec/"bin").install "heartbeat"
libexec.install "_meta/kibana"
(etc/"heartbeat").install Dir["heartbeat*.{json,yml}", "fields.yml"]
prefix.install_metafiles
(etc/"heartbeat").install Dir["heartbeat.*", "fields.yml"]
(libexec/"bin").install "heartbeat"
prefix.install "_meta/kibana"
end
prefix.install_metafiles buildpath/"src/github.com/elastic/beats"
(bin/"heartbeat").write <<~EOS
#!/bin/sh
exec #{libexec}/bin/heartbeat \
-path.config #{etc}/heartbeat \
-path.home #{libexec} \
-path.logs #{var}/log/heartbeat \
-path.data #{var}/lib/heartbeat \
exec #{libexec}/bin/heartbeat \
--path.config #{etc}/heartbeat \
--path.data #{var}/lib/heartbeat \
--path.home #{prefix} \
--path.logs #{var}/log/heartbeat \
"$@"
EOS
end