2013-02-20 21:27:17 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Couchpotatoserver < Formula
|
|
|
|
homepage 'https://couchpota.to'
|
2013-10-18 23:52:47 +00:00
|
|
|
url 'https://github.com/RuudBurger/CouchPotatoServer/archive/build/2.2.1.tar.gz'
|
|
|
|
sha1 'f0b53952130858a0cdab8b3a52f41320b6d11b2e'
|
2013-02-20 21:27:17 +00:00
|
|
|
|
|
|
|
head 'https://github.com/RuudBurger/CouchPotatoServer.git'
|
|
|
|
|
|
|
|
def install
|
2013-05-28 02:12:40 +00:00
|
|
|
prefix.install_metafiles
|
|
|
|
libexec.install Dir['*']
|
2013-02-20 21:27:17 +00:00
|
|
|
(bin+"couchpotatoserver").write(startup_script)
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :manual => 'couchpotatoserver'
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<!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>Program</key>
|
|
|
|
<string>#{opt_prefix}/bin/couchpotatoserver</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>--quiet</string>
|
|
|
|
<string>--daemon</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>UserName</key>
|
|
|
|
<string>#{`whoami`.chomp}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def startup_script; <<-EOS.undent
|
2013-05-28 02:12:40 +00:00
|
|
|
#!/bin/bash
|
|
|
|
python "#{libexec}/CouchPotato.py"\
|
|
|
|
"--pid_file=#{var}/run/couchpotatoserver.pid"\
|
|
|
|
"--data_dir=#{etc}/couchpotatoserver"\
|
|
|
|
"$@"
|
2013-02-20 21:27:17 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2013-05-28 02:12:40 +00:00
|
|
|
def caveats
|
|
|
|
"CouchPotatoServer defaults to port 5050."
|
2013-02-20 21:27:17 +00:00
|
|
|
end
|
|
|
|
end
|