2009-11-05 02:43:32 +00:00
|
|
|
class Freetds < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Libraries to talk to Microsoft SQL Server and Sybase databases"
|
2014-08-24 16:07:22 +00:00
|
|
|
homepage "http://www.freetds.org/"
|
2015-09-05 23:18:19 +00:00
|
|
|
url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.95.19.tar.gz"
|
|
|
|
mirror "https://fossies.org/linux/privat/freetds-0.95.19.tar.gz"
|
|
|
|
sha256 "4c847f0c43734489ffc6ea8c5eb66e2a24e7a1ba4287acd24b2950f8b2eb7590"
|
2012-05-25 15:58:52 +00:00
|
|
|
|
2014-08-22 18:04:04 +00:00
|
|
|
bottle do
|
2015-09-21 18:49:29 +00:00
|
|
|
sha256 "00fb9daeb14892d7de89ee1fbf0612f49da34d8047315ff6a11725c785aaf34e" => :el_capitan
|
2015-09-06 03:35:31 +00:00
|
|
|
sha256 "46c8bd1ddb9ba17f2245ddb138e8bf73bcb48c38e650d79d4838a52d027b5cd0" => :yosemite
|
|
|
|
sha256 "0705eee494de88ffd20a3df3510d67251189119e2dc8a42ba11a2a1768252803" => :mavericks
|
|
|
|
sha256 "1612e4ecf101341ce1ea78d195ab7b94641e04b20fedf376e854aef163526a6b" => :mountain_lion
|
2014-08-22 18:04:04 +00:00
|
|
|
end
|
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
head do
|
2015-04-29 22:44:30 +00:00
|
|
|
url "https://github.com/FreeTDS/freetds.git"
|
2013-07-18 16:10:33 +00:00
|
|
|
|
2014-12-04 17:01:21 +00:00
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "automake" => :build
|
2015-09-05 23:18:19 +00:00
|
|
|
depends_on "gettext" => :build
|
2014-12-04 17:01:21 +00:00
|
|
|
depends_on "libtool" => :build
|
2013-07-18 16:10:33 +00:00
|
|
|
end
|
|
|
|
|
2013-07-18 16:33:42 +00:00
|
|
|
option :universal
|
2015-04-29 22:44:30 +00:00
|
|
|
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"
|
2013-07-18 16:33:42 +00:00
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
depends_on "unixodbc" => :optional
|
2015-04-29 22:44:30 +00:00
|
|
|
depends_on "openssl" => :recommended
|
2013-09-20 15:15:54 +00:00
|
|
|
|
2009-11-05 02:43:32 +00:00
|
|
|
def install
|
2014-04-22 22:04:44 +00:00
|
|
|
args = %W[
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--with-tdsver=7.1
|
|
|
|
--mandir=#{man}
|
|
|
|
]
|
2012-05-25 15:58:52 +00:00
|
|
|
|
2015-04-29 22:44:30 +00:00
|
|
|
if build.with? "openssl"
|
|
|
|
args << "--with-openssl=#{Formula["openssl"].opt_prefix}"
|
2013-09-18 18:04:23 +00:00
|
|
|
end
|
|
|
|
|
2015-04-29 22:44:30 +00:00
|
|
|
if build.with? "unixodbc"
|
2015-05-05 13:39:53 +00:00
|
|
|
args << "--with-unixodbc=#{Formula["unixodbc"].opt_prefix}"
|
2014-02-06 15:30:18 +00:00
|
|
|
end
|
|
|
|
|
2015-04-29 22:44:30 +00:00
|
|
|
# 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
|
2014-05-05 13:14:00 +00:00
|
|
|
end
|
|
|
|
|
2013-07-18 16:33:42 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2015-09-05 23:18:19 +00:00
|
|
|
|
|
|
|
if build.head?
|
|
|
|
system "./autogen.sh", *args
|
|
|
|
else
|
|
|
|
system "./configure", *args
|
|
|
|
end
|
2014-08-24 16:07:22 +00:00
|
|
|
system "make"
|
2011-08-24 21:23:36 +00:00
|
|
|
ENV.j1 # Or fails to install on multi-core machines
|
2014-08-24 16:07:22 +00:00
|
|
|
system "make", "install"
|
2009-11-05 02:43:32 +00:00
|
|
|
end
|
2013-07-18 16:28:10 +00:00
|
|
|
|
2014-02-23 21:31:41 +00:00
|
|
|
test do
|
2013-07-18 16:28:10 +00:00
|
|
|
system "#{bin}/tsql", "-C"
|
|
|
|
end
|
2009-11-05 02:43:32 +00:00
|
|
|
end
|