2010-08-11 21:52:10 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2012-03-01 04:36:21 +00:00
|
|
|
class MySqlInstalled < Requirement
|
|
|
|
def message; <<-EOS.undent
|
|
|
|
MySQL is required to install.
|
|
|
|
|
|
|
|
You can install this with Homebrew using:
|
|
|
|
brew install mysql-connector-c
|
|
|
|
For MySQL client libraries only.
|
|
|
|
|
|
|
|
brew install mysql
|
|
|
|
For MySQL server.
|
|
|
|
|
|
|
|
Or you can use an official installer from:
|
|
|
|
http://dev.mysql.com/downloads/mysql/
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
def satisfied?
|
|
|
|
which 'mysql_config'
|
|
|
|
end
|
|
|
|
def fatal?
|
|
|
|
true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class MysqlProxy < Formula
|
2010-08-11 21:52:10 +00:00
|
|
|
homepage 'https://launchpad.net/mysql-proxy'
|
2012-08-02 03:50:47 +00:00
|
|
|
url 'https://launchpad.net/mysql-proxy/0.8/0.8.2/+download/mysql-proxy-0.8.2.tar.gz'
|
|
|
|
sha1 '3ae4f2f68849cfd95eeaf033af8df78d643dbf4d'
|
2010-08-11 21:52:10 +00:00
|
|
|
|
2012-03-01 04:36:21 +00:00
|
|
|
depends_on MySqlInstalled.new
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-08-11 21:52:10 +00:00
|
|
|
depends_on 'glib'
|
|
|
|
depends_on 'libevent'
|
|
|
|
depends_on 'lua'
|
|
|
|
|
|
|
|
def install
|
|
|
|
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
|