2014-09-18 14:51:13 +00:00
|
|
|
require "formula"
|
2011-08-05 19:02:24 +00:00
|
|
|
|
|
|
|
class Pow < Formula
|
2014-09-18 14:51:13 +00:00
|
|
|
homepage "http://pow.cx/"
|
|
|
|
url "http://get.pow.cx/versions/0.4.3.tar.gz"
|
|
|
|
sha1 "7e1faf3c33588bc3e73fb3583265e050a48718b0"
|
2011-08-05 19:02:24 +00:00
|
|
|
|
2014-09-18 14:51:13 +00:00
|
|
|
depends_on "node"
|
2011-08-05 19:02:24 +00:00
|
|
|
|
|
|
|
def install
|
2014-09-18 14:51:13 +00:00
|
|
|
libexec.install Dir["*"]
|
|
|
|
(bin/"pow").write <<-EOS.undent
|
2012-06-08 01:06:30 +00:00
|
|
|
#!/bin/sh
|
2014-09-18 14:51:13 +00:00
|
|
|
export POW_BIN="#{bin}/pow"
|
|
|
|
exec "#{HOMEBREW_PREFIX}/opt/node/bin/node" "#{libexec}/lib/command.js" "$@"
|
2012-06-08 01:06:30 +00:00
|
|
|
EOS
|
2011-08-05 19:02:24 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats;
|
|
|
|
<<-EOS.undent
|
2013-09-30 11:02:31 +00:00
|
|
|
Create the required host directories:
|
2013-10-19 13:15:59 +00:00
|
|
|
mkdir -p ~/Library/Application\\ Support/Pow/Hosts
|
|
|
|
ln -s ~/Library/Application\\ Support/Pow/Hosts ~/.pow
|
2011-08-05 19:02:24 +00:00
|
|
|
|
2013-09-30 11:02:31 +00:00
|
|
|
Setup port 80 forwarding and launchd agents:
|
|
|
|
sudo pow --install-system
|
2011-08-05 19:02:24 +00:00
|
|
|
pow --install-local
|
2012-06-08 20:34:10 +00:00
|
|
|
|
2013-09-30 11:02:31 +00:00
|
|
|
Load launchd agents:
|
2012-06-08 20:34:10 +00:00
|
|
|
sudo launchctl load -w /Library/LaunchDaemons/cx.pow.firewall.plist
|
|
|
|
launchctl load -w ~/Library/LaunchAgents/cx.pow.powd.plist
|
2011-08-05 19:02:24 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|