2009-11-05 02:43:32 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Freetds < Formula
|
|
|
|
homepage 'http://www.freetds.org/'
|
2012-07-02 20:44:58 +00:00
|
|
|
url 'http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz'
|
2012-05-25 15:58:52 +00:00
|
|
|
sha1 '3ab06c8e208e82197dc25d09ae353d9f3be7db52'
|
|
|
|
|
2013-09-20 15:15:54 +00:00
|
|
|
head do
|
|
|
|
url 'https://git.gitorious.org/freetds/freetds.git'
|
2013-07-18 16:10:33 +00:00
|
|
|
|
2013-11-13 16:52:55 +00:00
|
|
|
depends_on :autoconf
|
2013-07-18 16:10:33 +00:00
|
|
|
depends_on :automake
|
|
|
|
depends_on :libtool
|
|
|
|
end
|
|
|
|
|
2013-07-18 16:33:42 +00:00
|
|
|
option :universal
|
2013-09-18 18:04:23 +00:00
|
|
|
option "enable-msdblib", "Enable Microsoft behavior in the DB-Library API where it diverges from Sybase's"
|
|
|
|
option "enable-sybase-compat", "Enable close compatibility with Sybase's ABI, at the expense of other features"
|
2014-02-06 15:30:18 +00:00
|
|
|
option "enable-odbc-wide", "Enable odbc wide, prevent unicode - MemoryError's"
|
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
|
|
|
|
|
2009-11-05 02:43:32 +00:00
|
|
|
def install
|
2013-07-18 16:10:33 +00:00
|
|
|
system "autoreconf -i" if build.head?
|
|
|
|
|
2012-06-22 03:34:10 +00:00
|
|
|
args = %W[--prefix=#{prefix}
|
2013-10-10 18:25:56 +00:00
|
|
|
--with-openssl=#{MacOS.sdk_path}/usr
|
2012-06-22 03:34:10 +00:00
|
|
|
--with-tdsver=7.1
|
|
|
|
--mandir=#{man}
|
|
|
|
]
|
2012-05-25 15:58:52 +00:00
|
|
|
|
2014-03-06 20:40:26 +00:00
|
|
|
if build.with? "unixodbc"
|
2014-02-25 05:47:27 +00:00
|
|
|
args << "--with-unixodbc=#{Formula['unixodbc'].prefix}"
|
2012-05-25 15:58:52 +00:00
|
|
|
end
|
|
|
|
|
2013-09-18 18:04:23 +00:00
|
|
|
if build.include? "enable-msdblib"
|
|
|
|
args << "--enable-msdblib"
|
|
|
|
end
|
|
|
|
|
|
|
|
if build.include? "enable-sybase-compat"
|
|
|
|
args << "--enable-sybase-compat"
|
|
|
|
end
|
|
|
|
|
2014-02-06 15:30:18 +00:00
|
|
|
if build.include? "enable-odbc-wide"
|
|
|
|
args << "--enable-odbc-wide"
|
|
|
|
end
|
|
|
|
|
2013-07-18 16:33:42 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2012-05-25 15:58:52 +00:00
|
|
|
system "./configure", *args
|
2009-11-05 02:43:32 +00:00
|
|
|
system 'make'
|
2011-08-24 21:23:36 +00:00
|
|
|
ENV.j1 # Or fails to install on multi-core machines
|
2009-11-05 02:43:32 +00:00
|
|
|
system 'make install'
|
|
|
|
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
|