Skip to content

Commit

Permalink
metricbeat: generate and install fields.yml into etc/
Browse files Browse the repository at this point in the history
use native Makefile env var to install pip wheels from source
  • Loading branch information
tylerjl authored and commitay committed Mar 17, 2018
1 parent d946972 commit ab7b777
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion Formula/metricbeat.rb
Expand Up @@ -22,17 +22,33 @@ class Metricbeat < 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/metricbeat" 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"
system "make", "kibana"
(libexec/"bin").install "metricbeat"
libexec.install "_meta/kibana"

(etc/"metricbeat").install Dir["metricbeat*.yml"]
(etc/"metricbeat").install Dir["metricbeat*.yml", "fields.yml"]
prefix.install_metafiles
end

Expand Down

0 comments on commit ab7b777

Please sign in to comment.