require "formula" class Transmission < Formula desc "Lightweight BitTorrent client" homepage "http://www.transmissionbt.com/" url "https://transmission.cachefly.net/transmission-2.84.tar.xz" sha1 "455359bc1fa34aeecc1bac9255ad0c884b94419c" option "with-nls", "Build with native language support" depends_on "pkg-config" => :build depends_on "curl" if MacOS.version <= :leopard depends_on "libevent" if build.with? "nls" depends_on "intltool" => :build depends_on "gettext" end def install ENV.append "LDFLAGS", "-framework Foundation -prebind" ENV.append "LDFLAGS", "-liconv" args = %W[--disable-dependency-tracking --prefix=#{prefix} --disable-mac --without-gtk] args << "--disable-nls" if build.without? "nls" #fixes issue w/ webui files not being found #21151 #submitted upstream: https://trac.transmissionbt.com/ticket/5304 inreplace "libtransmission/platform.c", "SYS_DARWIN", "BUILD_MAC_CLIENT" inreplace "libtransmission/utils.c", "SYS_DARWIN", "BUILD_MAC_CLIENT" system "./configure", *args system "make" # Make and install in one step fails system "make install" (var/"transmission").mkpath end def caveats; <<-EOS.undent This formula only installs the command line utilities. Transmission.app can be downloaded from Transmission's website: http://www.transmissionbt.com EOS end plist_options :manual => 'transmission-daemon --foreground' def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_bin}/transmission-daemon --foreground --config-dir #{var}/transmission/ --log-info --logfile #{var}/transmission/transmission-daemon.log KeepAlive NetworkState EOS end end