summary refs log tree commit diff
path: root/pkgs/by-name/ap/apache-users/package.nix
blob: 8780a13a3f8a36400f731e584c7fd029267d6b5b (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
41
42
43
{ lib
, stdenv
, fetchurl
, perl
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "apache-users";
  version = "2.1";

  src = fetchurl {
    url = "https://labs.portcullis.co.uk/download/apache_users-${finalAttrs.version}.tar.gz";
    hash = "sha256-rylW4F8Si6KKYxaxEJlVFnbLqfqS6ytMPfHpc8MgriA=";
  };

  # Allow optional arguments where defaults are provided
  patches = [ ./optional-args.patch ];

  postPatch = ''
    substituteAllInPlace apache${finalAttrs.version}.pl
  '';

  buildInputs = [
    (perl.withPackages (p: [ p.ParallelForkManager p.LWP ]))
  ];

  installPhase = ''
    runHook preInstall

    install -D apache${finalAttrs.version}.pl $out/bin/apache-users
    install -Dm444 names $out/share/apache-users/names

    runHook postInstall
  '';

  meta = with lib; {
    description = "Username Enumeration through Apache UserDir";
    homepage = "https://labs.portcullis.co.uk/downloads/";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ emilytrau ];
    mainProgram = "apache-users";
  };
})