68 lines
2.3 KiB
Ruby
68 lines
2.3 KiB
Ruby
class Netdata < Formula
|
|
desc "Distributed real-time performance and health monitoring"
|
|
homepage "https://my-netdata.io/"
|
|
url "https://github.com/netdata/netdata/releases/download/v1.13.0/netdata-v1.13.0.tar.gz"
|
|
sha256 "258e64a945bf80e91c4bffab35e7f2d8930025246814038f541ff0ac403a666c"
|
|
|
|
bottle do
|
|
sha256 "8b0ef1f317402901ba1189b03d9c27bd682748573dd40cb934254574dd512515" => :mojave
|
|
sha256 "02bbea4b989f9a6276532ccbc98241deddb13f531348261fbdf150b8faa0ba1a" => :high_sierra
|
|
sha256 "bacd3e8d0f19d34231114eb40523e7790a7d96e179331e8aad012e742ecf41b9" => :sierra
|
|
end
|
|
|
|
depends_on "autoconf" => :build
|
|
depends_on "automake" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "ossp-uuid"
|
|
|
|
def install
|
|
system "./configure", "--disable-dependency-tracking",
|
|
"--disable-silent-rules",
|
|
"--prefix=#{prefix}",
|
|
"--sysconfdir=#{etc}",
|
|
"--localstatedir=#{var}"
|
|
system "make", "install"
|
|
|
|
(etc/"netdata").install "system/netdata.conf"
|
|
end
|
|
|
|
def post_install
|
|
config = etc/"netdata/netdata.conf"
|
|
inreplace config do |s|
|
|
s.gsub!(/web files owner = .*/, "web files owner = #{ENV["USER"]}")
|
|
s.gsub!(/web files group = .*/, "web files group = #{Etc.getgrgid(prefix.stat.gid).name}")
|
|
end
|
|
(var/"netdata").mkpath
|
|
end
|
|
|
|
plist_options :manual => "#{HOMEBREW_PREFIX}/sbin/netdata -D"
|
|
|
|
def plist; <<~EOS
|
|
<?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>Label</key>
|
|
<string>#{plist_name}</string>
|
|
<key>RunAtLoad</key>
|
|
<true/>
|
|
<key>ProgramArguments</key>
|
|
<array>
|
|
<string>#{opt_sbin}/netdata</string>
|
|
<string>-D</string>
|
|
</array>
|
|
<key>WorkingDirectory</key>
|
|
<string>#{var}</string>
|
|
</dict>
|
|
</plist>
|
|
EOS
|
|
end
|
|
|
|
test do
|
|
system "#{sbin}/netdata", "-W", "set", "registry", "netdata unique id file",
|
|
"#{testpath}/netdata.unittest.unique.id",
|
|
"-W", "set", "registry", "netdata management api key file",
|
|
"#{testpath}/netdata.api.key",
|
|
"-W", "unittest"
|
|
end
|
|
end
|