diff options
| author | Adam Vandenberg | 2012-02-29 20:36:21 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-03-10 09:24:10 -0800 |
| commit | 939a1bb1cb742361ae8793f81fcfa54f849ee41a (patch) | |
| tree | 39cc8995bb0f9a74072f87364f969a04153a2848 /Library/Formula/pgtap.rb | |
| parent | d5f0cb3c0782d0893ca8397d4f7d8b5781dee9cd (diff) | |
| download | homebrew-939a1bb1cb742361ae8793f81fcfa54f849ee41a.tar.bz2 | |
Use new Requirements in formulae
Diffstat (limited to 'Library/Formula/pgtap.rb')
| -rw-r--r-- | Library/Formula/pgtap.rb | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Library/Formula/pgtap.rb b/Library/Formula/pgtap.rb index 16415304a..fc5149253 100644 --- a/Library/Formula/pgtap.rb +++ b/Library/Formula/pgtap.rb @@ -1,25 +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 Pgtap < Formula url 'http://pgfoundry.org/frs/download.php/2701/pgtap-0.24.tar.bz2' homepage 'http://pgtap.org' md5 '9d0360c87fca0ddf3ca9da49b9b71947' - skip_clean :all + depends_on PostgresqlInstalled.new def install - unless which 'pg_config' - opoo "No pg_config was detected." - puts <<-EOS.undent - pg_top requires postgresql in order to compile, but pg_config was not - found. This install will likely fail. - - You can install this with: - brew install postgresql - or by using a package installer from the PostgreSQL project itself. - EOS - end - system "make install" bin.install %w(bbin/pg_prove bbin/pg_tapgen) end |
