From 22af865e4c3a2c0e16cc6ba24c4c485e11d57e93 Mon Sep 17 00:00:00 2001 From: conscell Date: Tue, 25 Mar 2014 22:19:00 +0900 Subject: [PATCH] PostgreSQL ODBC driver 09.03.0210 Closes Homebrew/homebrew#27853. Signed-off-by: Adam Vandenberg --- Formula/psqlodbc.rb | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Formula/psqlodbc.rb diff --git a/Formula/psqlodbc.rb b/Formula/psqlodbc.rb new file mode 100644 index 0000000000..d55fcaa7d0 --- /dev/null +++ b/Formula/psqlodbc.rb @@ -0,0 +1,33 @@ +require "formula" + +class PostgresqlInstalled < Requirement + fatal true + default_formula "postgresql" + + satisfy { which "pg_config" } +end + +class Psqlodbc < Formula + homepage "http://www.postgresql.org/" + url "http://ftp.postgresql.org/pub/odbc/versions/src/psqlodbc-09.03.0210.tar.gz" + sha1 "e1eb147ef0452e1f7b0f9e102dacb5654a580dba" + + depends_on "openssl" + depends_on "unixodbc" + depends_on PostgresqlInstalled + + def install + args = ["--prefix=#{prefix}", + "--with-unixodbc=#{Formula['unixodbc'].prefix}"] + + system "./configure", *args + system "make" + system "make", "install" + end + + test do + output = `#{Formula['unixodbc'].bin}/dltest #{lib}/psqlodbcw.so` + assert_equal "SUCCESS: Loaded #{lib}/psqlodbcw.so\n", output + assert_equal 0, $?.exitstatus + end +end