aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/freetds.rb
blob: 4846fc577430f41c69addff8e8b7c2a228428940 (plain)
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
require 'formula'

class Freetds < Formula
  homepage 'http://www.freetds.org/'
  url 'http://mirrors.ibiblio.org/freetds/stable/freetds-0.91.tar.gz'
  sha1 '3ab06c8e208e82197dc25d09ae353d9f3be7db52'

  option 'with-unixodbc', "Compile against unixODBC"

  depends_on "pkg-config" => :build
  depends_on "unixodbc" if build.include? "with-unixodbc"

  def install
    args = %W[--prefix=#{prefix}
              --with-openssl=/usr/bin
              --with-tdsver=7.1
              --mandir=#{man}
            ]

    if build.include? "with-unixodbc"
      args << "--with-unixodbc=#{Formula.factory('unixodbc').prefix}"
    end

    system "./configure", *args
    system 'make'
    ENV.j1 # Or fails to install on multi-core machines
    system 'make install'
  end
end