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.8.tar.gz" mirror "https://fossies.org/linux/privat/freetds-0.95.8.tar.gz" sha256 "e31eec13907e0bb5e8fb86237b59f4b3cb44d6a91652a1bc8b0d86aaa0ba5ab5" bottle do sha256 "a0b474e2e2ca56801e93880e128eee8bfa15acd6760e55eee0a21aeadd7c4e70" => :yosemite sha256 "4c07e7a6aae583dce5d6fb1b761d4115e5177bd7861661a9daf22cf916cec967" => :mavericks sha256 "eadf351ec885fd512763ff7cf54778c5d09e3fd68c38c0431aeb5c9c0c56639d" => :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" option "without-openssl", "Build without OpenSSL support (default is to use brewed OpenSSL)" 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