1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 EGIT_REPO_URI="https://git.postgresql.org/git/pgpool2.git"
8 POSTGRES_COMPAT=( 9.{4..6} {10..11} )
10 inherit autotools git-r3 postgres-multi
12 DESCRIPTION="Connection pool server for PostgreSQL"
13 HOMEPAGE="https://www.pgpool.net/"
20 IUSE="doc libressl memcached pam ssl static-libs"
25 memcached? ( dev-libs/libmemcached )
26 pam? ( sys-auth/pambase )
28 !libressl? ( dev-libs/openssl:0= )
29 libressl? ( dev-libs/libressl:= )
44 postgres_new_user pgpool
46 postgres-multi_pkg_setup
51 "${FILESDIR}/pgpool-configure-memcached.patch" \
52 "${FILESDIR}/pgpool-configure-pam.patch" \
53 "${FILESDIR}/pgpool-configure-pthread.patch" \
54 "${FILESDIR}/pgpool_run_paths-3.7.10.patch"
58 postgres-multi_src_prepare
62 postgres-multi_foreach econf \
64 --sysconfdir="${EROOT%/}/etc/${PN}" \
65 --with-pgsql-includedir='/usr/include/postgresql-@PG_SLOT@' \
66 --with-pgsql-libdir="/usr/$(get_libdir)/postgresql-@PG_SLOT@/$(get_libdir)" \
67 $(use_enable static-libs static) \
68 $(use_with memcached) \
70 $(use_with ssl openssl)
74 # Even though we're only going to do an install for the best slot
75 # available, the extension bits in src/sql need some things outside
76 # of that directory built, too.
77 postgres-multi_foreach emake
78 postgres-multi_foreach emake -C src/sql
79 use doc && postgres-multi_forbest emake DESTDIR="${D}" -C doc
83 # We only need the best stuff installed
84 postgres-multi_forbest emake DESTDIR="${D}" install
86 # Except for the extension and .so files that each PostgreSQL slot needs
87 postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
89 newinitd "${FILESDIR}/${PN}.initd" ${PN}
90 newconfd "${FILESDIR}/${PN}.confd" ${PN}
94 use doc && postgres-multi_forbest emake DESTDIR="${D}" -C doc install
97 # mv some files that get installed to /usr/share/pgpool-II so that
98 # they all wind up in the same place
99 mv "${ED%/}/usr/share/${PN/2/-II}" "${ED%/}/usr/share/${PN}" || die
100 into "/usr/share/${PN}"
101 dobin src/sample/{pgpool_recovery,pgpool_recovery_pitr,pgpool_remote_start}
102 insinto "/usr/share/${PN}"
103 doins src/sample/{{pcp,pgpool,pool_hba}.conf.sample*,pgpool.pam}
105 # One more thing: Evil la files!
106 find "${ED}" -name '*.la' -exec rm -f {} +