summary refs log blame commit diff
path: root/pkgs/servers/sql/postgresql/ext/repmgr.nix
blob: 65107191938d9ffcdb5485f668a9cf945308faa8 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
                              





            


                         
                    




                          
                                                                   

    



                                                     
                   
                                                      
 



                                                 

     
                    


                                                               
                                          


                                                
{ lib, stdenv, fetchFromGitHub
, postgresql
, openssl
, zlib
, readline
, flex
}:

stdenv.mkDerivation rec {
  pname = "repmgr";
  version = "5.2.1";

  src = fetchFromGitHub {
    owner = "2ndQuadrant";
    repo = "repmgr";
    rev = "v${version}";
    sha256 = "sha256-hIhVjSSJAgH/eXiuz0xlTFgp9q+Y41ICeCrRFGss3mk=";
  };

  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
  '';

  meta = with lib; {
    homepage = "https://repmgr.org/";
    description = "Replication manager for PostgreSQL cluster";
    license = licenses.postgresql;
    platforms = postgresql.meta.platforms;
    maintainers = with maintainers; [ zimbatm ];
  };
}