2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, postgresql
|
|
|
|
, openssl
|
|
|
|
, zlib
|
|
|
|
, readline
|
|
|
|
, flex
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "repmgr";
|
2021-03-12 07:09:13 +00:00
|
|
|
version = "5.2.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "2ndQuadrant";
|
|
|
|
repo = "repmgr";
|
|
|
|
rev = "v${version}";
|
2021-03-12 07:09:13 +00:00
|
|
|
sha256 = "sha256-hIhVjSSJAgH/eXiuz0xlTFgp9q+Y41ICeCrRFGss3mk=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ flex ];
|
|
|
|
|
|
|
|
buildInputs = [ postgresql openssl zlib readline ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,lib,share/postgresql/extension}
|
|
|
|
|
|
|
|
cp repmgr{,d} $out/bin
|
|
|
|
cp *.so $out/lib
|
|
|
|
cp *.sql $out/share/postgresql/extension
|
|
|
|
cp *.control $out/share/postgresql/extension
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://repmgr.org/";
|
|
|
|
description = "Replication manager for PostgreSQL cluster";
|
|
|
|
license = licenses.postgresql;
|
|
|
|
platforms = postgresql.meta.platforms;
|
|
|
|
maintainers = with maintainers; [ zimbatm ];
|
|
|
|
};
|
|
|
|
}
|