dev-qt/qtopengl: stable 5.14.2 for ppc, bug #719732
[gentoo.git] / dev-db / pgpool2 / pgpool2-9999.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 EGIT_REPO_URI="https://git.postgresql.org/git/pgpool2.git"
7
8 POSTGRES_COMPAT=( 9.{4..6} {10..11} )
9
10 inherit autotools git-r3 postgres-multi
11
12 DESCRIPTION="Connection pool server for PostgreSQL"
13 HOMEPAGE="https://www.pgpool.net/"
14 SRC_URI=""
15 LICENSE="BSD"
16 SLOT="0"
17
18 KEYWORDS=""
19
20 IUSE="doc libressl memcached pam ssl static-libs"
21
22 RDEPEND="
23         ${POSTGRES_DEP}
24         net-libs/libnsl:0=
25         memcached? ( dev-libs/libmemcached )
26         pam? ( sys-auth/pambase )
27         ssl? (
28                 !libressl? ( dev-libs/openssl:0= )
29                 libressl? ( dev-libs/libressl:= )
30         )
31 "
32 DEPEND="${RDEPEND}
33         !!dev-db/pgpool
34         sys-devel/bison
35         virtual/pkgconfig
36         doc? (
37                  app-text/openjade
38                  dev-libs/libxml2
39                  dev-libs/libxslt
40          )
41 "
42
43 pkg_setup() {
44         postgres_new_user pgpool
45
46         postgres-multi_pkg_setup
47 }
48
49 src_prepare() {
50         eapply \
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"
55
56         eautoreconf
57
58         postgres-multi_src_prepare
59 }
60
61 src_configure() {
62         postgres-multi_foreach econf \
63                 --disable-rpath \
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) \
69                 $(use_with pam) \
70                 $(use_with ssl openssl)
71 }
72
73 src_compile() {
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
80 }
81
82 src_install() {
83         # We only need the best stuff installed
84         postgres-multi_forbest emake DESTDIR="${D}" install
85
86         # Except for the extension and .so files that each PostgreSQL slot needs
87         postgres-multi_foreach emake DESTDIR="${D}" -C src/sql install
88
89         newinitd "${FILESDIR}/${PN}.initd" ${PN}
90         newconfd "${FILESDIR}/${PN}.confd" ${PN}
91
92         # Documentation!
93         dodoc NEWS TODO
94         use doc && postgres-multi_forbest emake DESTDIR="${D}" -C doc install
95
96         # Examples and extras
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}
104
105         # One more thing: Evil la files!
106         find "${ED}" -name '*.la' -exec rm -f {} +
107 }