homebrew-core/Formula/rrdtool.rb

54 lines
1.6 KiB
Ruby

class Rrdtool < Formula
desc "Round Robin Database"
homepage "https://oss.oetiker.ch/rrdtool/index.en.html"
url "https://github.com/oetiker/rrdtool-1.x/releases/download/v1.7.2/rrdtool-1.7.2.tar.gz"
sha256 "a199faeb7eff7cafc46fac253e682d833d08932f3db93a550a4a5af180ca58db"
license "GPL-2.0"
revision 1
bottle do
sha256 "ce57cda576f452e7790e091d645887231d4aa5b691e2c33b4ea93b3dd92d7757" => :catalina
sha256 "fae6691230b527c93670d1d00b266e43497744fc09df06c9977265e578b529fc" => :mojave
sha256 "858013744cfc3d31a47b7e3629198922d1994f20d0d44c11f6c921ce6f2b9942" => :high_sierra
end
head do
url "https://github.com/oetiker/rrdtool-1.x.git"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
end
depends_on "pkg-config" => :build
depends_on "glib"
depends_on "pango"
def install
# fatal error: 'ruby/config.h' file not found
ENV.delete("SDKROOT")
args = %W[
--disable-dependency-tracking
--prefix=#{prefix}
--disable-tcl
--with-tcllib=/usr/lib
--disable-perl-site-install
--disable-ruby-site-install
]
inreplace "configure", /^sleep 1$/, "#sleep 1"
system "./bootstrap" if build.head?
system "./configure", *args
system "make", "CC=#{ENV.cc}", "CXX=#{ENV.cxx}", "install"
end
test do
system "#{bin}/rrdtool", "create", "temperature.rrd", "--step", "300",
"DS:temp:GAUGE:600:-273:5000", "RRA:AVERAGE:0.5:1:1200",
"RRA:MIN:0.5:12:2400", "RRA:MAX:0.5:12:2400", "RRA:AVERAGE:0.5:12:2400"
system "#{bin}/rrdtool", "dump", "temperature.rrd"
end
end