tinyproxy: add plist

Closes Homebrew/homebrew#37504.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Wojtek Siudzinski 2015-03-08 13:04:38 +01:00 committed by Jack Nagel
parent 17c6afe794
commit 6b50fcab64

View file

@ -66,4 +66,36 @@ class Tinyproxy < Formula
Process.wait(pid)
end
end
def post_install
log = prefix/"var/log/tinyproxy"
log.mkpath
run = prefix/"var/run/tinyproxy"
run.mkpath
end
plist_options :manual => "tinyproxy"
def plist; <<-EOS.undent
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>#{plist_name}</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>#{opt_sbin}/tinyproxy</string>
</array>
<key>WorkingDirectory</key>
<string>#{HOMEBREW_PREFIX}</string>
</dict>
</plist>
EOS
end
end