82 lines
2.7 KiB
Ruby
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.97.tar.bz2"
|
|
mirror "https://fossies.org/linux/privat/freetds-1.00.97.tar.bz2"
|
|
sha256 "0d030d0aa3aafca1c018395e14a4fff2f6663732dfb2620c991492356048ab1c"
|
|
|
|
bottle do
|
|
sha256 "1fce76b8197f4ad51a7341968cb4a4b7a1abcf3b99336b2d843d8737623cc0d2" => :mojave
|
|
sha256 "6bbfc51ce6fc759a6da8a4daae892a178b362aea819d68d399b269cfd591cf33" => :high_sierra
|
|
sha256 "88325342ba3d7e14f20aea732e7285a77c4d88916f9bbd50fd709bd5c3657b72" => :sierra
|
|
sha256 "17e7fdd678af4b3456c6fa132da16f8c4c9b7b2b8dcc66d8e66fbe00ff3ee122" => :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
|