diff options
| author | Mike McQuaid | 2012-11-25 15:06:41 +0000 | 
|---|---|---|
| committer | Mike McQuaid | 2012-11-25 23:05:52 +0000 | 
| commit | 5825f62337c087897ae255a92ad94619a1dd1981 (patch) | |
| tree | d8e4885a3b5c8b00fc3ceae3969cf5df4354881c /Library/Formula/pgbouncer.rb | |
| parent | 6dc4678ad3e88918e3b47da5d8b09b2e4677012c (diff) | |
| download | homebrew-5825f62337c087897ae255a92ad94619a1dd1981.tar.bz2 | |
Make generic caveats for launchd plist files.
Diffstat (limited to 'Library/Formula/pgbouncer.rb')
| -rw-r--r-- | Library/Formula/pgbouncer.rb | 80 | 
1 files changed, 33 insertions, 47 deletions
diff --git a/Library/Formula/pgbouncer.rb b/Library/Formula/pgbouncer.rb index 3d332edda..1c891a678 100644 --- a/Library/Formula/pgbouncer.rb +++ b/Library/Formula/pgbouncer.rb @@ -21,56 +21,42 @@ class Pgbouncer < Formula      etc.install %w(etc/pgbouncer.ini etc/userlist.txt)    end -  def caveats -    s = <<-EOS -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 +  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 -The auth_file option should point to the #{etc}/userlist.txt file which -can be populated by the #{bin}/mkauth.py script. - -If this is your first install, automatically load on login with: -    mkdir -p ~/Library/LaunchAgents -    cp #{plist_path} ~/Library/LaunchAgents/ -    launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} - -If this is an upgrade and you already have the #{plist_path.basename} -loaded: -    launchctl unload -w ~/Library/LaunchAgents/#{plist_path.basename} -    cp #{plist_path} ~/Library/LaunchAgents/ -    launchctl load -w ~/Library/LaunchAgents/#{plist_path.basename} - -Or start manually with: -    pgbouncer -q #{etc}/pgbouncer.ini +    The auth_file option should point to the #{etc}/userlist.txt file which +    can be populated by the #{bin}/mkauth.py script.      EOS    end -  def startup_plist -    return <<-EOPLIST -<?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>#{HOMEBREW_PREFIX}/bin/pgbouncer</string> -    <string>-d</string> -    <string>-q</string> -    <string>#{etc}/pgbouncer.ini</string> -  </array> -  <key>RunAtLoad</key> -  <true/> -  <key>UserName</key> -  <string>#{`whoami`.chomp}</string> -  <key>WorkingDirectory</key> -  <string>#{HOMEBREW_PREFIX}</string> -</dict> -</plist> -    EOPLIST +  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>UserName</key> +        <string>#{`whoami`.chomp}</string> +        <key>WorkingDirectory</key> +        <string>#{HOMEBREW_PREFIX}</string> +      </dict> +      </plist> +    EOS    end  end  | 
