diff options
Diffstat (limited to 'Library/Formula/dbslayer.rb')
| -rw-r--r-- | Library/Formula/dbslayer.rb | 45 |
1 files changed, 25 insertions, 20 deletions
diff --git a/Library/Formula/dbslayer.rb b/Library/Formula/dbslayer.rb index 2b2e32cb4..dec1e3e93 100644 --- a/Library/Formula/dbslayer.rb +++ b/Library/Formula/dbslayer.rb @@ -1,34 +1,39 @@ require 'formula' +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 + class Dbslayer < Formula homepage 'http://code.nytimes.com/projects/dbslayer/wiki' url 'http://code.nytimes.com/downloads/dbslayer-beta-12.tgz' version '0.12.b' md5 'a529ea503c244d723166f78c75df3bb3' - def install - unless which 'mysql_config' - opoo "No MySQL client library detected" - puts "This formula may fail to build, see caveats for more information." - end + depends_on MySqlInstalled.new + def install system "./configure", "--prefix=#{prefix}" system "make" system "make install" end - - def caveats; <<-EOS.undent - DBSlayer depends on a MySQL client library. - - You can install this with Homebrew using: - brew install mysql - For MySQL server. - - brew install mysql-connector-c - For MySQL client libraries only. - - We don't install these for you when you install this formula, as - we don't know which datasource you intend to use. - EOS - end end |
