diff options
| author | Bodaniel Jeanes | 2011-06-19 22:49:06 -0500 |
|---|---|---|
| committer | Adam Vandenberg | 2011-08-13 11:03:45 -0700 |
| commit | 8e66ee9a97d7962679c975f95457a027f1222fc2 (patch) | |
| tree | 1c634f1f98df758fe7233850b3f86de7ebfde7a0 /Library | |
| parent | 00ea9f46f0605f39d2eecce71d7f70f376526924 (diff) | |
| download | homebrew-8e66ee9a97d7962679c975f95457a027f1222fc2.tar.bz2 | |
SickBeard build-488
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Formula/sickbeard.rb | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/Library/Formula/sickbeard.rb b/Library/Formula/sickbeard.rb new file mode 100644 index 000000000..b6dad10bd --- /dev/null +++ b/Library/Formula/sickbeard.rb @@ -0,0 +1,81 @@ +require 'formula' + +class Sickbeard < Formula + url 'https://github.com/midgetspy/Sick-Beard/tarball/build-488' + homepage 'http://www.sickbeard.com/' + md5 '3bdcabe963e2622513f3cca2757fa2f0' + + head 'git://github.com/midgetspy/Sick-Beard.git' + + depends_on 'Cheetah' => :python + + def install + prefix.install Dir['*'] + bin.mkpath + (bin+"sickbeard").write(startup_script) + (prefix+"com.sickbeard.sickbeard.plist").write(startup_plist) + end + + def startup_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>com.sickbeard.sickbeard</string> + <key>ProgramArguments</key> + <array> + <string>#{bin}/sick-beard</string> + <string>-q</string> + <string>--nolaunch</string> + <string>-p</string> + <string>8081</string> + </array> + <key>RunAtLoad</key> + <true/> + <key>UserName</key> + <string>#{`whoami`.chomp}</string> + </dict> + </plist> + EOS + end + + def startup_script; <<-EOS.undent + #!/usr/bin/env ruby + + me = begin + File.expand_path( + File.join( + File.dirname(__FILE__), + File.readlink(__FILE__) + ) + ) + rescue + __FILE__ + end + + path = File.join(File.dirname(me), '..', 'SickBeard.py') + args = ["--pidfile=#{var}/run/sickbeard.pid", "--datadir=#{etc}/sickbeard"] + + exec("python", path, *(args + ARGV)) + EOS + end + + def caveats; <<-EOS.undent + SickBeard will start up and launch http://localhost:8081/ when you run: + + sickbeard + + To launch automatically on startup, copy and paste the following into a terminal: + + mkdir -p ~/Library/LaunchAgents + (launchctl unload -w ~/Library/LaunchAgents/com.sickbeard.sickbeard.plist 2>/dev/null || true) + ln -sf #{prefix}/com.sickbeard.sickbeard.plist ~/Library/LaunchAgents/com.sickbeard.sickbeard.plist + launchctl load -w ~/Library/LaunchAgents/com.sickbeard.sickbeard.plist + + You may want to edit: + #{prefix}/com.sickbeard.sickbeard.plist + to change the port (default: 8081) or user (default: #{`whoami`.chomp}). + EOS + end +end |
