btrbk: add mainProgram (#356350)
[NixPkgs.git] / pkgs / by-name / pw / pwnat / package.nix
blobd95608d5b648c4a17d39bbe2240a68d01239e29c
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 }:
6 stdenv.mkDerivation rec {
7   pname = "pwnat";
8   # Latest release has an annoying segmentation fault bug, see:
9   # https://github.com/samyk/pwnat/pull/25 . Merging only #25 is impossible due
10   # to major code refactoring.
11   version = "2023-03-31";
13   src = fetchFromGitHub {
14     owner  = "samyk";
15     repo   = pname;
16     rev    = "8ec62cdae53a2d573c9f9c906133ca45bbd3360a";
17     sha256 = "sha256-QodNw3ab8/TurKamg6AgMfQ08aalp4j6q663B+sWmRM=";
18   };
20   # See https://github.com/samyk/pwnat/issues/28
21   preBuild = ''
22     mkdir obj
23   '';
25   installPhase = ''
26     runHook preInstall
28     install -D pwnat $out/bin/pwnat
30     runHook postInstall
31   '';
33   meta = with lib; {
34     homepage    = "http://samy.pl/pwnat/";
35     description = "ICMP NAT to NAT client-server communication";
36     license     = lib.licenses.gpl3Plus;
37     maintainers = [ ];
38     platforms   = with platforms; linux;
39     mainProgram = "pwnat";
40   };