aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/sqsh.rb
blob: 781f6ec7f561094b67a1f753040a151fd70cad0e (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
30
31
32
33
34
35
36
require 'formula'

class Sqsh < Formula
  url 'http://downloads.sourceforge.net/sourceforge/sqsh/sqsh-2.1.7.tar.gz'
  homepage 'http://www.sqsh.org/'
  md5 'ce929dc8e23cedccac98288d24785e2d'

  depends_on :x11
  depends_on 'freetds'
  depends_on 'readline'

  def options
    [["--with-x", "Enable X windows support."]]
  end

  def install
    args = ["--disable-debug", "--disable-dependency-tracking",
            "--prefix=#{prefix}",
            "--mandir=#{man}",
            "--with-readline"]

    ENV['LIBDIRS'] = Readline.new('readline').lib
    ENV['INCDIRS'] = Readline.new('readline').include

    if ARGV.include? "--with-x"
      args << "--with-x"
      args << "--x-libraries=#{MacOS.x11_prefix}/lib"
      args << "--x-includes=#{MacOS.x11_prefix}/includes"
    end

    ENV['SYBASE'] = Freetds.new("freetds").prefix
    system "./configure", *args
    system "make", "install"
    system "make", "install.man"
  end
end