homebrew-core/Formula/freetds.rb
2015-12-21 13:37:49 +01:00

76 lines
2.4 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-0.95.76.tar.gz"
mirror "https://fossies.org/linux/privat/freetds-0.95.76.tar.gz"
sha256 "547c3025841cc6842d496d79cb2f350730c6cf819b31e61593da98672a66eed1"
bottle do
sha256 "4056eab4f027278370b918d4dea12a4745ee989859d1ebf4a872947fb70643a0" => :el_capitan
sha256 "f8a74993238a680dd65234d650f96f9ce22f38221e771e02e4847b0c1a0e76eb" => :yosemite
sha256 "642a149d205680f9501d556b23b562770cff1688ad8fd90e3f554729d62ede19" => :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