homebrew-core/Formula/tcpflow.rb
Jack Nagel 53473b6bf5 Clean up MacOS version method usage
The MacOS.version? family of methods (other than "leopard?") are poorly
defined and lead to confusing code. Replace them in formulae with more
explicit comparisons.

"MacOS.version" is a special version object that can be compared to
numerics, symbols, and strings using the standard Ruby comparison
methods.

The old methods were moved to compat when the version comparison code
was merged, and they must remain there "forever", but they should not be
used in new code.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-09-10 16:16:54 -05:00

29 lines
873 B
Ruby

require 'formula'
class Tcpflow < Formula
homepage 'https://github.com/simsong/tcpflow'
url 'https://github.com/downloads/simsong/tcpflow/tcpflow-1.3.0.tar.gz'
sha1 'fccd0a451bf138e340fc3b55dfc07924c0a811d8'
depends_on :libtool
def copy_libtool_files!
if not MacOS::Xcode.provides_autotools?
s = Formula.factory('libtool').share
d = "#{s}/libtool/config"
cp ["#{d}/config.guess", "#{d}/config.sub"], "."
elsif MacOS.version == :leopard
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config.*"], "."
else
cp Dir["#{MacOS::Xcode.prefix}/usr/share/libtool/config/config.*"], "."
end
end
def install
copy_libtool_files!
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}",
"--mandir=#{man}"
system "make install"
end
end