]> Pileus Git - ~andy/sunrise/blob - dev-db/pgbouncer/pgbouncer-1.3.1.ebuild
34919d3364cbaf2131414c971c8407fb3dfc58c6
[~andy/sunrise] / dev-db / pgbouncer / pgbouncer-1.3.1.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit autotools eutils
6
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"
10
11 LICENSE="BSD"
12 SLOT="0"
13 KEYWORDS="~amd64 ~x86"
14 IUSE="debug"
15
16 DEPEND=">=virtual/postgresql-base-8.0
17         >=dev-libs/libevent-1.3"
18 RDEPEND="${DEPEND}"
19
20 pkg_setup() {
21         enewgroup pgbouncer
22         enewuser pgbouncer -1 -1 -1 pgbouncer
23 }
24
25 src_unpack() {
26         unpack ${A}
27         cd "${S}"
28         eautoreconf -f
29 }
30
31 src_compile() {
32         epatch "${FILESDIR}/modify-config-paths.patch"
33
34         econf \
35                 $(use_enable debug) \
36                 $(use_enable debug cassert)
37
38         emake || die "emake failed"
39 }
40
41 src_install() {
42         emake DESTDIR="${D}" install || die "Install failed"
43
44         insinto /etc
45         newins "${S}"/etc/pgbouncer.ini pgbouncer.conf || die "Install failed"
46         newinitd "${FILESDIR}"/pgbouncer.initd "${PN}" || die "Install failed"
47
48         dodoc README NEWS AUTHORS || die "Install failed"
49         dodoc doc/*.txt || die "Install failed"
50
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/
55 }
56
57 pkg_postinst() {
58         einfo "Please read the config.txt for Configuration Directives"
59         einfo
60         einfo "See 'man pgbouncer' for Administration Commands"
61         einfo
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."
65 }