summary refs log tree commit diff
path: root/pkgs/tools/networking/dirb/default.nix
blob: 09f1fbc2f9f939dc641155ff94f7cd43e7028591 (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
34
35
36
37
38
39
40
{ fetchurl, lib, stdenv, autoreconfHook, curl }:

let
  major = "2";
  minor = "22";
in stdenv.mkDerivation rec {
  pname = "dirb";
  version = "${major}.${minor}";

  src = fetchurl {
    url = "mirror://sourceforge/dirb/${version}/dirb${major}${minor}.tar.gz";
    sha256 = "0b7wc2gvgnyp54rxf1n9arn6ymrvdb633v6b3ah138hw4gg8lx7k";
  };

  nativeBuildInputs = [ autoreconfHook ];
  buildInputs = [ curl ];

  unpackPhase = ''
    tar -xf $src
    find . -exec chmod +x "{}" ";"
    export sourceRoot="dirb222"
  '';

  postPatch = ''
    sed -i "s#/usr#$out#" src/dirb.c
  '';

  postInstall = ''
    mkdir -p $out/share/dirb/
    cp -r wordlists/ $out/share/dirb/
  '';

  meta = {
    description = "A web content scanner";
    homepage = "http://dirb.sourceforge.net/";
    maintainers = with lib.maintainers; [ bennofs ];
    license = with lib.licenses; [ gpl2 ];
    platforms = lib.platforms.unix;
  };
}