class Freetds < Formula desc "Libraries to talk to Microsoft SQL Server and Sybase databases" homepage "http://www.freetds.org/" url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.95.18.tar.gz" mirror "https://fossies.org/linux/privat/freetds-0.95.18.tar.gz" sha256 "4a85876ed353efe8c204b991ff1d972912f18a7a4856f56e8cc76b32d3fbd2dc" bottle do sha256 "2ff87990763c11fdfa2a59c754faa5610430796f6af80afc8166a414f179efa8" => :yosemite sha256 "67af4da49ced9863022329c98ab448a93444550115c3779ed13a48953309394f" => :mavericks sha256 "4b19c0fd08a6efbaa982a6eaa564f4bd44c26a3b0ef9021862840c5bfe6e795c" => :mountain_lion end head do url "https://github.com/FreeTDS/freetds.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "libtool" => :build end option :universal 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" deprecated_option "enable-msdblib" => "with-msdblib" deprecated_option "enable-sybase-compat" => "with-sybase-compat" deprecated_option "enable-odbc-wide" => "with-odbc-wide" deprecated_option "enable-krb" => "with-krb5" 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 ENV.universal_binary if build.universal? system "./configure", *args system "make" ENV.j1 # Or fails to install on multi-core machines system "make", "install" end test do system "#{bin}/tsql", "-C" end end