80 lines
2.6 KiB
Ruby
80 lines
2.6 KiB
Ruby
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-1.00.62.tar.bz2"
|
|
mirror "https://fossies.org/linux/privat/freetds-1.00.62.tar.bz2"
|
|
sha256 "3a369aa00078f87dd3765006f772bfcf813bc46462d35fe6abf38d4b9dcca181"
|
|
|
|
bottle do
|
|
sha256 "ad7833dbfa83713bba2b20b9cce99d08f41e102b27ac30d8683365fbe9fc4c43" => :high_sierra
|
|
sha256 "3862c1f93c54f910fa64c1c73ae6eae296f4ee4e28e6b9fbfd0559884294ca28" => :sierra
|
|
sha256 "63f6e9498efebf122dc8fe27a2cc0a78a54a22c68819a2dee9ce2476f09d624f" => :el_capitan
|
|
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 "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 "libiodbc" => :optional
|
|
depends_on "openssl" => :recommended
|
|
|
|
def install
|
|
if build.with?("unixodbc") && build.with?("libiodbc")
|
|
odie "freetds: --without-libiodbc must be specified when using --with-unixodbc"
|
|
end
|
|
|
|
args = %W[
|
|
--prefix=#{prefix}
|
|
--with-tdsver=7.3
|
|
--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
|
|
|
|
if build.with? "libiodbc"
|
|
args << "--with-libiodbc=#{Formula["libiodbc"].opt_prefix}"
|
|
end
|
|
|
|
# Translate formula's "--with" options to configuration script's "--enable"
|
|
# options
|
|
%w[msdblib sybase-compat odbc-wide krb5].each do |option|
|
|
args << "--enable-#{option}" if build.with? option
|
|
end
|
|
|
|
if build.head?
|
|
system "./autogen.sh", *args
|
|
else
|
|
system "./configure", *args
|
|
end
|
|
system "make"
|
|
ENV.deparallelize # Or fails to install on multi-core machines
|
|
system "make", "install"
|
|
end
|
|
|
|
test do
|
|
system "#{bin}/tsql", "-C"
|
|
end
|
|
end
|