ogre: 14.3.3 -> 14.3.4 (#380101)
[NixPkgs.git] / pkgs / by-name / ni / nikto / package.nix
blobf82cf130f2b10fea9e150a4bf8420c9c003ce541
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   perlPackages,
6   makeWrapper,
7   installShellFiles,
8 }:
10 let
11   version = "2.5.0";
13 stdenv.mkDerivation rec {
14   pname = "nikto";
15   inherit version;
17   src = fetchFromGitHub {
18     owner = "sullo";
19     repo = "nikto";
20     rev = version;
21     sha256 = "sha256-lWiDbWc2BWAUgyaIm0tvZytja02WogYRoc7na4sHiNM=";
22   };
24   # Nikto searches its configuration file based on its current path
25   # This fixes the current path regex for the wrapped executable.
26   patches = [ ./nix-wrapper-fix.patch ];
28   postPatch = ''
29     # EXECDIR needs to be changed to the path where we copy the programs stuff
30     # Forcing SSLeay is needed for SSL support (the auto mode doesn't seem to work otherwise)
31     substituteInPlace program/nikto.conf.default \
32       --replace "# EXECDIR=/opt/nikto" "EXECDIR=$out/share" \
33       --replace "LW_SSL_ENGINE=auto" "LW_SSL_ENGINE=SSLeay"
34   '';
36   nativeBuildInputs = [
37     makeWrapper
38     installShellFiles
39   ];
41   buildInputs = [
42     perlPackages.perl
43     perlPackages.NetSSLeay
44   ];
46   installPhase = ''
47     runHook preInstall
48     install -d "$out/share"
49     cp -a program/* "$out/share"
50     install -Dm 755 "program/nikto.pl" "$out/bin/nikto"
51     install -Dm 644 program/nikto.conf.default "$out/etc/nikto.conf"
52     installManPage documentation/nikto.1
53     install -Dm 644 README.md "$out/share/doc/${pname}/README"
54     runHook postInstall
55   '';
57   postInstall = ''
58     wrapProgram $out/bin/nikto \
59       --prefix PERL5LIB : $PERL5LIB
60   '';
62   meta = with lib; {
63     description = "Web server scanner";
64     mainProgram = "nikto";
65     license = licenses.gpl2Plus;
66     homepage = "https://cirt.net/Nikto2";
67     changelog = "https://github.com/sullo/nikto/releases/tag/${version}";
68     maintainers = with maintainers; [ shamilton ];
69     platforms = platforms.unix;
70   };