2011-03-10 05:11:03 +00:00
|
|
|
class Collectd < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Statistics collection and monitoring daemon"
|
2014-10-15 23:36:43 +00:00
|
|
|
homepage "https://collectd.org/"
|
2011-03-22 05:20:50 +00:00
|
|
|
|
2015-10-05 12:43:04 +00:00
|
|
|
stable do
|
2016-10-08 09:26:35 +00:00
|
|
|
url "https://collectd.org/files/collectd-5.6.1.tar.bz2"
|
2016-07-26 17:10:27 +00:00
|
|
|
mirror "http://pkgs.fedoraproject.org/repo/pkgs/collectd/collectd-5.5.2.tar.bz2/40b83343f72089e0330f53965f1140bd/collectd-5.5.2.tar.bz2"
|
2016-10-08 09:26:35 +00:00
|
|
|
sha256 "c30ff644f91407b4dc2d99787b99cc45ec00e538bd1cc269429d3c5e8a4aee2c"
|
2015-10-05 12:43:04 +00:00
|
|
|
end
|
|
|
|
|
2014-10-16 05:40:18 +00:00
|
|
|
bottle do
|
2016-10-08 09:31:39 +00:00
|
|
|
sha256 "24fa7953ab6b72d431c2104bb92361b30c28017e2f60cde8ddd5c36d3e7ae7ae" => :sierra
|
|
|
|
sha256 "65bdb89a4c44ca9442fb0820127b14188b36308a8ca19f7bd494d78b66a6954d" => :el_capitan
|
|
|
|
sha256 "172fd414dfd5a88ccbbe6383220ef89de9e129db06aabad0d19c372f25283c21" => :yosemite
|
2014-10-16 05:40:18 +00:00
|
|
|
end
|
|
|
|
|
2014-10-15 23:36:43 +00:00
|
|
|
head do
|
2016-02-26 14:25:31 +00:00
|
|
|
url "https://github.com/collectd/collectd.git"
|
2014-10-15 23:36:43 +00:00
|
|
|
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
end
|
|
|
|
|
2016-02-26 14:25:31 +00:00
|
|
|
option "with-java", "Enable Java support"
|
2016-10-09 10:57:44 +00:00
|
|
|
option "with-python", "Enable Python support"
|
2015-10-30 07:36:01 +00:00
|
|
|
option "with-protobuf-c", "Enable write_riemann via protobuf-c support"
|
2015-07-24 07:19:22 +00:00
|
|
|
option "with-debug", "Enable debug support"
|
|
|
|
|
|
|
|
deprecated_option "java" => "with-java"
|
|
|
|
deprecated_option "debug" => "with-debug"
|
|
|
|
|
2014-05-19 18:47:38 +00:00
|
|
|
depends_on "pkg-config" => :build
|
2015-10-30 07:36:01 +00:00
|
|
|
depends_on "protobuf-c" => :optional
|
2016-09-24 15:45:48 +00:00
|
|
|
depends_on :java => :optional
|
2016-10-09 10:57:44 +00:00
|
|
|
depends_on :python => :optional
|
2016-09-04 05:50:37 +00:00
|
|
|
depends_on "net-snmp"
|
2010-06-01 10:23:56 +00:00
|
|
|
|
2012-04-18 16:00:48 +00:00
|
|
|
fails_with :clang do
|
|
|
|
build 318
|
|
|
|
cause <<-EOS.undent
|
|
|
|
Clang interacts poorly with the collectd-bundled libltdl,
|
|
|
|
causing configure to fail.
|
2012-06-04 01:50:21 +00:00
|
|
|
EOS
|
2012-04-18 16:00:48 +00:00
|
|
|
end
|
|
|
|
|
2010-01-24 11:44:47 +00:00
|
|
|
def install
|
2014-10-16 05:54:25 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-debug
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--localstatedir=#{var}
|
|
|
|
]
|
2012-04-21 03:24:17 +00:00
|
|
|
|
2013-07-10 02:30:15 +00:00
|
|
|
args << "--disable-embedded-perl" if MacOS.version <= :leopard
|
2015-03-23 01:58:50 +00:00
|
|
|
args << "--disable-java" if build.without? "java"
|
2016-10-09 10:57:44 +00:00
|
|
|
args << "--enable-python" if build.with? "python"
|
2015-10-30 07:36:01 +00:00
|
|
|
args << "--enable-write_riemann" if build.with? "protobuf-c"
|
2015-03-23 01:58:50 +00:00
|
|
|
args << "--enable-debug" if build.with? "debug"
|
2010-10-16 15:22:16 +00:00
|
|
|
|
2014-10-15 23:36:43 +00:00
|
|
|
system "./build.sh" if build.head?
|
2010-10-16 15:22:16 +00:00
|
|
|
system "./configure", *args
|
2014-10-15 23:36:43 +00:00
|
|
|
system "make", "install"
|
2010-01-24 11:44:47 +00:00
|
|
|
end
|
2013-01-04 18:20:49 +00:00
|
|
|
|
2016-09-24 15:45:48 +00:00
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/collectd -f -C #{HOMEBREW_PREFIX}/etc/collectd.conf"
|
2016-07-26 17:10:27 +00:00
|
|
|
|
2013-01-04 18:20:49 +00:00
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{sbin}/collectd</string>
|
|
|
|
<string>-f</string>
|
|
|
|
<string>-C</string>
|
|
|
|
<string>#{etc}/collectd.conf</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>StandardErrorPath</key>
|
2015-03-23 01:58:50 +00:00
|
|
|
<string>#{var}/log/collectd.log</string>
|
2013-01-04 18:20:49 +00:00
|
|
|
<key>StandardOutPath</key>
|
2015-03-23 01:58:50 +00:00
|
|
|
<string>#{var}/log/collectd.log</string>
|
2013-01-04 18:20:49 +00:00
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
2015-07-24 07:19:22 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
begin
|
|
|
|
pid = fork { exec sbin/"collectd", "-f" }
|
|
|
|
assert shell_output("nc -u -w 2 127.0.0.1 25826", 0)
|
|
|
|
ensure
|
|
|
|
Process.kill("SIGINT", pid)
|
|
|
|
Process.wait(pid)
|
|
|
|
end
|
|
|
|
end
|
2010-01-24 11:44:47 +00:00
|
|
|
end
|