1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
8 DESCRIPTION="Lightweight connection pooler for PostgreSQL"
9 HOMEPAGE="https://pgbouncer.github.io"
10 SRC_URI="https://pgbouncer.github.io/downloads/files/${PV}/${P}.tar.gz"
14 IUSE="+c-ares debug doc pam ssl -udns"
16 # At-most-one-of, one can be enabled but not both
17 REQUIRED_USE="?? ( c-ares udns )"
20 >=dev-libs/libevent-2.0
22 c-ares? ( >=net-dns/c-ares-1.10 )
23 ssl? ( >=dev-libs/openssl-1.0.1:=[-bindist] )
24 udns? ( >=net-libs/udns-0.1 )
31 enewuser postgres 70 /bin/bash /var/lib/postgresql postgres
33 enewuser pgbouncer -1 -1 -1 postgres
37 eapply "${FILESDIR}/pgbouncer-1.8-dirs.patch"
43 # --enable-debug is only used to disable stripping
45 --docdir=/usr/share/doc/${PF} \
47 $(use_with c-ares cares) \
48 $(use_enable debug cassert) \
50 $(use_with ssl openssl) \
60 emake DESTDIR="${D}" install
63 use doc && dodoc doc/*.rst
65 newconfd "${FILESDIR}/${PN}.confd-r1" "${PN}"
66 newinitd "${FILESDIR}/${PN}.initd-r2" "${PN}"
69 doins etc/pgbouncer.ini
71 insinto /etc/logrotate.d
72 newins "${FILESDIR}/logrotate" pgbouncer
76 if [[ -z ${REPLACING_VERSIONS} ]] ; then
77 einfo "Please read the config.txt for Configuration Directives"
79 einfo "For Administration Commands, see:"
80 einfo " man pgbouncer"
82 einfo "By default, PgBouncer does not have access to any database."
83 einfo "GRANT the permissions needed for your application and make sure that it"
84 einfo "exists in PgBouncer's auth_file."