2011-03-10 05:11:03 +00:00
|
|
|
class Ganglia < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Ganglia monitoring client"
|
2015-08-03 12:55:31 +00:00
|
|
|
homepage "http://ganglia.sourceforge.net/"
|
2015-09-06 22:43:40 +00:00
|
|
|
url "https://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.7.1/ganglia-3.7.1.tar.gz"
|
|
|
|
sha256 "e735a6218986a0ff77c737e5888426b103196c12dc2d679494ca9a4269ca69a3"
|
|
|
|
|
2015-09-07 17:11:31 +00:00
|
|
|
bottle do
|
|
|
|
sha256 "2fa8bdba3a209fb748b75ca2ac577dc73ceecf3119aae297ded3f8e52d8bf5c5" => :yosemite
|
|
|
|
sha256 "1d0c19c31b897552093cbad7e278c27eb04c0f3b624b81fa81546dfe45501a13" => :mavericks
|
|
|
|
sha256 "cf31c6f82ffed72b8b3b10c2783218390ead29608a3fed16d7511d406eb7859f" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-09-06 22:43:40 +00:00
|
|
|
head do
|
|
|
|
url "https://github.com/ganglia/monitor-core.git"
|
|
|
|
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2010-05-20 17:41:02 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
conflicts_with "coreutils", :because => "both install `gstat` binaries"
|
2013-11-12 15:12:03 +00:00
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2015-04-18 05:27:31 +00:00
|
|
|
depends_on :apr => :build
|
2015-08-03 12:55:31 +00:00
|
|
|
depends_on "confuse"
|
|
|
|
depends_on "pcre"
|
|
|
|
depends_on "rrdtool"
|
2010-09-08 12:34:11 +00:00
|
|
|
|
2010-05-20 17:41:02 +00:00
|
|
|
def install
|
2015-09-06 22:43:40 +00:00
|
|
|
if build.head?
|
|
|
|
inreplace "bootstrap", "libtoolize", "glibtoolize"
|
|
|
|
inreplace "libmetrics/bootstrap", "libtoolize", "glibtoolize"
|
|
|
|
system "./bootstrap"
|
|
|
|
end
|
|
|
|
|
2015-08-03 12:55:31 +00:00
|
|
|
inreplace "configure", %(varstatedir="/var/lib"), %(varstatedir="#{var}/lib")
|
2012-02-24 22:51:33 +00:00
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--disable-dependency-tracking",
|
2010-09-08 15:16:12 +00:00
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--sbindir=#{bin}",
|
|
|
|
"--sysconfdir=#{etc}",
|
2014-05-10 17:28:22 +00:00
|
|
|
"--mandir=#{man}",
|
2012-02-24 22:51:33 +00:00
|
|
|
"--with-gmetad",
|
2014-05-10 17:28:29 +00:00
|
|
|
"--with-libpcre=#{Formula["pcre"].opt_prefix}"
|
2015-08-03 12:55:31 +00:00
|
|
|
system "make", "install"
|
2010-09-08 12:34:11 +00:00
|
|
|
|
|
|
|
# Generate the default config file
|
2013-12-09 19:44:45 +00:00
|
|
|
system "#{bin}/gmond -t > #{etc}/gmond.conf" unless File.exist? "#{etc}/gmond.conf"
|
2010-05-20 17:41:02 +00:00
|
|
|
end
|
|
|
|
|
2014-05-10 17:28:46 +00:00
|
|
|
def post_install
|
|
|
|
(var/"lib/ganglia/rrds").mkpath
|
|
|
|
end
|
|
|
|
|
2010-09-08 12:34:11 +00:00
|
|
|
def caveats; <<-EOS.undent
|
2010-09-08 15:16:12 +00:00
|
|
|
If you didn't have a default config file, one was created here:
|
|
|
|
#{etc}/gmond.conf
|
2010-09-08 12:34:11 +00:00
|
|
|
EOS
|
|
|
|
end
|
2015-09-06 22:43:40 +00:00
|
|
|
|
|
|
|
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
|
2010-09-08 12:34:11 +00:00
|
|
|
end
|