summary refs log tree commit diff
path: root/pkgs/tools/security/knockknock/default.nix
blob: ce7663b18cf95ce9da848774322c0609b9149c14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ stdenv, fetchFromGitHub, python2Packages, hping }:

python2Packages.buildPythonApplication rec {
  rev  = "bf14bbff";
  name = "knockknock-r${rev}";

  src = fetchFromGitHub {
    inherit rev;
    owner  = "moxie0";
    repo   = "knockknock";
    sha256 = "1chpfs3w2vkjrgay69pbdr116z1jldv53fi768a1i05fdqhy1px4";
  };

  propagatedBuildInputs = [ python2Packages.pycrypto ];

  # No tests
  doCheck = false;

  patchPhase = ''
    sed -i '/build\//d' setup.py
    substituteInPlace setup.py --replace "/etc" "$out/etc"
    substituteInPlace knockknock.py --replace 'existsInPath("hping3")' '"${hping}/bin/hping3"'
  '';

  meta = with stdenv.lib; {
    description = "Simple, secure port knocking daemon and client written in Python";
    homepage    = "http://www.thoughtcrime.org/software/knockknock/";
    license     = licenses.gpl3;
    maintainers = with maintainers; [ copumpkin ];
    platforms   = platforms.linux;
  };
}