aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorNeel Goyal2014-02-26 13:53:48 -0500
committerMike McQuaid2014-02-28 13:46:50 +0000
commit46d446397e8de975f3b15210919367eddb6ec8da (patch)
treea0217f44de5aad1440280fce73ca50aa422f8df4 /Library/Formula
parent9505e169debfb648670be110b2e2533deaaef6fa (diff)
downloadhomebrew-46d446397e8de975f3b15210919367eddb6ec8da.tar.bz2
getdns 0.1.0 (new formula)
Closes #27036. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/getdns.rb51
1 files changed, 51 insertions, 0 deletions
diff --git a/Library/Formula/getdns.rb b/Library/Formula/getdns.rb
new file mode 100644
index 000000000..2fc2912ae
--- /dev/null
+++ b/Library/Formula/getdns.rb
@@ -0,0 +1,51 @@
+require "formula"
+
+class Getdns < Formula
+ homepage "http://getdnsapi.net"
+ url "http://getdnsapi.net/dist/getdns-0.1.0.tar.gz"
+ sha1 "176d7a6d16ec5e0cfb8d34a303be1ccdbb0b4e5d"
+
+ depends_on "ldns"
+ depends_on "unbound"
+ depends_on "libidn"
+ depends_on "libevent"
+ depends_on "libuv" => :optional
+
+ def install
+ system "./configure", "--disable-debug",
+ "--disable-dependency-tracking",
+ "--disable-silent-rules",
+ "--prefix=#{prefix}"
+ system "make", "install"
+ end
+
+ test do
+ (testpath/"test.c").write <<-EOS.undent
+ #include <getdns/getdns.h>
+
+ int main(int argc, char *argv[]) {
+ getdns_context *context;
+ getdns_dict *api_info;
+ char *pp;
+ getdns_return_t r = getdns_context_create(&context, 0);
+ if (r != GETDNS_RETURN_GOOD) {
+ return -1;
+ }
+ api_info = getdns_context_get_api_information(context);
+ if (!api_info) {
+ return -1;
+ }
+ pp = getdns_pretty_print_dict(api_info);
+ if (!pp) {
+ return -1;
+ }
+ puts(pp);
+ getdns_dict_destroy(api_info);
+ getdns_context_destroy(context);
+ return 0;
+ }
+ EOS
+ system ENV.cc, "-I#{include}", "-o", "test", "test.c", "-lgetdns"
+ system "./test"
+ end
+end