1 # Copyright 1999-2020 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"
13 KEYWORDS="~amd64 ~x86"
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.11-dirs.patch"
43 # --enable-debug is only used to disable stripping
46 $(use_with c-ares cares) \
47 $(use_enable debug cassert) \
49 $(use_with ssl openssl) \
59 emake DESTDIR="${D}" install
62 use doc && dodoc doc/*.rst
64 newconfd "${FILESDIR}/${PN}.confd-r1" "${PN}"
65 newinitd "${FILESDIR}/${PN}.initd-r2" "${PN}"
68 doins etc/pgbouncer.ini
70 insinto /etc/logrotate.d
71 newins "${FILESDIR}/logrotate" pgbouncer
75 if [[ -z ${REPLACING_VERSIONS} ]] ; then
76 einfo "Please read the config.txt for Configuration Directives"
78 einfo "For Administration Commands, see:"
79 einfo " man pgbouncer"
81 einfo "By default, PgBouncer does not have access to any database."
82 einfo "GRANT the permissions needed for your application and make sure that it"
83 einfo "exists in PgBouncer's auth_file."