aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJoshua Peek2015-02-09 21:57:19 -0800
committerMike McQuaid2015-02-11 10:57:01 +0000
commitb662fa9107512beaf87a66921a241d96f0b47b88 (patch)
tree834ccd730177500b78632ca782ea675760b3e454 /Library/Formula
parentcba0ab3053291cc957e877cf9018b2709c0907ef (diff)
downloadhomebrew-b662fa9107512beaf87a66921a241d96f0b47b88.tar.bz2
launchdns 1.0.1 (new formula)
Closes #36695. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/launchdns.rb55
1 files changed, 55 insertions, 0 deletions
diff --git a/Library/Formula/launchdns.rb b/Library/Formula/launchdns.rb
new file mode 100644
index 000000000..5bce277a2
--- /dev/null
+++ b/Library/Formula/launchdns.rb
@@ -0,0 +1,55 @@
+class Launchdns < Formula
+ homepage "https://github.com/josh/launchdns"
+ url "https://github.com/josh/launchdns/archive/v1.0.1.tar.gz"
+ head "https://github.com/josh/launchdns.git"
+ sha1 "7310bb558a3b910e98b5364652e3a4fb48375494"
+
+ def install
+ ENV["PREFIX"] = prefix
+ system "make", "install"
+
+ (prefix+"etc/resolver/dev").write("nameserver 127.0.0.1\nport 55353\n")
+ end
+
+ test do
+ system "#{bin}/launchdns", "-p0", "-t1"
+ end
+
+ def caveats; <<-EOS.undent
+ To have *.dev resolved to 127.0.0.1:
+ sudo ln -s #{HOMEBREW_PREFIX}/etc/resolver /etc/resolver
+ EOS
+ end
+
+ plist_options :manual => "launchdns"
+
+ def plist; <<-EOS.undent
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!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>ProgramArguments</key>
+ <array>
+ <string>#{opt_bin}/launchdns</string>
+ <string>--socket=Listeners</string>
+ <string>--timeout=30</string>
+ </array>
+ <key>Sockets</key>
+ <dict>
+ <key>Listeners</key>
+ <dict>
+ <key>SockType</key>
+ <string>dgram</string>
+ <key>SockNodeName</key>
+ <string>127.0.0.1</string>
+ <key>SockServiceName</key>
+ <string>55353</string>
+ </dict>
+ </dict>
+ </dict>
+ </plist>
+ EOS
+ end
+end