homebrew-core/Formula/rtorrent.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

26 lines
904 B
Ruby

require 'formula'
class Rtorrent < Formula
homepage 'http://libtorrent.rakshasa.no/'
url 'http://libtorrent.rakshasa.no/downloads/rtorrent-0.9.2.tar.gz'
sha1 '2a642d722745091265037ed8929a23c237a3b99f'
depends_on 'pkg-config' => :build
depends_on 'libsigc++'
depends_on 'libtorrent'
depends_on 'xmlrpc-c' => :optional
def install
args = ["--disable-debug", "--disable-dependency-tracking", "--prefix=#{prefix}"]
args << "--with-xmlrpc-c" if Formula.factory("xmlrpc-c").installed?
if MacOS.version == :leopard
inreplace 'configure' do |s|
s.gsub! ' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" 2>/dev/null`',
' pkg_cv_libcurl_LIBS=`$PKG_CONFIG --libs "libcurl >= 7.15.4" | sed -e "s/-arch [^-]*/-arch $(uname -m) /" 2>/dev/null`'
end
end
system "./configure", *args
system "make"
system "make install"
end
end