From 2eb8f45c86a76694a48c4a46df4556520c109b98 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 10 Mar 2017 18:50:34 +0000 Subject: [PATCH] freetds@0.91: import from homebrew/versions. --- Formula/freetds@0.91.rb | 53 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Formula/freetds@0.91.rb diff --git a/Formula/freetds@0.91.rb b/Formula/freetds@0.91.rb new file mode 100644 index 0000000000..5fe4067c4e --- /dev/null +++ b/Formula/freetds@0.91.rb @@ -0,0 +1,53 @@ +class FreetdsAT091 < Formula + desc "Libraries to talk to Microsoft SQL Server & Sybase" + homepage "http://www.freetds.org/" + url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.91.112.tar.gz" + sha256 "be4f04ee57328c32e7e7cd7e2e1483e535071cec6101e46b9dd15b857c5078ed" + + keg_only :versioned_formula + + option "with-msdblib", "Enable Microsoft behavior in the DB-Library API where it diverges from Sybase's" + option "with-sybase-compat", "Enable close compatibility with Sybase's ABI, at the expense of other features" + option "with-odbc-wide", "Enable odbc wide, prevent unicode - MemoryError's" + option "with-krb5", "Enable Kerberos support" + option "without-openssl", "Build without OpenSSL support (default is to use brewed OpenSSL)" + + depends_on "pkg-config" => :build + depends_on "unixodbc" => :optional + depends_on "openssl" => :recommended + + def install + system "autoreconf", "-i" if build.head? + + args = %W[ + --prefix=#{prefix} + --with-tdsver=7.1 + --mandir=#{man} + ] + + if build.with? "openssl" + args << "--with-openssl=#{Formula["openssl"].opt_prefix}" + end + + if build.with? "unixodbc" + args << "--with-unixodbc=#{Formula["unixodbc"].opt_prefix}" + end + + # Translate formula's "--with" options to configuration script's "--enable" + # options + %w[msdblib sybase-compat odbc-wide krb5].each do |option| + if build.with? option + args << "--enable-#{option}" + end + end + + system "./configure", *args + system "make" + ENV.deparallelize # Or fails to install on multi-core machines + system "make", "install" + end + + test do + system "#{bin}/tsql", "-C" + end +end