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.1.tar.gz" sha256 "bb81968691502c4f2ce904e1cf4e3c3e6da311999d1e9829d12a4271e6811a7c" bottle do sha256 "e49cee90451411cafccf7a967519814cf2a25a120e8703012c8ad674c5b0f40c" => :yosemite sha256 "809bc9ded6749e29dce21633b281ce48e32e349d57712645a588291afe50ad1f" => :mavericks sha256 "6f2f8964dfdc0020b03ab9c28f37fa60343c7316f063c9c4e47293e4e6e6f764" => :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