homebrew-core/Formula/ganglia.rb

49 lines
1.6 KiB
Ruby
Raw Normal View History

2010-05-20 17:41:02 +00:00
require 'formula'
2011-03-10 05:11:03 +00:00
class Ganglia < Formula
2010-05-20 17:41:02 +00:00
homepage 'http://ganglia.sourceforge.net/'
url 'https://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.6.0/ganglia-3.6.0.tar.gz'
2013-11-10 08:29:07 +00:00
sha1 'b06529ac49deb1f1c65c6215b8d2d13c3f3fa23f'
2010-05-20 17:41:02 +00:00
2013-11-12 15:12:03 +00:00
conflicts_with 'coreutils', :because => 'both install `gstat` binaries'
depends_on 'pkg-config' => :build
depends_on :apr => :build
2010-09-08 12:34:11 +00:00
depends_on 'confuse'
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
2014-04-15 03:37:15 +00:00
url "https://github.com/ganglia/monitor-core/commit/ba942f.diff"
sha1 "f79c4973634d127052e262c22d11e1fec82b5677"
2010-05-20 17:41:02 +00:00
end
def install
inreplace "configure", %{varstatedir="/var/lib"}, %{varstatedir="#{var}/lib"}
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}",
"--with-gmetad",
2014-05-10 17:28:29 +00:00
"--with-libpcre=#{Formula["pcre"].opt_prefix}"
2010-05-20 17:41:02 +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
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
end