homebrew-core/Formula/ganglia.rb

58 lines
1.8 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 'http://downloads.sourceforge.net/project/ganglia/ganglia%20monitoring%20core/3.1.7/ganglia-3.1.7.tar.gz'
sha1 'e234d64814af1c9f55f1cd039a5840039d175f85'
2010-05-20 17:41:02 +00:00
2010-09-08 12:34:11 +00:00
depends_on 'confuse'
depends_on 'pcre'
depends_on 'rrdtool'
2010-05-20 17:41:02 +00:00
def patches
2010-09-08 12:34:11 +00:00
# fixes build on Leopard and newer, which lack kvm.h and its corresponding /dev/ node
{:p0 => [
"https://trac.macports.org/export/105820/trunk/dports/net/ganglia/files/patch-libmetrics-darwin-metrics.c.diff"
]}
2010-05-20 17:41:02 +00:00
end
def install
2010-09-08 12:34:11 +00:00
# ENV var needed to confirm putting the config in the prefix until 3.2
ENV['GANGLIA_ACK_SYSCONFDIR'] = '1'
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
2010-09-08 15:16:12 +00:00
"--prefix=#{prefix}",
"--sbindir=#{bin}",
"--sysconfdir=#{etc}",
"--with-gexec",
"--with-gmetad",
"--with-libpcre=#{HOMEBREW_PREFIX}"
2010-05-20 17:41:02 +00:00
system "make install"
2010-09-08 12:34:11 +00:00
cd "web" do
2010-09-08 12:34:11 +00:00
system "make", "conf.php"
system "make", "version.php"
inreplace "conf.php", "/usr/bin/rrdtool", "#{HOMEBREW_PREFIX}/bin/rrdtool"
end
# Generate the default config file
2010-09-08 15:16:12 +00:00
system "#{bin}/gmond -t > #{etc}/gmond.conf" unless File.exists? "#{etc}/gmond.conf"
2010-09-08 12:34:11 +00:00
# Install the web files
2010-09-08 15:16:12 +00:00
(share+"ganglia").install "web"
2010-09-08 12:34:11 +00:00
# Install man pages
2010-05-20 17:41:02 +00:00
man1.install Dir['mans/*']
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
2010-09-08 15:16:12 +00:00
You might want to copy these someplace served by a PHP-capable web server:
#{share}/ganglia/web/* to someplace
2010-09-08 12:34:11 +00:00
EOS
end
end