require 'formula' class Couchpotatoserver < Formula homepage 'https://couchpota.to' url 'https://github.com/RuudBurger/CouchPotatoServer/archive/build/2.2.1.tar.gz' sha1 'f0b53952130858a0cdab8b3a52f41320b6d11b2e' head 'https://github.com/RuudBurger/CouchPotatoServer.git' def install prefix.install_metafiles libexec.install Dir['*'] (bin+"couchpotatoserver").write(startup_script) end plist_options :manual => 'couchpotatoserver' def plist; <<-EOS.undent Label #{plist_name} Program #{opt_prefix}/bin/couchpotatoserver ProgramArguments --quiet --daemon RunAtLoad UserName #{`whoami`.chomp} EOS end def startup_script; <<-EOS.undent #!/bin/bash python "#{libexec}/CouchPotato.py"\ "--pid_file=#{var}/run/couchpotatoserver.pid"\ "--data_dir=#{etc}/couchpotatoserver"\ "$@" EOS end def caveats "CouchPotatoServer defaults to port 5050." end end