summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron W. Swenson <titanofold@gentoo.org>2013-07-19 00:47:56 +0000
committerAaron W. Swenson <titanofold@gentoo.org>2013-07-19 00:47:56 +0000
commitce1f6b1ff46da134961ae2a3fcaeba2cadb3766d (patch)
tree29ecb26a8661ae0a54414bc67a974dfa0faf7695 /dev-db/pgbouncer
parentlibffi installation was fixed in 4.8. (diff)
downloadgentoo-2-ce1f6b1ff46da134961ae2a3fcaeba2cadb3766d.tar.gz
gentoo-2-ce1f6b1ff46da134961ae2a3fcaeba2cadb3766d.tar.bz2
gentoo-2-ce1f6b1ff46da134961ae2a3fcaeba2cadb3766d.zip
Clean out old and insecure versions. Version bump. Fixes bugs 425480, 460310, 477062, and 425034.
(Portage version: 2.1.12.2/cvs/Linux x86_64, signed Manifest commit with key D1BBFDA0)
Diffstat (limited to 'dev-db/pgbouncer')
-rw-r--r--dev-db/pgbouncer/ChangeLog12
-rw-r--r--dev-db/pgbouncer/files/logrotate7
-rw-r--r--dev-db/pgbouncer/files/pgbouncer-dirs.patch26
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.confd12
-rw-r--r--dev-db/pgbouncer/files/pgbouncer.initd90
-rw-r--r--dev-db/pgbouncer/metadata.xml26
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.4.2.ebuild71
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.1.ebuild71
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.2.ebuild71
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild70
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.3.ebuild70
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.4.ebuild84
-rw-r--r--dev-db/pgbouncer/pgbouncer-1.5.ebuild71
13 files changed, 217 insertions, 464 deletions
diff --git a/dev-db/pgbouncer/ChangeLog b/dev-db/pgbouncer/ChangeLog
index 03446e1eeec2..d7a434325578 100644
--- a/dev-db/pgbouncer/ChangeLog
+++ b/dev-db/pgbouncer/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for dev-db/pgbouncer
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/ChangeLog,v 1.9 2013/03/17 15:19:52 hwoarang Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/ChangeLog,v 1.10 2013/07/19 00:47:55 titanofold Exp $
+
+*pgbouncer-1.5.4 (19 Jul 2013)
+
+ 19 Jul 2013; Aaron W. Swenson <titanofold@gentoo.org>
+ -pgbouncer-1.4.2.ebuild, -pgbouncer-1.5.ebuild, -pgbouncer-1.5.1.ebuild,
+ -pgbouncer-1.5.2.ebuild, -pgbouncer-1.5.3.ebuild, -pgbouncer-1.5.3-r1.ebuild,
+ +pgbouncer-1.5.4.ebuild, +files/logrotate, +files/pgbouncer.confd,
+ +files/pgbouncer-dirs.patch, files/pgbouncer.initd, metadata.xml:
+ Clean out old and insecure versions. Version bump. Fixes bugs 425480, 460310,
+ 477062, and 425034.
17 Mar 2013; Markos Chandras <hwoarang@gentoo.org> metadata.xml:
Add proxy-maintainers to metadata.xml
diff --git a/dev-db/pgbouncer/files/logrotate b/dev-db/pgbouncer/files/logrotate
new file mode 100644
index 000000000000..9617eafa66b0
--- /dev/null
+++ b/dev-db/pgbouncer/files/logrotate
@@ -0,0 +1,7 @@
+/var/log/pgbouncer/pgbouncer.log {
+ missingok
+ sharedscripts
+ postrotate
+ /etc/init.d/pgbouncer -q reload
+ endscript
+} \ No newline at end of file
diff --git a/dev-db/pgbouncer/files/pgbouncer-dirs.patch b/dev-db/pgbouncer/files/pgbouncer-dirs.patch
new file mode 100644
index 000000000000..62bcd0b84409
--- /dev/null
+++ b/dev-db/pgbouncer/files/pgbouncer-dirs.patch
@@ -0,0 +1,26 @@
+diff -Naruw a/etc/pgbouncer.ini b/etc/pgbouncer.ini
+--- a/etc/pgbouncer.ini 2012-06-10 19:57:01.000000000 +0000
++++ b/etc/pgbouncer.ini 2013-07-17 02:25:59.598888628 +0000
+@@ -29,7 +29,7 @@
+ ;;;
+
+ logfile = /var/log/pgbouncer/pgbouncer.log
+-pidfile = /var/run/pgbouncer/pgbouncer.pid
++pidfile = /run/pgbouncer/pgbouncer.pid
+
+ ;;;
+ ;;; Where to wait for clients
+@@ -40,10 +40,9 @@
+ listen_port = 6432
+
+ ; unix socket is also used for -R.
+-; On debian it should be /var/run/postgresql
+-;unix_socket_dir = /tmp
+-;unix_socket_mode = 0777
+-;unix_socket_group =
++unix_socket_dir = /run/postgresql
++unix_socket_mode = 0777
++unix_socket_group = postgres
+
+ ;;;
+ ;;; Authentication settings
diff --git a/dev-db/pgbouncer/files/pgbouncer.confd b/dev-db/pgbouncer/files/pgbouncer.confd
new file mode 100644
index 000000000000..e2c584011884
--- /dev/null
+++ b/dev-db/pgbouncer/files/pgbouncer.confd
@@ -0,0 +1,12 @@
+# Location of configuration file for PgBouncer.
+INIFILE="/etc/pgbouncer.ini"
+
+# How long to wait in seconds for a safe shutdown. Equivalent to
+# issuing 'PAUSE;' and 'SHUTDOWN;' on psql console. (See 'man 1 pgbouncer'.)
+NICE_TIMEOUT=60
+
+# Set to 'YES' to perform an immediate shutdown if the nice shutdown
+# doesn't work. Same as issuing 'SHUTDOWN;' on console. (See 'man 1
+# pgbouncer'.)
+FORCE_QUIT="no"
+FORCE_QUIT_TIMEOUT=2 \ No newline at end of file
diff --git a/dev-db/pgbouncer/files/pgbouncer.initd b/dev-db/pgbouncer/files/pgbouncer.initd
index 83e43cc10808..594129c674f4 100644
--- a/dev-db/pgbouncer/files/pgbouncer.initd
+++ b/dev-db/pgbouncer/files/pgbouncer.initd
@@ -1,43 +1,77 @@
#!/sbin/runscript
-extra_started_commands="reload upgrade"
-
-if [ -d /run ] ; then
- RUNDIR=/run/pgbouncer
-else
- RUNDIR=/var/run/pgbouncer
-fi
+extra_started_commands="reload"
depend() {
- need net
- after postgresql
+ use net
+ after postgresql
}
-start() {
- checkpath -d -m 755 -o pgbouncer:pgbouncer ${RUNDIR}
+get_config() {
+ [ -f "${INIFILE}" ] || eend 1 "'${INIFILE}' not found"
+
+ eval echo $(sed -e 's:;.*::' "${INIFILE}" | \
+ awk '$1 == "'$1'" { print ($2 == "=" ? $3 : $2) }')
+}
+
+PIDFILE="$(get_config pidfile)"
+UNIX_SOCKET_DIR="$(get_config unix_socket_dir)"
- ebegin "Starting pgbouncer"
- start-stop-daemon --start --pidfile ${RUNDIR}/pgbouncer.pid \
- --exec /usr/bin/pgbouncer -- -q -d -u pgbouncer /etc/pgbouncer.conf
- eend $? "Failed to start pgbouncer"
+prep() {
+ if [ -n "${UNIX_SOCKET_DIR}" ] ; then
+ checkpath -o postgres:postgres -m 0775 -d "${UNIX_SOCKET_DIR}" \
+ || return 1
+ fi
+ checkpath -o pgbouncer:postgres -m 0644 -f "${PIDFILE}" \
+ || return 1
+ checkpath -o pgbouncer:postgres -m 0640 -f "$(get_config logfile)" \
+ || return 1
+}
+
+start() {
+ ebegin "Starting PgBouncer"
+ prep || eend 1
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --user pgbouncer \
+ --exec /usr/bin/pgbouncer -- -q -d "${INIFILE}"
+ eend $?
}
stop() {
- ebegin "Stopping pgbouncer"
- start-stop-daemon --stop --quiet --pidfile ${RUNDIR}/pgbouncer.pid
- eend $?
+ local seconds=$(( ${NICE_TIMEOUT} + ${FORCE_TIMEOUT} ))
+ ebegin "Stopping PgBouncer (this can take up to ${seconds} seconds)"
+
+ local retries=SIGINT/${NICE_TIMEOUT}
+
+ if [ "${FORCE_QUIT}" = "YES" ] ; then
+ einfo "FORCE_QUIT enabled."
+ retries="${retries}/SIGTERM/${FORCE_TIMEOUT}"
+ fi
+
+ # Loops through nice and force quit in one go.
+ start-stop-daemon --stop \
+ --pidfile ${PIDFILE} \
+ --retry ${retries}
+
+ eend $?
}
-reload() {
- ebegin "Gracefully reloading pgbouncer"
- kill -HUP $(head -n1 ${RUNDIR}/pgbouncer.pid)
- eend $?
+restart() {
+ if [ -n "${UNIX_SOCKET_DIR}" ] ; then
+ ebegin "Performing online restart of PgBouncer"
+ start-stop-daemon --start \
+ --pidfile ${PIDFILE} \
+ --user pgbouncer \
+ --exec /usr/bin/pgbouncer -- -q -d -R "${INIFILE}"
+ eend $?
+ else
+ stop && start
+ fi
}
-upgrade() {
- egrep -q "^unix_socket_dir" /etc/pgbouncer.conf || \
- eerror "Not running with unix sockets, cannot upgrade"
- ebegin "Gracefully upgrading pgbouncer"
- /usr/bin/pgbouncer -R -q -d -u pgbouncer /etc/pgbouncer.conf
+reload() {
+ ebegin "Reloading PgBouncer configuration from '${INIFILE}'"
+ start-stop-daemon --signal HUP --pidfile ${PIDFILE}
eend $?
-} \ No newline at end of file
+}
diff --git a/dev-db/pgbouncer/metadata.xml b/dev-db/pgbouncer/metadata.xml
index 7eb3f9208074..f9bdcdbde21a 100644
--- a/dev-db/pgbouncer/metadata.xml
+++ b/dev-db/pgbouncer/metadata.xml
@@ -1,15 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
- <herd>postgresql</herd>
- <herd>proxy-maintainers</herd>
- <maintainer>
- <email>bugs@bergstroem.nu</email>
- <name>Johan Bergström</name>
- <description>Proxy-Maintainer, assign bugs</description>
- </maintainer>
- <maintainer>
- <email>titanofold@gentoo.org</email>
- <name>Aaron W. Swenson</name>
- </maintainer>
+ <herd>postgresql</herd>
+ <herd>proxy-maintainers</herd>
+ <maintainer>
+ <email>bugs@bergstroem.nu</email>
+ <name>Johan Bergström</name>
+ <description>Proxy-Maintainer, assign bugs</description>
+ </maintainer>
+ <maintainer>
+ <email>titanofold@gentoo.org</email>
+ <name>Aaron W. Swenson</name>
+ </maintainer>
+ <use>
+ <flag name="libevent">Use libevent 2.0+ and evdns as the DNS backend</flag>
+ <flag name="udns">Use udns as the DNS backend. Supports IPv4 only.</flag>
+ </use>
</pkgmetadata>
diff --git a/dev-db/pgbouncer/pgbouncer-1.4.2.ebuild b/dev-db/pgbouncer/pgbouncer-1.4.2.ebuild
deleted file mode 100644
index d1befc890788..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.4.2.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.4.2.ebuild,v 1.2 2012/06/04 06:45:39 zmedico Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="mirror://postgresql/projects/pgFoundry/${PN}/${P}.tgz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-
-}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.1.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.1.ebuild
deleted file mode 100644
index bd20dff2b40b..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.5.1.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.1.ebuild,v 1.2 2012/06/04 06:45:39 zmedico Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="mirror://postgresql/projects/pgFoundry/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-
-}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.2.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.2.ebuild
deleted file mode 100644
index bebd4334de42..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.5.2.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.2.ebuild,v 1.1 2012/06/18 07:53:26 patrick Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="mirror://postgresql/projects/pgFoundry/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-
-}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild
deleted file mode 100644
index a4fb2c5afbb5..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2013 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.3-r1.ebuild,v 1.1 2013/01/14 17:29:29 pinkbyte Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="http://pgfoundry.org/frs/download.php/3369/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.3.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.3.ebuild
deleted file mode 100644
index 09c1a14a0099..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.5.3.ebuild
+++ /dev/null
@@ -1,70 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.3.ebuild,v 1.1 2012/11/13 02:54:25 titanofold Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="http://pgfoundry.org/frs/download.php/3369/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.4.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.4.ebuild
new file mode 100644
index 000000000000..8f70bdbc414a
--- /dev/null
+++ b/dev-db/pgbouncer/pgbouncer-1.5.4.ebuild
@@ -0,0 +1,84 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.4.ebuild,v 1.1 2013/07/19 00:47:55 titanofold Exp $
+
+EAPI="5"
+
+# Upstream has *way* broken tests.
+RESTRICT="test"
+
+inherit eutils user
+
+DESCRIPTION="Lightweight connection pooler for PostgreSQL"
+HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
+SRC_URI="mirror://postgresql/projects/pgFoundry/${PN}/${PN}/${PV}/${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug doc libevent udns"
+REQUIRED_USE="
+ libevent? ( !udns )
+ udns? ( !libevent )
+"
+DEPEND="
+ >=sys-libs/glibc-2.10
+ doc? (
+ app-text/docbook-xml-dtd:4.5
+ app-text/xmlto
+ >=app-text/asciidoc-8.4
+ )
+ libevent? ( >=dev-libs/libevent-2.0 )
+ udns? ( >=net-libs/udns-0.1 )
+"
+
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+ enewgroup postgres 70
+ enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
+
+ enewuser pgbouncer -1 -1 -1 postgres
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/pgbouncer-dirs.patch"
+}
+
+src_configure() {
+ # --enable-debug is only used to disable stripping
+ econf \
+ --docdir=/usr/share/doc/${PF} \
+ --enable-debug \
+ $(use_enable debug cassert) \
+ $(use_with libevent) \
+ $(use_with udns)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install
+
+ dodoc AUTHORS
+
+ newconfd "${FILESDIR}/${PN}.confd" "${PN}"
+ newinitd "${FILESDIR}/${PN}.initd" "${PN}"
+
+ insinto /etc
+ doins etc/pgbouncer.ini
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}/logrotate" pgbouncer
+}
+
+pkg_postinst() {
+ if [[ -z ${REPLACING_VERSIONS} ]] ; then
+ einfo "Please read the config.txt for Configuration Directives"
+ einfo
+ einfo "For Administration Commands, see:"
+ einfo " man pgbouncer"
+ einfo
+ einfo "By default, PgBouncer does not have access to any database."
+ einfo "GRANT the permissions needed for your application and make sure that it"
+ einfo "exists in PgBouncer's auth_file."
+ fi
+}
diff --git a/dev-db/pgbouncer/pgbouncer-1.5.ebuild b/dev-db/pgbouncer/pgbouncer-1.5.ebuild
deleted file mode 100644
index 35c37754f6f8..000000000000
--- a/dev-db/pgbouncer/pgbouncer-1.5.ebuild
+++ /dev/null
@@ -1,71 +0,0 @@
-# Copyright 1999-2012 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-db/pgbouncer/pgbouncer-1.5.ebuild,v 1.2 2012/06/04 06:45:39 zmedico Exp $
-
-EAPI="4"
-
-inherit eutils user
-
-RESTRICT="test"
-
-DESCRIPTION="Lightweight connection pooler for PostgreSQL"
-HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
-SRC_URI="mirror://postgresql/projects/pgFoundry/${PN}/${P}.tar.gz"
-
-LICENSE="BSD"
-SLOT="0"
-KEYWORDS="~amd64 ~x86"
-IUSE="debug"
-
-DEPEND="dev-libs/libevent"
-RDEPEND="${DEPEND}"
-
-pkg_setup() {
- enewgroup pgbouncer
- enewuser pgbouncer -1 -1 -1 pgbouncer
-}
-
-src_prepare() {
- local rundir=""
- [[ ! -d /run ]] && rundir="/var"
-
- sed -i -e "s,${PN}.log,/var/log/${PN}/${PN}.log," \
- -e "s,${PN}.pid,/var/run/${PN}/${PN}.pid," \
- -e "s,etc/userlist.txt,/etc/userlist.txt," \
- -e "s,;unix_socket_dir = /tmp,unix_socket_dir = ${rundir}/run/${PN}.sock," \
- "${S}"/etc/pgbouncer.ini || die
-}
-
-src_configure() {
- # --enable-debug is only used to disable stripping
- econf \
- --enable-debug \
- $(use_enable debug cassert) \
- --docdir=/usr/share/doc/${PF}
-}
-
-src_install() {
- emake DESTDIR="${D}" install
-
- insinto /etc
- newins etc/pgbouncer.ini pgbouncer.conf
- newinitd "${FILESDIR}"/pgbouncer.initd "${PN}"
-
- dodoc README NEWS AUTHORS
- dodoc doc/*.txt
-
- dodir /var/log/pgbouncer/
- fowners pgbouncer:pgbouncer /var/log/pgbouncer/
-}
-
-pkg_postinst() {
- einfo "Please read the config.txt for Configuration Directives"
- einfo
- einfo "For Administration Commands, see:"
- einfo " man pgbouncer"
- einfo
- einfo "By default, PgBouncer does not have access to any database."
- einfo "GRANT the permissions needed for your application and make sure that it"
- einfo "exists in PgBouncer's auth_file."
-
-}