forked from lotia/homebrew-versions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
freetds091.rb
55 lines (45 loc) · 1.72 KB
/
freetds091.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class Freetds091 < Formula
desc "Libraries to talk to Microsoft SQL Server & Sybase"
homepage "http://www.freetds.org/"
url "ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.91.112.tar.gz"
sha256 "be4f04ee57328c32e7e7cd7e2e1483e535071cec6101e46b9dd15b857c5078ed"
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"
option "without-openssl", "Build without OpenSSL support (default is to use brewed OpenSSL)"
depends_on "pkg-config" => :build
depends_on "unixodbc" => :optional
depends_on "openssl" => :recommended
conflicts_with "freetds", :because => "Differing version of same formula"
def install
system "autoreconf", "-i" if build.head?
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?
system "./configure", *args
system "make"
ENV.j1 # Or fails to install on multi-core machines
system "make", "install"
end
test do
system "#{bin}/tsql", "-C"
end
end