From ac7eb09d0f43ce932f316f8b0ede7f265fa32592 Mon Sep 17 00:00:00 2001 From: Matthew Lewinski Date: Fri, 3 Feb 2012 21:06:41 -0600 Subject: New formula: perforce-proxy Closes #9578. Signed-off-by: Jack Nagel --- Library/Formula/perforce-proxy.rb | 68 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 Library/Formula/perforce-proxy.rb (limited to 'Library/Formula') diff --git a/Library/Formula/perforce-proxy.rb b/Library/Formula/perforce-proxy.rb new file mode 100644 index 000000000..6f8b4604c --- /dev/null +++ b/Library/Formula/perforce-proxy.rb @@ -0,0 +1,68 @@ +require 'formula' + +class PerforceProxy < Formula + url 'http://filehost.perforce.com/perforce/r11.1/bin.darwin90u/p4p' + homepage 'http://www.perforce.com/' + md5 '2b088a486f6e431110c6926f4f63b489' + version '2011.1.393975' + + def install + sbin.install 'p4p' + + (var+"p4p").mkpath + + plist_path.write startup_plist + plist_path.chmod 0644 + end + + def caveats; <<-EOS.undent + To use the Perforce proxy to access your Perforce server, set your P4PORT + environment variable to "localhost:1666". + + To launch on startup: + * if this is your first install: + mkdir -p ~/Library/LaunchAgents + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + * if this is an upgrade and you already have the #{plist_path.basename} loaded: + launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} + cp #{plist_path} ~/Library/LaunchAgents/ + launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} + + 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 startup_plist; <<-EOPLIST.undent + + + + + Label + #{plist_name} + ProgramArguments + + #{HOMEBREW_PREFIX}/sbin/p4p + -p + 1666 + -r + #{var}/p4p + -t + perforce:1666 + + RunAtLoad + + KeepAlive + + UserName + #{`whoami`.chomp} + WorkingDirectory + #{var}/p4p + + + EOPLIST + end +end -- cgit v1.2.3