From 2a1bf2a7769eee1453fbe24d8e37ff1a42cd6bff Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 12 Oct 2015 20:29:52 +0200 Subject: [PATCH] john: Clean up and Update to v1.8.0-jumbo-1. Cleanups are mostly stylistic, like putting src more to the top (to make sure it won't be missed on updates of the version attribute) or using mkdir -p instead of ensureDir. The most significant change here is that we update the package to 1.8.0-jumbo-1, which is the latest tag available and contains community updates which were already in magnumripper/JohnTheRipper@93f061bc41652. We're now also using fetchurl to ensure that we don't need to clone the whole repository and keep download times low. And the derivation name is now "john" instead of "JohnTheRipper", because most users would expect "nix-env -i john" to work. Signed-off-by: aszlig --- pkgs/tools/security/john/default.nix | 39 ++++++++++++++++------------ 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/pkgs/tools/security/john/default.nix b/pkgs/tools/security/john/default.nix index 4ef9b8f65b6..cde2047a5f1 100644 --- a/pkgs/tools/security/john/default.nix +++ b/pkgs/tools/security/john/default.nix @@ -1,29 +1,34 @@ -{ stdenv, fetchgit, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2 }: +{ stdenv, fetchurl, openssl, nss, nspr, kerberos, gmp, zlib, libpcap, re2 }: with stdenv.lib; stdenv.mkDerivation rec { - name = "JohnTheRipper-${version}"; - version = "8a3e3c1d"; - buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 ]; - NIX_CFLAGS_COMPILE = "-DJOHN_SYSTEMWIDE=1"; - preConfigure = ''cd src''; - installPhase = '' - ensureDir $out/share/john/ - ensureDir $out/bin - cp -R ../run/* $out/share/john - ln -s $out/share/john/john $out/bin/john - ''; - src = fetchgit { - url = https://github.com/magnumripper/JohnTheRipper.git; - rev = "93f061bc41652c94ae049b52572aac709d18aa4c"; - sha256 = "1rnfi09830n34jcqaxmsam54p4zsq9a49ic2ljh44lahcipympvy"; + name = "john-${version}"; + version = "1.8.0-jumbo-1"; + + src = fetchurl { + url = "http://www.openwall.com/john/j/${name}.tar.xz"; + sha256 = "08q92sfdvkz47rx6qjn7qv57cmlpy7i7rgddapq5384mb413vjds"; }; + + buildInputs = [ openssl nss nspr kerberos gmp zlib libpcap re2 ]; + + NIX_CFLAGS_COMPILE = "-DJOHN_SYSTEMWIDE=1"; + + preConfigure = "cd src"; + + installPhase = '' + mkdir -p "$out/share/john" + mkdir -p "$out/bin" + cp -R ../run/* "$out/share/john" + ln -s "$out/share/john/john" "$out/bin/john" + ''; + meta = { description = "John the Ripper password cracker"; license = licenses.gpl2; homepage = https://github.com/magnumripper/JohnTheRipper/; - maintainers = with maintainers; [offline]; + maintainers = with maintainers; [ offline ]; platforms = with platforms; unix; }; }