From 96f07d6b61f8c741af216d96b9dd4ed1cc9f5ab0 Mon Sep 17 00:00:00 2001 From: Daniel Fullmer Date: Sun, 31 Dec 2017 18:15:56 -0500 Subject: john: Fix extra utility programs --- pkgs/tools/security/john/default.nix | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'pkgs/tools/security/john') diff --git a/pkgs/tools/security/john/default.nix b/pkgs/tools/security/john/default.nix index 37946b940cf1..7552b21ed333 100644 --- a/pkgs/tools/security/john/default.nix +++ b/pkgs/tools/security/john/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2 -, writeText, gcc +, writeText, gcc, pythonPackages, perl, perlPackages, makeWrapper }: with stdenv.lib; @@ -35,7 +35,11 @@ stdenv.mkDerivation rec { ''; configureFlags = [ "--disable-native-macro" ]; - buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc ]; + buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 gcc pythonPackages.wrapPython perl makeWrapper ]; + propagatedBuildInputs = (with pythonPackages; [ dpkt scapy lxml ]) ++ # For pcap2john.py + (with perlPackages; [ DigestMD4 DigestMD5 DigestSHA1 GetoptLong MIMEBase64 # For pass_gen.pl + NetLDAP ]); # For sha-dump.pl + # TODO: Get dependencies for radius2john.pl and lion2john-alt.pl # gcc -DAC_BUILT -Wall vncpcap2john.o memdbg.o -g -lpcap -fopenmp -o ../run/vncpcap2john # gcc: error: memdbg.o: No such file or directory @@ -43,18 +47,23 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = [ "-DJOHN_SYSTEMWIDE=1" ]; - installPhase = '' - mkdir -p "$out/etc/john" "$out/share/john" "$out/share/doc/john" - find ../run -mindepth 1 -maxdepth 1 -type f -executable \ - -exec "${stdenv.shell}" "${writeText "john-binary-install.sh" '' - filename="$(basename "$1")" - install -vD "$1" "$out/bin/''${filename%.*}" - ''}" {} \; + postInstall = '' + mkdir -p "$out/bin" "$out/etc/john" "$out/share/john" "$out/share/doc/john" + find -L ../run -mindepth 1 -maxdepth 1 -type f -executable \ + -exec cp -d {} "$out/bin" \; cp -vt "$out/etc/john" ../run/*.conf cp -vt "$out/share/john" ../run/*.chr ../run/password.lst cp -vrt "$out/share/doc/john" ../doc/* ''; + postFixup = '' + wrapPythonPrograms + + for i in $out/bin/*.pl; do + wrapProgram "$i" --prefix PERL5LIB : $PERL5LIB + done + ''; + meta = { description = "John the Ripper password cracker"; license = licenses.gpl2; -- cgit 1.4.1