2013-08-04 09:42:56 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Headphones < Formula
|
|
|
|
homepage 'https://github.com/rembo10/headphones'
|
|
|
|
head 'https://github.com/rembo10/headphones.git'
|
2014-02-15 18:06:32 +00:00
|
|
|
url 'https://github.com/rembo10/headphones/archive/v0.2.2.tar.gz'
|
|
|
|
sha1 '268994b2f0b92b525e442a632fa4f875e8934e53'
|
2013-08-04 09:42:56 +00:00
|
|
|
|
|
|
|
depends_on 'Cheetah' => :python
|
|
|
|
|
|
|
|
def startup_script; <<-EOS.undent
|
|
|
|
#!/bin/bash
|
|
|
|
python "#{libexec}/Headphones.py" --datadir="#{etc}/headphones" "$@"
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def install
|
|
|
|
libexec.install Dir['*']
|
|
|
|
(bin+"headphones").write(startup_script)
|
|
|
|
end
|
|
|
|
|
|
|
|
plist_options :manual => 'headphones'
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/$
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
2014-03-06 05:28:31 +00:00
|
|
|
<string>#{opt_bin}/headphones</string>
|
2013-08-04 09:42:56 +00:00
|
|
|
<string>-q</string>
|
|
|
|
<string>-d</string>
|
|
|
|
<string>--nolaunch</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
|
|
|
def caveats
|
|
|
|
"Headphones defaults to port 8181."
|
|
|
|
end
|
|
|
|
end
|