dev-db/repmgr: Fix build with gcc-10

Closes: https://bugs.gentoo.org/733304
Package-Manager: Portage-3.0.12, Repoman-3.0.2
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
Jakov Smolic 2021-01-03 22:39:23 +01:00 committed by David Seifert
parent 25e440cde2
commit ac2eef59aa
No known key found for this signature in database
GPG Key ID: CE36E117202E3842
2 changed files with 70 additions and 13 deletions

View File

@ -0,0 +1,51 @@
--- a/repmgr-action-cluster.c
+++ b/repmgr-action-cluster.c
@@ -26,6 +26,7 @@
#define SHOW_HEADER_COUNT 9
+extern t_conninfo_param_list source_conninfo;
typedef enum
{
SHOW_ID = 0,
--- a/repmgr-action-node.c
+++ b/repmgr-action-node.c
@@ -32,6 +32,7 @@
#include "repmgr-action-node.h"
#include "repmgr-action-standby.h"
+extern t_conninfo_param_list source_conninfo;
static bool copy_file(const char *src_file, const char *dest_file);
static void format_archive_dir(PQExpBufferData *archive_dir);
static t_server_action parse_server_action(const char *action);
--- a/repmgr-action-service.c
+++ b/repmgr-action-service.c
@@ -26,6 +26,7 @@
#include "repmgr-client-global.h"
#include "repmgr-action-service.h"
+extern t_conninfo_param_list source_conninfo;
/*
* Possibly also show:
--- a/repmgr-action-witness.c
+++ b/repmgr-action-witness.c
@@ -28,6 +28,7 @@
#include "repmgr-client-global.h"
#include "repmgr-action-witness.h"
+extern t_conninfo_param_list source_conninfo;
static char repmgr_user[MAXLEN];
static char repmgr_db[MAXLEN];
--- a/repmgr-client-global.h
+++ b/repmgr-client-global.h
@@ -236,7 +236,7 @@ typedef struct ColHeader
extern t_runtime_options runtime_options;
extern t_configuration_options config_file_options;
-t_conninfo_param_list source_conninfo;
+extern t_conninfo_param_list source_conninfo;
extern bool config_file_required;

View File

@ -1,38 +1,44 @@
# Copyright 1999-2020 Gentoo Authors
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit eutils multilib
DESCRIPTION="PostgreSQL Replication Manager"
HOMEPAGE="http://www.repmgr.org/"
SRC_URI="http://www.repmgr.org/download/${P}.tar.gz"
LICENSE="GPL-3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE=""
DEPEND=">=dev-db/postgresql-9.3[server,static-libs]"
DEPEND="dev-db/postgresql:*[server,static-libs]"
RDEPEND="${DEPEND}
net-misc/rsync"
PATCHES=( "${FILESDIR}"/${P}-fno-common.patch )
src_compile() {
emake USE_PGXS=1
}
src_install() {
emake DESTDIR="${D}" USE_PGXS=1 install
export PGSLOT="$(postgresql-config show)"
dodoc CREDITS HISTORY COPYRIGHT *.md
local PGSLOT="$(postgresql-config show)"
einfo "PGSLOT: ${PGSLOT}"
PGBASEDIR=/usr/$(get_libdir)/postgresql-${PGSLOT}
PGBINDIR=${PGBASEDIR}/bin/
PGCONTRIB=/usr/share/postgresql-${PGSLOT}/contrib/
dodir $PGCONTRIB $PGBINDIR
dosym $PGBINDIR/repmgr /usr/bin/repmgr${PGSLOT//.}
dosym $PGBINDIR/repmgrd /usr/bin/repmgrd${PGSLOT//.}
dodoc CREDITS HISTORY COPYRIGHT *.md
dodir /usr/share/postgresql-${PGSLOT}/contrib
dodir /usr/$(get_libdir)/postgresql-${PGSLOT}
local repmgr="/usr/bin/repmgr${PGSLOT//.}"
local repmgrd="/usr/bin/repmgrd${PGSLOT//.}"
dosym ../$(get_libdir)/postgresql-${PGSLOT}/bin/repmgr ${repmgr}
dosym ../$(get_libdir)/postgresql-${PGSLOT}/bin/repmgrd ${repmgrd}
insinto /etc
newins repmgr.conf.sample repmgr.conf
fowners postgres:postgres /etc/repmgr.conf
ewarn "Remember to modify /etc/repmgr.conf"
}