2011-05-09 10:45:52 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Pgbouncer < Formula
|
|
|
|
homepage 'http://wiki.postgresql.org/wiki/PgBouncer'
|
2012-12-02 22:32:18 +00:00
|
|
|
url 'http://pgfoundry.org/frs/download.php/3393/pgbouncer-1.5.4.tar.gz'
|
|
|
|
sha1 '87c3dd7fc70cbbae93ce8865953891f0aabffd2d'
|
2011-05-09 10:45:52 +00:00
|
|
|
|
2012-05-14 18:17:17 +00:00
|
|
|
depends_on 'asciidoc' => :build
|
|
|
|
depends_on 'xmlto' => :build
|
2011-05-09 10:45:52 +00:00
|
|
|
depends_on 'libevent'
|
|
|
|
|
|
|
|
def install
|
2012-05-14 18:17:17 +00:00
|
|
|
ENV['XML_CATALOG_FILES'] = "#{etc}/xml/catalog"
|
|
|
|
|
|
|
|
system "./configure", "--disable-debug",
|
2011-05-09 10:45:52 +00:00
|
|
|
"--with-libevent=#{HOMEBREW_PREFIX}",
|
|
|
|
"--prefix=#{prefix}"
|
2012-05-14 18:17:17 +00:00
|
|
|
ln_s "../install-sh", "doc/install-sh"
|
2011-05-09 10:45:52 +00:00
|
|
|
system "make install"
|
|
|
|
bin.install "etc/mkauth.py"
|
|
|
|
etc.install %w(etc/pgbouncer.ini etc/userlist.txt)
|
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
def caveats; <<-EOS.undent
|
|
|
|
The config file: #{etc}/pgbouncer.ini is in the "ini" format and you
|
|
|
|
will need to edit it for your particular setup. See:
|
|
|
|
http://pgbouncer.projects.postgresql.org/doc/config.html
|
2011-05-09 10:45:52 +00:00
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
The auth_file option should point to the #{etc}/userlist.txt file which
|
|
|
|
can be populated by the #{bin}/mkauth.py script.
|
2011-05-09 10:45:52 +00:00
|
|
|
EOS
|
|
|
|
end
|
|
|
|
|
2012-11-25 15:06:41 +00:00
|
|
|
plist_options :manual => "pgbouncer -q #{HOMEBREW_PREFIX}/etc/pgbouncer.ini"
|
|
|
|
|
|
|
|
def plist; <<-EOS.undent
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
|
|
<plist version="1.0">
|
|
|
|
<dict>
|
|
|
|
<key>KeepAlive</key>
|
|
|
|
<true/>
|
|
|
|
<key>Label</key>
|
|
|
|
<string>#{plist_name}</string>
|
|
|
|
<key>ProgramArguments</key>
|
|
|
|
<array>
|
|
|
|
<string>#{opt_prefix}/bin/pgbouncer</string>
|
|
|
|
<string>-d</string>
|
|
|
|
<string>-q</string>
|
|
|
|
<string>#{etc}/pgbouncer.ini</string>
|
|
|
|
</array>
|
|
|
|
<key>RunAtLoad</key>
|
|
|
|
<true/>
|
|
|
|
<key>WorkingDirectory</key>
|
|
|
|
<string>#{HOMEBREW_PREFIX}</string>
|
|
|
|
</dict>
|
|
|
|
</plist>
|
|
|
|
EOS
|
2011-05-09 10:45:52 +00:00
|
|
|
end
|
|
|
|
end
|