diff options
| author | Jack Nagel | 2012-05-07 20:56:31 -0500 |
|---|---|---|
| committer | Jack Nagel | 2012-05-07 21:05:55 -0500 |
| commit | 30186e05063f45cc7001d089abc97f0e3795f708 (patch) | |
| tree | 4a75de79dd14e588925569f508e83456b7d64865 /Library/Formula | |
| parent | f944ac3aa059d829fdb0db57ee6bf8d8958d9534 (diff) | |
| download | homebrew-30186e05063f45cc7001d089abc97f0e3795f708.tar.bz2 | |
pgpool-ii: use a Requirement for Postgres
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/pgpool-ii.rb | 33 |
1 files changed, 22 insertions, 11 deletions
diff --git a/Library/Formula/pgpool-ii.rb b/Library/Formula/pgpool-ii.rb index c43bd92fd..0c989229f 100644 --- a/Library/Formula/pgpool-ii.rb +++ b/Library/Formula/pgpool-ii.rb @@ -1,21 +1,32 @@ require 'formula' +class PostgresqlInstalled < Requirement + def message; <<-EOS.undent + PostgresQL is required to install. + + You can install this with: + brew install postgresql + + Or you can use an official installer from: + http://www.postgresql.org/ + EOS + end + def satisfied? + which 'pg_config' + end + def fatal? + true + end +end + class PgpoolIi < Formula - url 'http://pgfoundry.org/frs/download.php/2841/pgpool-II-3.0.1.tar.gz' homepage 'http://pgpool.projects.postgresql.org/' + url 'http://pgfoundry.org/frs/download.php/2841/pgpool-II-3.0.1.tar.gz' md5 '86d8beff0396d11b6753dd2be31bcad7' - def install - if `/usr/bin/which pg_config`.chomp.empty? - opoo "No PostgreSQL was detected." - puts <<-EOS.undent - This formula uses `pg_config` to detect an installed PostgreSQL instead - of "depends_on 'postgresql'" so you can use a non-Homebrew version. - You may want to `brew install postgresql` if you don't have another - version already installed. - EOS - end + depends_on PostgresqlInstalled.new + def install system "./configure", "--prefix=#{prefix}", "--mandir=#{man}" system "make install" end |
