homebrew-core/Formula/freetds.rb
2018-08-19 14:37:56 +02:00

82 lines
2.7 KiB
Ruby

class Freetds < Formula
desc "Libraries to talk to Microsoft SQL Server and Sybase databases"
homepage "http://www.freetds.org/"
url "http://www.freetds.org/files/stable/freetds-1.00.94.tar.bz2"
mirror "https://fossies.org/linux/privat/freetds-1.00.94.tar.bz2"
sha256 "5fcf59a554eb3e72a09cc49c8dba5db8ad6dced07315ed775c4b8b2b81b603e4"
bottle do
sha256 "c9052158eba0e069705ed3d8f634cfc8a653e0f216cbc4b0c3fbfbb52ed793c9" => :mojave
sha256 "d896755316c4670c5f61d149ef703e07151c7c13670f0b80e436db3b7ff2bf7f" => :high_sierra
sha256 "7fbf04647a8f70aa5c830457bfcd31e533b2c60fc2873e4f7a712300cd2d535a" => :sierra
sha256 "58fa4410b8fe7faeb2461330ae9febbe3de742bcea4d3d615d1a8cdde85205ed" => :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}
--sysconfdir=#{etc}
]
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