diff options
author | mjl <mjl@pkgsrc.org> | 2011-09-03 22:15:51 +0000 |
---|---|---|
committer | mjl <mjl@pkgsrc.org> | 2011-09-03 22:15:51 +0000 |
commit | 3d4ca33a1233025c20db5f745e8725a51d609daa (patch) | |
tree | 7687b77db289cb6c925f75f3d999aeb168ee2a5a /databases | |
parent | 5392d8221482d78298444969540bfbdc54a9f3b7 (diff) | |
download | pkgsrc-3d4ca33a1233025c20db5f745e8725a51d609daa.tar.gz |
Initial import of pgbouncer-1.4.2
pgbouncer is a lightweight connection pooler for PostgreSQL that provides
the following features:
* Several levels of brutality when rotating connections.
* Low memory requirements.
* It is not tied to one backend server, the destination databases
can reside on different hosts.
* Supports online reconfiguration for most of the settings.
* Supports online restart/upgrade.
Diffstat (limited to 'databases')
-rw-r--r-- | databases/pgbouncer/DESCR | 9 | ||||
-rw-r--r-- | databases/pgbouncer/Makefile | 49 | ||||
-rw-r--r-- | databases/pgbouncer/PLIST | 7 | ||||
-rw-r--r-- | databases/pgbouncer/distinfo | 5 | ||||
-rw-r--r-- | databases/pgbouncer/files/pgbouncer.sh | 43 |
5 files changed, 113 insertions, 0 deletions
diff --git a/databases/pgbouncer/DESCR b/databases/pgbouncer/DESCR new file mode 100644 index 00000000000..40d2383f066 --- /dev/null +++ b/databases/pgbouncer/DESCR @@ -0,0 +1,9 @@ +Lightweight connection pooler for PostgreSQL that provides +the following features: + + * Several levels of brutality when rotating connections. + * Low memory requirements. + * It is not tied to one backend server, the destination databases + can reside on different hosts. + * Supports online reconfiguration for most of the settings. + * Supports online restart/upgrade. diff --git a/databases/pgbouncer/Makefile b/databases/pgbouncer/Makefile new file mode 100644 index 00000000000..a2cf741f28b --- /dev/null +++ b/databases/pgbouncer/Makefile @@ -0,0 +1,49 @@ +# $NetBSD: Makefile,v 1.1.1.1 2011/09/03 22:15:51 mjl Exp $ +# + +DISTNAME= pgbouncer-${VERSION} +CATEGORIES= databases +MASTER_SITES= http://pgfoundry.org/frs/download.php/3085/ +EXTRACT_SUFX= .tgz + +MAINTAINER= pkgsrc@NetBSD.org +HOMEPAGE= http://wiki.postgresql.org/wiki/PgBouncer +COMMENT= Lightweight connection pooler for PostgreSQL +LICENSE= original-bsd + +PKG_DESTDIR_SUPPORT= user-destdir + +VERSION= 1.4.2 +USE_LANGUAGES= c +USE_TOOLS= gmake +GNU_CONFIGURE= yes + +CONFIGURE_ARGS+= --with-libevent=${BUILDLINK_PREFIX.libevent} + +EGDIR= ${PREFIX}/share/examples/${PKGBASE} +CONF_FILES= ${EGDIR}/pgbouncer.ini ${PKG_SYSCONFDIR}/pgbouncer.ini \ + ${EGDIR}/pgbouncer.userlist ${PKG_SYSCONFDIR}/pgbouncer.userlist + +RCD_SCRIPTS+= pgbouncer + +INSTALLATION_DIRS= bin ${PKGMANDIR}/man1 ${PKGMANDIR}/man5 ${EGDIR} + +PGUSER?= pgsql +PGGROUP?= pgsql +PKG_GROUPS= ${PGGROUP} +PKG_USERS= ${PGUSER}:${PGGROUP} + +BUILD_DEFS+= PGUSER PGGROUP +FILES_SUBST+= PGUSER=${PGUSER} + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/pgbouncer ${DESTDIR}${PREFIX}/bin/ + ${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ + ${INSTALL_MAN} ${WRKSRC}/doc/pgbouncer.5 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man5/ + ${INSTALL_DATA} ${WRKSRC}/etc/pgbouncer.ini ${DESTDIR}${EGDIR} + ${INSTALL_DATA} ${WRKSRC}/etc/userlist.txt ${DESTDIR}${EGDIR}/pgbouncer.userlist + +BUILDLINK_API_DEPENDS.libevent+= libevent>=2.0 +.include "../../devel/libevent/buildlink3.mk" + +.include "../../mk/bsd.pkg.mk" diff --git a/databases/pgbouncer/PLIST b/databases/pgbouncer/PLIST new file mode 100644 index 00000000000..53bedd07a8b --- /dev/null +++ b/databases/pgbouncer/PLIST @@ -0,0 +1,7 @@ +@comment $NetBSD: PLIST,v 1.1.1.1 2011/09/03 22:15:51 mjl Exp $ +bin/pgbouncer +man/man1/pgbouncer.1 +man/man5/pgbouncer.5 +share/examples/pgbouncer/pgbouncer.ini +share/examples/pgbouncer/pgbouncer.userlist +share/examples/rc.d/pgbouncer diff --git a/databases/pgbouncer/distinfo b/databases/pgbouncer/distinfo new file mode 100644 index 00000000000..8faac2f9ff9 --- /dev/null +++ b/databases/pgbouncer/distinfo @@ -0,0 +1,5 @@ +$NetBSD: distinfo,v 1.1.1.1 2011/09/03 22:15:51 mjl Exp $ + +SHA1 (pgbouncer-1.4.2.tgz) = 610198c3f2186d70267275f554e23bd43598e4b5 +RMD160 (pgbouncer-1.4.2.tgz) = 055796e23dd7029d3f4a2c882cf24399a5481cb1 +Size (pgbouncer-1.4.2.tgz) = 283204 bytes diff --git a/databases/pgbouncer/files/pgbouncer.sh b/databases/pgbouncer/files/pgbouncer.sh new file mode 100644 index 00000000000..e97387267c8 --- /dev/null +++ b/databases/pgbouncer/files/pgbouncer.sh @@ -0,0 +1,43 @@ +#! @RCD_SCRIPTS_SHELL@ +# +# $NetBSD: pgbouncer.sh,v 1.1.1.1 2011/09/03 22:15:51 mjl Exp $ +# +# PROVIDE: pgbouncer +# REQUIRE: DAEMON +# + +if [ -r /etc/rc.subr ] +then + . /etc/rc.subr +fi + +name="pgbouncer" +rcvar=${name} +command="@PREFIX@/bin/${name}" +pgbouncer_conf="@PKG_SYSCONFDIR@/${name}.ini" +required_files="${pgbouncer_conf}" +command_args="-d ${pgbouncer_conf}" +extra_commands="reload" +pgsql_user="@PGUSER@" +start_cmd="pgbouncer_start" + +pidfile="@VARBASE@/run/${name}/${name}.pid" +if [ -r ${pgbouncer_conf} ] ; then + pidfile=`grep -i pidfile /usr/pkg/etc/pgbouncer.ini | cut -d= -f2` +fi + +pgbouncer_start() +{ + @ECHO@ "Starting ${name}." + piddir=`dirname ${pidfile}` + if [ ! -d ${piddir} ] ; then + @MKDIR@ -p ${piddir} + @CHOWN@ ${pgsql_user} ${piddir} + fi + + doit="@SU@ -m ${pgsql_user} -c '${command} ${command_args}'" + eval $doit +} + +load_rc_config $name +run_rc_command "$1" |