heartbeat: generate and install fields.yml into etc/

use native Makefile env var to install pip wheels from source
This commit is contained in:
Tyler Langlois 2018-03-05 11:41:03 -08:00 committed by commitay
parent 926da5c538
commit d9469720a2

View file

@ -14,16 +14,32 @@ class Heartbeat < Formula
depends_on "go" => :build
resource "virtualenv" do
url "https://files.pythonhosted.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/virtualenv-15.1.0.tar.gz"
sha256 "02f8102c2436bb03b3ee6dede1919d1dac8a427541652e5ec95171ec8adbc93a"
end
def install
ENV["GOPATH"] = buildpath
(buildpath/"src/github.com/elastic/beats").install buildpath.children
ENV.prepend_create_path "PYTHONPATH", buildpath/"vendor/lib/python2.7/site-packages"
resource("virtualenv").stage do
system "python", *Language::Python.setup_install_args(buildpath/"vendor")
end
ENV.prepend_path "PATH", buildpath/"vendor/bin"
cd "src/github.com/elastic/beats/heartbeat" do
system "make"
# 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}"]
(etc/"heartbeat").install Dir["heartbeat*.{json,yml}", "fields.yml"]
prefix.install_metafiles
end