[arch-commits] Commit in (8 files)

Dan McGee dan at archlinux.org
Tue Jan 15 04:11:17 UTC 2013


    Date: Monday, January 14, 2013 @ 23:11:16
  Author: dan
Revision: 175137

Initial add of pgbouncer package

Added:
  pgbouncer/
  pgbouncer/repos/
  pgbouncer/trunk/
  pgbouncer/trunk/PKGBUILD
  pgbouncer/trunk/pgbouncer.ini
  pgbouncer/trunk/pgbouncer.install
  pgbouncer/trunk/pgbouncer.service
  pgbouncer/trunk/pgbouncer.tmpfiles.conf

-------------------------+
 PKGBUILD                |   40 +++++++++++++++++++++++++++++++++++
 pgbouncer.ini           |   52 ++++++++++++++++++++++++++++++++++++++++++++++
 pgbouncer.install       |   20 +++++++++++++++++
 pgbouncer.service       |   11 +++++++++
 pgbouncer.tmpfiles.conf |    2 +
 5 files changed, 125 insertions(+)

Added: pgbouncer/trunk/PKGBUILD
===================================================================
--- pgbouncer/trunk/PKGBUILD	                        (rev 0)
+++ pgbouncer/trunk/PKGBUILD	2013-01-15 04:11:16 UTC (rev 175137)
@@ -0,0 +1,40 @@
+# Maintainer: Dan McGee <dan at archlinux.org>
+
+pkgname=pgbouncer
+_dlid=3393
+pkgver=1.5.4
+pkgrel=2
+pkgdesc="A lightweight connection pooler for PostgreSQL"
+arch=('i686' 'x86_64')
+url="http://pgfoundry.org/projects/pgbouncer"
+license=('BSD')
+depends=('libevent>=2.0')
+makedepends=('asciidoc' 'xmlto')
+backup=('etc/pgbouncer/pgbouncer.ini')
+install=$pkgname.install
+source=("http://pgfoundry.org/frs/download.php/${_dlid}/${pkgname}-${pkgver}.tar.gz"
+        pgbouncer.ini
+        pgbouncer.service
+        pgbouncer.tmpfiles.conf)
+md5sums=('9ffaf2e6232e18e676651429813732df'
+         '810813b9ef8891be382be9ffdd425edc'
+         '9036ba469f700d52fc49ed406da089a2'
+         'ca2ced4d7616bab13c3209823778816a')
+
+build() {
+  cd "$srcdir/$pkgname-$pkgver"
+  ./configure --prefix=/usr --disable-debug
+  make
+}
+
+package() {
+  cd "$srcdir/$pkgname-$pkgver"
+  make DESTDIR="$pkgdir/" install
+  install -D -m644 COPYRIGHT "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+  install -D -m644 ../pgbouncer.ini "$pkgdir/etc/pgbouncer/pgbouncer.ini"
+  install -D -m644 ../pgbouncer.service "$pkgdir/usr/lib/systemd/system/pgbouncer.service"
+  install -D -m644 ../pgbouncer.tmpfiles.conf "$pkgdir/usr/lib/tmpfiles.d/pgbouncer.conf"
+  mkdir -p "$pkgdir/var/log/pgbouncer"
+}
+
+# vim:set ts=2 sw=2 et:

Added: pgbouncer/trunk/pgbouncer.ini
===================================================================
--- pgbouncer/trunk/pgbouncer.ini	                        (rev 0)
+++ pgbouncer/trunk/pgbouncer.ini	2013-01-15 04:11:16 UTC (rev 175137)
@@ -0,0 +1,52 @@
+[pgbouncer]
+logfile = /var/log/pgbouncer/pgbouncer.log
+pidfile = /run/pgbouncer/pgbouncer.pid
+
+;; ip address or * which means all ip-s
+;listen_addr = 127.0.0.1
+;listen_port = 6432
+
+unix_socket_dir = /run/postgresql
+unix_socket_mode = 0777
+
+; any, trust, plain, crypt, md5
+auth_type = trust
+auth_file = /etc/pgbouncer/userlist.txt
+
+; comma-separated list of users, who are allowed to change settings
+admin_users = postgres
+
+; comma-separated list of users who are just allowed to use SHOW command
+stats_users = stats, postgres
+
+; total number of clients that can connect
+max_client_conn = 100
+
+; default pool size.  20 is good number when transaction pooling
+; is in use, in session pooling it needs to be the number of
+; max clients you want to handle at any moment
+default_pool_size = 20
+
+
+;; database name = connect string
+;;
+;; connect string params:
+;;   dbname= host= port= user= password=
+;;   client_encoding= datestyle= timezone=
+;;   pool_size= connect_query=
+[databases]
+
+; foodb over unix socket
+;foodb =
+
+; redirect bardb to bazdb on localhost
+;bardb = host=localhost dbname=bazdb
+
+; acceess to dest database will go with single user
+;forcedb = host=127.0.0.1 port=300 user=baz password=foo client_encoding=UNICODE datestyle=ISO connect_query='SELECT 1'
+
+; use custom pool sizes
+;nondefaultdb = pool_size=50 reserve_pool=10
+
+; fallback connect string
+;* = host=testserver

Added: pgbouncer/trunk/pgbouncer.install
===================================================================
--- pgbouncer/trunk/pgbouncer.install	                        (rev 0)
+++ pgbouncer/trunk/pgbouncer.install	2013-01-15 04:11:16 UTC (rev 175137)
@@ -0,0 +1,20 @@
+post_install() {
+  if ! getent group pgbouncer >/dev/null; then
+    groupadd -r pgbouncer
+  fi
+  if ! getent passwd pgbouncer >/dev/null; then
+    useradd -c 'PGBouncer user' -r -g pgbouncer -d '/etc/pgbouncer' -s /bin/bash pgbouncer
+    passwd -l pgbouncer >/dev/null
+  fi
+  chown pgbouncer:pgbouncer /var/log/pgbouncer
+  systemd-tmpfiles --create pgbouncer.conf
+}
+
+post_remove() {
+  if getent passwd pgbouncer >/dev/null; then
+    userdel pgbouncer
+  fi
+  if getent group pgbouncer >/dev/null; then
+    groupdel pgbouncer
+  fi
+}

Added: pgbouncer/trunk/pgbouncer.service
===================================================================
--- pgbouncer/trunk/pgbouncer.service	                        (rev 0)
+++ pgbouncer/trunk/pgbouncer.service	2013-01-15 04:11:16 UTC (rev 175137)
@@ -0,0 +1,11 @@
+[Unit]
+Description=A lightweight connection pooler for PostgreSQL
+After=network.target
+
+[Service]
+Group=pgbouncer
+ExecStart=/usr/bin/pgbouncer -u pgbouncer /etc/pgbouncer/pgbouncer.ini
+ExecReload=/usr/bin/pgbouncer -R
+
+[Install]
+WantedBy=multi-user.target

Added: pgbouncer/trunk/pgbouncer.tmpfiles.conf
===================================================================
--- pgbouncer/trunk/pgbouncer.tmpfiles.conf	                        (rev 0)
+++ pgbouncer/trunk/pgbouncer.tmpfiles.conf	2013-01-15 04:11:16 UTC (rev 175137)
@@ -0,0 +1,2 @@
+d /run/pgbouncer  0755 pgbouncer pgbouncer -
+d /run/postgresql 0755 88        88        -




More information about the arch-commits mailing list