diff options
| author | Peter Eisentraut | 2014-06-27 08:31:48 -0400 |
|---|---|---|
| committer | Mike McQuaid | 2014-06-27 15:48:03 +0100 |
| commit | eb24e9a234b03f1c9cab636523e6e4ea0ac00d87 (patch) | |
| tree | ec03bf82ea6800d9259db0b274430ea7e7a7e387 /Library/Formula/check_postgres.rb | |
| parent | 2d584129fe193d7e2944919ec20cd1983bc02ea5 (diff) | |
| download | homebrew-eb24e9a234b03f1c9cab636523e6e4ea0ac00d87.tar.bz2 | |
check_postgres 2.21.0 (new formula)
Diffstat (limited to 'Library/Formula/check_postgres.rb')
| -rw-r--r-- | Library/Formula/check_postgres.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/Library/Formula/check_postgres.rb b/Library/Formula/check_postgres.rb new file mode 100644 index 000000000..fbdb9b8f7 --- /dev/null +++ b/Library/Formula/check_postgres.rb @@ -0,0 +1,28 @@ +require "formula" + +class CheckPostgres < Formula + homepage "http://bucardo.org/wiki/Check_postgres" + url "http://bucardo.org/downloads/check_postgres-2.21.0.tar.gz" + sha1 "88ddb1c35a8da0feeaad90036dd27d778551a36d" + + head "https://github.com/bucardo/check_postgres.git" + + depends_on :postgresql + + def install + system "perl", "Makefile.PL", "PREFIX=#{prefix}" + system "make", "install" + mv bin/"check_postgres.pl", bin/"check_postgres" + inreplace [bin/"check_postgres", man1/"check_postgres.1p"], "check_postgres.pl", "check_postgres" + rm_rf prefix/"Library" + rm_rf prefix/"lib" + end + + test do + # This test verifies that check_postgres fails correctly, assuming + # that no server is running at that port. + output = `#{bin}/check_postgres --action=connection --port=65432` + assert output.include? "POSTGRES_CONNECTION CRITICAL" + assert_equal 2, $?.exitstatus + end +end |
