2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-09-11 19:13:26 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Mtr < Formula
|
2010-04-07 05:58:35 +00:00
|
|
|
homepage 'http://www.bitwizard.nl/mtr/'
|
2012-04-11 20:00:03 +00:00
|
|
|
url 'ftp://ftp.bitwizard.nl/mtr/mtr-0.82.tar.gz'
|
2012-03-19 13:41:44 +00:00
|
|
|
sha1 'f1319de27324d85898a9df0a293a438bbaaa12b5'
|
2009-09-11 19:13:26 +00:00
|
|
|
|
2012-09-03 19:20:58 +00:00
|
|
|
option 'with-gtk', "Build with Gtk+ support"
|
2010-12-30 06:16:42 +00:00
|
|
|
|
2012-09-03 19:20:58 +00:00
|
|
|
depends_on 'gtk+' => :optional if build.include? "with-gtk"
|
2010-12-30 06:16:42 +00:00
|
|
|
|
2009-09-11 19:13:26 +00:00
|
|
|
def install
|
|
|
|
# We need to add this because nameserver8_compat.h has been removed in Snow Leopard
|
2010-04-07 05:58:35 +00:00
|
|
|
ENV['LIBS'] = "-lresolv"
|
2012-08-10 22:36:53 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
]
|
2012-09-03 19:20:58 +00:00
|
|
|
args << "--without-gtk" unless build.include? "with-gtk"
|
2010-12-30 06:16:42 +00:00
|
|
|
system "./configure", *args
|
2009-09-11 19:13:26 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
2009-12-02 10:53:00 +00:00
|
|
|
|
2012-04-11 20:00:03 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
mtr requires superuser privileges. You can either run the program
|
|
|
|
via `sudo`, or change its ownership to root and set the setuid bit:
|
|
|
|
|
|
|
|
sudo chown root:wheel #{sbin}/mtr
|
|
|
|
sudo chmod u+s #{sbin}/mtr
|
|
|
|
|
|
|
|
In any case, you should be certain that you trust the software you
|
|
|
|
are executing with elevated privileges.
|
|
|
|
EOS
|
2009-12-02 10:53:00 +00:00
|
|
|
end
|
2009-09-11 19:13:26 +00:00
|
|
|
end
|