require 'formula' class PerforceProxy < Formula homepage 'http://www.perforce.com/' if MacOS.prefer_64_bit? url 'http://filehost.perforce.com/perforce/r12.2/bin.darwin90x86_64/p4p' version '2012.2.551823-x86_64' sha1 '7acece4dfafa72df8f71138b9e9965fe241dfa35' else url 'http://filehost.perforce.com/perforce/r12.2/bin.darwin90x86/p4p' version '2012.2.551823-x86' sha1 '8161e83bc4c55061bd73876331823c2f8e44da8e' end def install sbin.install 'p4p' (var+"p4p").mkpath end def caveats; <<-EOS.undent To use the Perforce proxy to access your Perforce server, set your P4PORT environment variable to "localhost:1666". Before starting the proxy server, you probably need to edit the plist to use the correct host and port for your Perforce server (replacing the default perforce:1666). EOS end def plist; <<-EOS.undent Label #{plist_name} ProgramArguments #{opt_prefix}/sbin/p4p -p 1666 -r #{var}/p4p -t perforce:1666 RunAtLoad KeepAlive UserName #{`whoami`.chomp} WorkingDirectory #{var}/p4p EOS end end