Permalink
Browse files

dnsmasq: add optional IDN support

Depends on libidn only if the option is supplied.

Signed-off-by: Adam Vandenberg <flangy@gmail.com>
  • Loading branch information...
1 parent d6de721 commit 327de8cab667c49f8ec729713f8ce9fd36163dbe @cee-dub cee-dub committed with adamv Dec 28, 2011
Showing with 11 additions and 0 deletions.
  1. +11 −0 Library/Formula/dnsmasq.rb
@@ -5,12 +5,23 @@ class Dnsmasq < Formula
homepage 'http://www.thekelleys.org.uk/dnsmasq/doc.html'
md5 'd10faeb409717eae94718d7716ca63a4'
+ def options
+ [['--with-idn', "Compile with IDN support"]]
+ end
+
+ depends_on "libidn" if ARGV.include? '--with-idn'
+
def install
ENV.deparallelize
# Fix etc location
inreplace "src/config.h", "/etc/dnsmasq.conf", "#{etc}/dnsmasq.conf"
+ # Optional IDN support
+ if ARGV.include? '--with-idn'
+ inreplace "src/config.h", "/* #define HAVE_IDN */", "#define HAVE_IDN"
+ end
+
# Fix compilation on Lion
ENV.append_to_cflags "-D__APPLE_USE_RFC_3542" if 10.7 <= MACOS_VERSION
inreplace "Makefile" do |s|

0 comments on commit 327de8c

Please sign in to comment.