aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mysql-proxy.rb
blob: f46c8a578a5fb0cde078b49a326266c15db8e079 (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
require 'formula'

class MysqlProxy < Formula
  url 'http://launchpad.net/mysql-proxy/0.8/0.8.0/+download/mysql-proxy-0.8.0.tar.gz'
  homepage 'https://launchpad.net/mysql-proxy'
  md5 'b6a9748d72e8db7fe3789fbdd60ff451'

  depends_on 'pkg-config' => :build
  depends_on 'glib'
  depends_on 'libevent'
  depends_on 'lua'

  def install
    if `which mysql_config`.chomp.empty?
      opoo "`mysql_config` not found"
      puts "This software requires the MySQL client libraries."
      puts "You can install them via Homebrew with one of these:"
      puts "  brew install mysql-connector-c"
      puts "  brew install mysql [--client-only]"
      puts "Without the client libraries, this formula will fail to compile."
    end

    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          # Ugh, don't dump these directly into /usr/local/include.
                          # Use a subfolder, please.
                          "--includedir=#{include}/mysqlproxy"
    system "make install"
    # Copy over the example scripts
    (share+"mysqlproxy").install Dir['examples/*.lua']
  end
end