aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/mydumper.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/mydumper.rb')
-rw-r--r--Library/Formula/mydumper.rb33
1 files changed, 24 insertions, 9 deletions
diff --git a/Library/Formula/mydumper.rb b/Library/Formula/mydumper.rb
index 5e897c051..0e3d9f7af 100644
--- a/Library/Formula/mydumper.rb
+++ b/Library/Formula/mydumper.rb
@@ -1,25 +1,40 @@
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 Mydumper < Formula
homepage 'http://www.mydumper.org/'
url 'http://launchpadlibrarian.net/77098505/mydumper-0.5.1.tar.gz'
md5 'b4df42dfe23f308ab13eb6ecb73a0d21'
+ depends_on MySqlInstalled.new
depends_on 'pkg-config' => :build
depends_on 'cmake' => :build
depends_on 'glib'
depends_on 'pcre'
def install
- unless which 'mysql_config'
- opoo "`mysql_config` was 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 "cmake #{std_cmake_parameters} ."
system "make install"
end