Merge the GLEP 67 transition changes
[gentoo.git] / dev-db / repmgr / repmgr-3.0.1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils multilib
7 DESCRIPTION="PostgreSQL Replication Manager"
8 HOMEPAGE="http://www.repmgr.org/"
9 SRC_URI="http://www.repmgr.org/download/${P}.tar.gz"
10 LICENSE="GPL-3"
11 SLOT="0"
12 KEYWORDS="~amd64 ~x86"
13
14 IUSE=""
15
16 DEPEND=">=dev-db/postgresql-9.3[server,static-libs]"
17 RDEPEND="${DEPEND}
18         net-misc/rsync"
19
20 src_compile() {
21         emake USE_PGXS=1
22 }
23
24 src_install() {
25         emake DESTDIR="${D}" USE_PGXS=1 install
26         export PGSLOT="$(postgresql-config show)"
27         einfo "PGSLOT: ${PGSLOT}"
28         PGBASEDIR=/usr/$(get_libdir)/postgresql-${PGSLOT}
29         PGBINDIR=${PGBASEDIR}/bin/
30         PGCONTRIB=/usr/share/postgresql-${PGSLOT}/contrib/
31         dodir $PGCONTRIB $PGBINDIR
32         insinto $PGCONTRIB
33         doins sql/repmgr2_repmgr3.sql
34         dosym $PGBINDIR/repmgr /usr/bin/repmgr${PGSLOT//.}
35         dosym $PGBINDIR/repmgrd /usr/bin/repmgrd${PGSLOT//.}
36         dodoc  CREDITS HISTORY COPYRIGHT TODO *.md *.rst
37         insinto /etc
38         newins repmgr.conf.sample repmgr.conf
39         fowners postgres:postgres /etc/repmgr.conf
40         ewarn "Remember to modify /etc/repmgr.conf"
41 }