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.69.tar.gz" mirror "https://fossies.org/linux/privat/freetds-0.95.69.tar.gz" sha256 "0443fa56a2cd6540a55d1bf7bc3aa483f7dfaeb538d9caf0c455bf4e0e43fe1f" bottle do sha256 "fa7c27accb7a33d1732f00ac6ba55adcc4f787d85729191719afb20c9fbec240" => :el_capitan sha256 "fe8fff265af5e88230a806ac2a881710a48481e1a5f1dc3495efd8ed5787f866" => :yosemite sha256 "12562a867f3ebfd0865ff264408195d6235588e77998733340a41ebcb32cdad5" => :mavericks end head do url "https://github.com/FreeTDS/freetds.git" depends_on "autoconf" => :build depends_on "automake" => :build depends_on "gettext" => :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 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? if build.head? system "./autogen.sh", *args else system "./configure", *args end system "make" ENV.j1 # Or fails to install on multi-core machines system "make", "install" end test do system "#{bin}/tsql", "-C" end end