aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2012-11-05 20:03:26 -0600
committerJack Nagel2012-11-08 16:01:59 -0600
commit1c56cda4f1ab9ac1fcd6f2deb53f04f8b8455d81 (patch)
treea7139f1c891eeca0f592095018dde45e22b2f34c /Library
parent1cb59ea5fdd84ebec29ddd52a54c9c76dc8cac09 (diff)
downloadbrew-1c56cda4f1ab9ac1fcd6f2deb53f04f8b8455d81.tar.bz2
Factor out MySQL and Postgres requirements
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/dependencies.rb4
-rw-r--r--Library/Homebrew/requirements.rb43
2 files changed, 47 insertions, 0 deletions
diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb
index 352688839..e12cfb22a 100644
--- a/Library/Homebrew/dependencies.rb
+++ b/Library/Homebrew/dependencies.rb
@@ -72,6 +72,10 @@ private
X11Dependency.new(tag)
when :xcode
XcodeDependency.new(tag)
+ when :mysql
+ MysqlInstalled.new(tag)
+ when :postgresql
+ PostgresqlInstalled.new(tag)
else
raise "Unsupported special dependency #{spec}"
end
diff --git a/Library/Homebrew/requirements.rb b/Library/Homebrew/requirements.rb
index 7f1a02da8..96c3b5cbd 100644
--- a/Library/Homebrew/requirements.rb
+++ b/Library/Homebrew/requirements.rb
@@ -219,3 +219,46 @@ class XcodeDependency < Requirement
EOS
end
end
+
+class MysqlInstalled < Requirement
+ def fatal?; true; end
+
+ def satisfied?
+ which 'mysql_config'
+ end
+
+ 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
+end
+
+class PostgresInstalled < Requirement
+ def fatal?; true; end
+
+ def satisfied?
+ which 'pg_config'
+ end
+
+ def message
+ <<-EOS.undent
+ Postgres is required to install.
+
+ You can install this with Homebrew using:
+ brew install postgres
+
+ Or you can use an official installer from:
+ http://www.postgresql.org/download/macosx/
+ EOS
+ end
+end