2013-02-20 21:27:17 +00:00
|
|
|
class Couchpotatoserver < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Download movies automatically"
|
2014-07-21 02:23:22 +00:00
|
|
|
homepage "https://couchpota.to"
|
2015-08-04 20:12:21 +00:00
|
|
|
url "https://github.com/RuudBurger/CouchPotatoServer/archive/build/2.6.3.tar.gz"
|
|
|
|
sha256 "8735adc2c518fb517da916f4e9554dcfbba67d2e640b24fc7acdfa7baa0c78fc"
|
2013-02-20 21:27:17 +00:00
|
|
|
|
2014-07-21 02:23:22 +00:00
|
|
|
head "https://github.com/RuudBurger/CouchPotatoServer.git"
|
2013-02-20 21:27:17 +00:00
|
|
|
|
2014-12-15 23:30:31 +00:00
|
|
|
bottle do
|
2015-08-10 06:20:37 +00:00
|
|
|
cellar :any
|
|
|
|
sha256 "060521cab660a6fb15265e8239d9685dc9034a65100f1960b5249b8a84a563af" => :yosemite
|
|
|
|
sha256 "b2c7bbcd61a338c4b35cebc76a393c3564d7b5dc35c494df3ecda65c88d174d9" => :mavericks
|
|
|
|
sha256 "f2ea47a3082dce305db9efd82001a5a7479475abfe1ce1efd7332ebcbc29f145" => :mountain_lion
|
2014-12-15 23:30:31 +00:00
|
|
|
end
|
|
|
|
|
2013-02-20 21:27:17 +00:00
|
|
|
def install
|
2013-05-28 02:12:40 +00:00
|
|
|
prefix.install_metafiles
|
2014-07-21 02:23:22 +00:00
|
|
|
libexec.install Dir["*"]
|
2013-02-20 21:27:17 +00:00
|
|
|
(bin+"couchpotatoserver").write(startup_script)
|
|
|
|
end
|
|
|
|
|
2014-07-21 02:23:22 +00:00
|
|
|
plist_options :manual => "couchpotatoserver"
|
2013-02-20 21:27:17 +00:00
|
|
|
|
|
|
|
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>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_bin}/couchpotatoserver</string>
|
2013-02-20 21:27:17 +00:00
|
|
|
<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
|
2015-08-04 20:12:21 +00:00
|
|
|
|
|
|
|
test do
|
|
|
|
system "#{bin}/couchpotatoserver", "--help"
|
|
|
|
end
|
2013-02-20 21:27:17 +00:00
|
|
|
end
|