homebrew-core/Formula/collector-sidecar.rb

32 lines
1.1 KiB
Ruby
Raw Normal View History

class CollectorSidecar < Formula
desc "Manage log collectors through Graylog"
homepage "https://github.com/Graylog2/collector-sidecar"
url "https://github.com/Graylog2/collector-sidecar/archive/0.0.9.tar.gz"
sha256 "a854d84bf65e3fb9409743869701dab5c059d14d0b615acd14c8923bef30bc9f"
depends_on "glide" => :build
depends_on "go" => :build
depends_on :hg => :build
depends_on "filebeat" => :run
def install
ENV["GOPATH"] = buildpath
ENV["GLIDE_HOME"] = HOMEBREW_CACHE/"glide_home/#{name}"
(buildpath/"src/github.com/Graylog2/collector-sidecar").install buildpath.children
cd "src/github.com/Graylog2/collector-sidecar" do
inreplace "main.go", "/etc", etc
inreplace "collector_sidecar.yml", "/usr", HOMEBREW_PREFIX
inreplace "collector_sidecar.yml", "/etc", etc
inreplace "collector_sidecar.yml", "/var", var
system "glide", "install"
system "make", "build"
(etc/"graylog/collector-sidecar").install "collector_sidecar.yml"
bin.install "graylog-collector-sidecar"
end
end
test do
assert_match version.to_s, shell_output("#{bin}/graylog-collector-sidecar -version")
end
end