aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAnil Madhavapeddy2012-01-22 21:42:17 +0000
committerAdam Vandenberg2012-03-18 17:28:01 -0700
commit45d78a84e6789239e2e95a516d7237bcf2fedcc6 (patch)
tree507ad3b51c971007c542aef0ad3779a05b5131de /Library
parent94af6cd1e4af0b561fb3ba1eafa9463ff62b4552 (diff)
downloadhomebrew-45d78a84e6789239e2e95a516d7237bcf2fedcc6.tar.bz2
ldns: add a --python option to build bindings
These are optional due to the Swig dependency only being needed for the bindings Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Formula/ldns.rb22
1 files changed, 18 insertions, 4 deletions
diff --git a/Library/Formula/ldns.rb b/Library/Formula/ldns.rb
index f2b442b96..b262419c2 100644
--- a/Library/Formula/ldns.rb
+++ b/Library/Formula/ldns.rb
@@ -1,13 +1,27 @@
require 'formula'
+def build_bindings?
+ ARGV.include? '--python'
+end
+
class Ldns < Formula
- url 'http://nlnetlabs.nl/downloads/ldns/ldns-1.6.12.tar.gz'
homepage 'http://nlnetlabs.nl/projects/ldns/'
+ url 'http://nlnetlabs.nl/downloads/ldns/ldns-1.6.12.tar.gz'
sha1 '1d61df0f666908551d5a62768f77d63e727810aa'
+ depends_on 'swig' if build_bindings?
+
+ def options
+ [["--python", "Build Python pydns bindings"]]
+ end
+
def install
- system "./configure", "--prefix=#{prefix}", "--disable-gost", "--with-drill", "--with-examples"
- system "make"
- system "make install"
+ args = ["--prefix=#{prefix}", "--disable-gost", "--with-drill", "--with-examples"]
+ args << "--with-pyldns" if build_bindings?
+ ENV.append "LDFLAGS", "-L#{HOMEBREW_PREFIX}/lib"
+ system "./configure", *args
+ system "make"
+ system "make install"
+ system "make install-pyldns" if build_bindings?
end
end