Merge pull request #33257 from danielfullmer/john-utils

john: Fix extra utility programs
This commit is contained in:
Joachim F 2018-01-04 18:35:25 +00:00 committed by GitHub
commit 24e8c382af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;