]> Pileus Git - ~andy/sunrise/commitdiff
New ebuild for bug 243232 - thanks to gentoo-sunrise for all help
authorJohan Bergström (jbergstroem) <bugs@bergstroem.nu>
Mon, 11 May 2009 17:51:29 +0000 (17:51 +0000)
committerJohan Bergström (jbergstroem) <bugs@bergstroem.nu>
Mon, 11 May 2009 17:51:29 +0000 (17:51 +0000)
svn path=/sunrise/; revision=8525

dev-db/pgbouncer/ChangeLog [new file with mode: 0644]
dev-db/pgbouncer/Manifest [new file with mode: 0644]
dev-db/pgbouncer/files/pgbouncer.initd [new file with mode: 0644]
dev-db/pgbouncer/metadata.xml [new file with mode: 0644]
dev-db/pgbouncer/pgbouncer-1.3.ebuild [new file with mode: 0644]

diff --git a/dev-db/pgbouncer/ChangeLog b/dev-db/pgbouncer/ChangeLog
new file mode 100644 (file)
index 0000000..f40a0ac
--- /dev/null
@@ -0,0 +1,8 @@
+# ChangeLog for dev-db/pgbouncer
+# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+  11 May 2009; Johan Bergström (jbergstroem) <bugs@bergstroem.nu>
+  +pgbouncer-1.3.ebuild, +files/pgbouncer.initd, +metadata.xml:
+  New ebuild for bug 243232 - thanks to gentoo-sunrise for all help
+
diff --git a/dev-db/pgbouncer/Manifest b/dev-db/pgbouncer/Manifest
new file mode 100644 (file)
index 0000000..fa8d193
--- /dev/null
@@ -0,0 +1,5 @@
+AUX pgbouncer.initd 1020 RMD160 cfae30b9d57c8ddb84b6a7547fc3595119321eee SHA1 4533c11693e9ef1da85be5abfd6551a89777f48a SHA256 738e49d42a28353075c93b77908f008522bfc15592ea095b5731388267797cf5
+DIST pgbouncer-1.3.tgz 160154 RMD160 581cf06c22567300fb38cfc1f212d44a8d770af5 SHA1 a86d5b5025affd38270c30fccdc1fde5ede3ff7f SHA256 87b489e173d7e66c440218e7b026943789da66c2b5bd6ef85f5a354a92a66cae
+EBUILD pgbouncer-1.3.ebuild 1390 RMD160 e887bc2a3b05d62f68d6a9c09e577b71d7115915 SHA1 09a3e44a0d55fd4c32648d2b081745f9f3d1159b SHA256 00f9341f065976462e5b5dfb79e9cc6319bea2061d865787f57e3b0e9f236aee
+MISC ChangeLog 317 RMD160 1510fb028de00c8dc2f1d249a8305b0afbd0095a SHA1 1482cb44cd246c09f06260bc3dfb070e70b81f03 SHA256 941b2f4a1361915872dba12012f4d8834546879622d541be5e31b0bc3876ae6e
+MISC metadata.xml 170 RMD160 645927a396fdc21cdeb089fe42c5397332420ea6 SHA1 ac7f48a14fec325926f9ce1be8fbf1f311b4f2e4 SHA256 d797a2ec6f9dc516c9f9c1a758ee87ad3e8c43101b5dc76c2f872d5bd4639b42
diff --git a/dev-db/pgbouncer/files/pgbouncer.initd b/dev-db/pgbouncer/files/pgbouncer.initd
new file mode 100644 (file)
index 0000000..c2cdabf
--- /dev/null
@@ -0,0 +1,45 @@
+#!/sbin/runscript
+# pgbouncer    Start the PgBouncer PostgreSQL pooler
+
+opts="start stop reload checkconfig"
+
+depend() {
+    need net
+    after postgresql
+}
+
+checkconfig(){
+       test -f /etc/pgbouncer.conf
+       result=$?
+       eend $result
+}
+
+start() {
+    checkconfig || return 1
+    ebegin "Starting pgbouncer as pgbouncer user"
+       
+#      if [ -f "/var/run/postgresql/pgbouncer.pid" ] ; then
+#              rm -f "/var/run/postgresql/pgbouncer.pid"
+#      fi
+    PIDFILE="/var/run/postgresql/pgbouncer.pid"
+    TIMEOUT=${TIMEOUT:-10}
+    PGBOUNCER_OPTS="-d -u pgbouncer /etc/pgbouncer.conf"
+    /usr/bin/pgbouncer ${PGBOUNCER_OPTS}
+       
+       let i=0
+       while [ ! -e "${PIDFILE}" ] && [ $i -lt ${TIMEOUT} ]; do
+       sleep 1 && i=$(expr $i + 1)
+       done
+       test $i -le ${TIMEOUT}          
+       eend $?
+}
+
+stop() {
+    ebegin "Stopping pgbouncer"
+    start-stop-daemon --stop --quiet --pidfile /var/run/postgresql/pgbouncer.pid
+    eend $?
+} 
+reload() {
+    ebegin "Reloading pgbouncer configuration"
+    start-stop-daemon --stop --pidfile /var/run/postgresql/pgbouncer.pid --signal HUP
+}
diff --git a/dev-db/pgbouncer/metadata.xml b/dev-db/pgbouncer/metadata.xml
new file mode 100644 (file)
index 0000000..7e32869
--- /dev/null
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>maintainer-wanted</herd>
+</pkgmetadata>
diff --git a/dev-db/pgbouncer/pgbouncer-1.3.ebuild b/dev-db/pgbouncer/pgbouncer-1.3.ebuild
new file mode 100644 (file)
index 0000000..fe6aff0
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+inherit autotools eutils
+
+DESCRIPTION="Lightweight connection pooler for PostgreSQL"
+HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
+SRC_URI="http://pgfoundry.org/frs/download.php/2092/${P}.tgz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug"
+
+DEPEND=">=virtual/postgresql-base-8.0
+       >=dev-libs/libevent-1.3"
+RDEPEND="${DEPENDS}"
+
+pkg_setup() {
+       enewgroup pgbouncer
+       enewuser pgbouncer -1 -1 -1 pgbouncer
+}
+
+src_unpack() {
+       unpack ${A}
+       cd "${S}"
+       eautoreconf -f
+}
+
+src_compile() {
+       econf \
+       $(use_enable debug) \
+       $(use_enable debug cassert)
+
+       emake || die "emake failed"
+}
+
+src_install() {
+       emake DESTDIR="${D}" install || die "Install failed"
+
+       insinto /etc
+       newins "${S}/etc/pgbouncer.ini" pgbouncer.conf || die "Install failed"
+       newinitd "${FILESDIR}/pgbouncer.initd" "${PN}" || die "Install failed"
+
+       dodoc README NEWS AUTHORS || die "Install failed"
+       dodoc doc/*.txt || die "Install failed"
+}
+
+pkg_postinst() {
+       einfo "Please read the config.txt for Configuration Directives"
+       einfo
+       einfo "See 'man pgbouncer' for Administration Commands"
+       einfo
+       einfo "By default, PgBouncer does not have access to any databases."
+       einfo "Create on with permissions needed for your application and"
+       einfo "make sure that it exists in pgbouncer's auth_file."
+}