1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 inherit autotools eutils
7 DESCRIPTION="Lightweight connection pooler for PostgreSQL"
8 HOMEPAGE="http://pgfoundry.org/projects/pgbouncer/"
9 SRC_URI="http://pgfoundry.org/frs/download.php/2284/${P}.tgz"
13 KEYWORDS="~amd64 ~x86"
16 DEPEND=">=virtual/postgresql-base-8.0
17 >=dev-libs/libevent-1.3"
22 enewuser pgbouncer -1 -1 -1 pgbouncer
32 epatch "${FILESDIR}/modify-config-paths.patch"
36 $(use_enable debug cassert)
38 emake || die "emake failed"
42 emake DESTDIR="${D}" install || die "Install failed"
45 newins "${S}"/etc/pgbouncer.ini pgbouncer.conf || die "Install failed"
46 newinitd "${FILESDIR}"/pgbouncer.initd "${PN}" || die "Install failed"
48 dodoc README NEWS AUTHORS || die "Install failed"
49 dodoc doc/*.txt || die "Install failed"
51 # Create log/run directories and set owner to pgbouncer
52 keepdir /var/{run,log}/pgbouncer/
53 fperms 0700 /var/{run,log}/pgbouncer/
54 fowners pgbouncer:pgbouncer /var/{run,log}/pgbouncer/
58 einfo "Please read the config.txt for Configuration Directives"
60 einfo "See 'man pgbouncer' for Administration Commands"
62 einfo "By default, PgBouncer does not have access to any databases."
63 einfo "Create on with permissions needed for your application and"
64 einfo "make sure that it exists in pgbouncer's auth_file."