Skip to content

Commit

Permalink
ganglia 3.7.1, HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
dunn committed Sep 7, 2015
1 parent 18e4cb4 commit 26cfd70
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions Formula/ganglia.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
class Ganglia < Formula
desc "Ganglia monitoring client"
homepage "http://ganglia.sourceforge.net/"
url "https://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz"
sha256 "89eae02e1a117040d60b3b561fe55f88d7f8cf41b94af1492969ef68e6797886"
url "https://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.7.1/ganglia-3.7.1.tar.gz"
sha256 "e735a6218986a0ff77c737e5888426b103196c12dc2d679494ca9a4269ca69a3"

head do
url "https://github.com/ganglia/monitor-core.git"

depends_on "automake" => :build
depends_on "autoconf" => :build
depends_on "libtool" => :build
end

conflicts_with "coreutils", :because => "both install `gstat` binaries"

Expand All @@ -12,14 +20,13 @@ class Ganglia < Formula
depends_on "pcre"
depends_on "rrdtool"

# fixes build on Leopard and newer, which lack kvm.h, cpu_steal_func() and its corresponding /dev/ node
# merged upstream: https://github.com/ganglia/monitor-core/issues/150
patch do
url "https://github.com/ganglia/monitor-core/commit/ba942f.diff"
sha256 "f339b43a4409c74a9cbe073041fed9e1512ad58b8bc3324a6a1e7c86df0ce7b2"
end

def install
if build.head?
inreplace "bootstrap", "libtoolize", "glibtoolize"
inreplace "libmetrics/bootstrap", "libtoolize", "glibtoolize"
system "./bootstrap"
end

inreplace "configure", %(varstatedir="/var/lib"), %(varstatedir="#{var}/lib")
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
Expand All @@ -44,4 +51,17 @@ def caveats; <<-EOS.undent
#{etc}/gmond.conf
EOS
end

test do
begin
pid = fork do
exec bin/"gmetad", "--pid-file=#{testpath}/pid"
end
sleep 2
File.exist? testpath/"pid"
ensure
Process.kill "TERM", pid
Process.wait pid
end
end
end

0 comments on commit 26cfd70

Please sign in to comment.