2010-02-28 16:54:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Rrdtool < Formula
|
2010-02-28 16:54:17 +00:00
|
|
|
homepage 'http://oss.oetiker.ch/rrdtool/index.en.html'
|
2012-08-21 21:01:53 +00:00
|
|
|
url 'http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.4.7.tar.gz'
|
2012-07-11 21:13:08 +00:00
|
|
|
sha1 'faab7df7696b69f85d6f89dd9708d7cf0c9a273b'
|
2010-02-28 16:54:17 +00:00
|
|
|
|
2012-08-21 21:01:53 +00:00
|
|
|
option 'lua', "Compile with lua support"
|
|
|
|
|
2010-07-31 04:12:08 +00:00
|
|
|
depends_on 'glib'
|
2010-02-28 16:54:17 +00:00
|
|
|
depends_on 'pango'
|
|
|
|
|
2010-07-01 16:20:32 +00:00
|
|
|
# Can use lua if it is found, but don't force users to install
|
2012-09-02 07:53:12 +00:00
|
|
|
# TODO: Do something here
|
2012-08-21 21:01:53 +00:00
|
|
|
depends_on 'lua' => :optional if build.include? "lua"
|
2010-07-31 04:12:08 +00:00
|
|
|
|
2011-03-14 21:14:41 +00:00
|
|
|
# Ha-ha, but sleeping is annoying when running configure a lot
|
|
|
|
def patches; DATA; end
|
2010-07-01 16:20:32 +00:00
|
|
|
|
2010-02-28 16:54:17 +00:00
|
|
|
def install
|
2011-03-14 21:14:41 +00:00
|
|
|
ENV.libxml2
|
|
|
|
|
2012-05-08 01:54:56 +00:00
|
|
|
which_perl = which 'perl'
|
|
|
|
which_ruby = which 'ruby'
|
2012-05-20 00:57:56 +00:00
|
|
|
ruby_path = "/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby"
|
2010-07-31 04:12:08 +00:00
|
|
|
|
2012-06-01 14:41:51 +00:00
|
|
|
opoo "Using system Ruby. RRD module will be installed to /Library/Ruby/..." if which_ruby.realpath.to_s == ruby_path
|
|
|
|
opoo "Using system Perl. RRD module will be installed to /Library/Perl/..." if which_perl.to_s == "/usr/bin/perl"
|
2010-07-31 04:12:08 +00:00
|
|
|
|
2012-08-21 21:01:53 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
2012-06-01 14:41:51 +00:00
|
|
|
args << "--enable-perl-site-install" if which_perl.to_s == "/usr/bin/perl"
|
|
|
|
args << "--enable-ruby-site-install" if which_ruby.realpath.to_s == ruby_path
|
2010-07-31 04:12:08 +00:00
|
|
|
|
|
|
|
system "./configure", *args
|
|
|
|
|
|
|
|
# Needed to build proper Ruby bundle
|
2011-03-18 17:30:47 +00:00
|
|
|
ENV["ARCHFLAGS"] = MacOS.prefer_64_bit? ? "-arch x86_64" : "-arch i386"
|
2010-07-01 16:20:32 +00:00
|
|
|
|
2010-02-28 16:54:17 +00:00
|
|
|
system "make install"
|
2010-07-31 04:12:08 +00:00
|
|
|
prefix.install "bindings/ruby/test.rb"
|
2010-02-28 16:54:17 +00:00
|
|
|
end
|
2010-07-01 16:20:32 +00:00
|
|
|
|
|
|
|
def test
|
2012-05-05 21:20:37 +00:00
|
|
|
mktemp do
|
2012-09-02 07:53:12 +00:00
|
|
|
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"
|
2012-05-05 21:20:37 +00:00
|
|
|
end
|
2010-07-01 16:20:32 +00:00
|
|
|
end
|
2010-02-28 16:54:17 +00:00
|
|
|
end
|
2010-07-31 04:12:08 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/configure b/configure
|
|
|
|
index 7487ad2..e7b85c1 100755
|
|
|
|
--- a/configure
|
|
|
|
+++ b/configure
|
|
|
|
@@ -31663,18 +31663,6 @@ $as_echo_n "checking in... " >&6; }
|
|
|
|
{ $as_echo "$as_me:$LINENO: result: and out again" >&5
|
|
|
|
$as_echo "and out again" >&6; }
|
2012-09-02 07:53:12 +00:00
|
|
|
|
2010-07-31 04:12:08 +00:00
|
|
|
-echo $ECHO_N "ordering CD from http://tobi.oetiker.ch/wish $ECHO_C" 1>&6
|
|
|
|
-sleep 1
|
|
|
|
-echo $ECHO_N ".$ECHO_C" 1>&6
|
|
|
|
-sleep 1
|
|
|
|
-echo $ECHO_N ".$ECHO_C" 1>&6
|
|
|
|
-sleep 1
|
|
|
|
-echo $ECHO_N ".$ECHO_C" 1>&6
|
|
|
|
-sleep 1
|
|
|
|
-echo $ECHO_N ".$ECHO_C" 1>&6
|
|
|
|
-sleep 1
|
|
|
|
-{ $as_echo "$as_me:$LINENO: result: just kidding ;-)" >&5
|
|
|
|
-$as_echo " just kidding ;-)" >&6; }
|
|
|
|
echo
|
|
|
|
echo "----------------------------------------------------------------"
|
|
|
|
echo "Config is DONE!"
|