croc: 10.1.1 -> 10.1.3 (#364662)
[NixPkgs.git] / pkgs / by-name / sa / samdump2 / package.nix
blob0489423d9fefdf38d803818679ec5f663e4ed4b4
2   lib,
3   stdenv,
4   fetchurl,
5   fetchpatch,
6   openssl,
7   pkg-config,
8   which,
9 }:
11 stdenv.mkDerivation (finalAttrs: {
12   pname = "samdump2";
13   version = "3.0.0";
15   src = fetchurl {
16     url = "mirror://sourceforge/project/ophcrack/samdump2/${finalAttrs.version}/samdump2-${finalAttrs.version}.tar.bz2";
17     hash = "sha256-YCZZrzDFZXUPoBZQ4KIj0mNVtd+Y8vvDDjpsWT7U5SY=";
18   };
20   nativeBuildInputs = [
21     pkg-config
22     which
23   ];
24   buildInputs = [
25     openssl
26   ];
28   patches = [
29     (fetchpatch {
30       # fixes a FTBFS linker bug
31       url = "https://salsa.debian.org/pkg-security-team/samdump2/-/raw/b4c9f14f5a1925106e7c62c9967d430c1104df0c/debian/patches/10_ftbfs_link.patch";
32       hash = "sha256-TGzxi44dDAispG+rK/kYYMzKjt10p+ZyfVDWKG+Gw/s=";
33     })
34     (fetchpatch {
35       # the makefile overrides flags so you can't set them via d/rules or the environment
36       url = "https://salsa.debian.org/pkg-security-team/samdump2/-/raw/b4c9f14f5a1925106e7c62c9967d430c1104df0c/debian/patches/20_compiler_flags.patch";
37       hash = "sha256-VdDiNAQhlauAB4Ws/pvWMJY2rMKr3qhyVGX2GoxaagI=";
38     })
39     (fetchpatch {
40       # the makefile has a infos dep, but no target
41       url = "https://salsa.debian.org/pkg-security-team/samdump2/-/raw/b4c9f14f5a1925106e7c62c9967d430c1104df0c/debian/patches/30_install_infos.patch";
42       hash = "sha256-Y7kdU+ywUYFm2VySGFa0QE1OvzoTa0eFSWp0VFmY5iM=";
43     })
44     (fetchpatch {
45       # change the formatting in the manpage to make it more readable
46       url = "https://salsa.debian.org/pkg-security-team/samdump2/-/raw/b4c9f14f5a1925106e7c62c9967d430c1104df0c/debian/patches/40_manpage_formatting.patch";
47       hash = "sha256-L4BjtiGk91nTKZdr0SXbaxkD2mzmkU3UJlc4TZfXS4Y=";
48     })
49     (fetchpatch {
50       # fix a FTBFS with OpenSSL 1.1.0. (Closes: #828537)
51       url = "https://salsa.debian.org/pkg-security-team/samdump2/-/raw/b4c9f14f5a1925106e7c62c9967d430c1104df0c/debian/patches/50_openssl.patch";
52       hash = "sha256-pdLOSt7kX9uPg4wDVstxh3NC/DboQCP+5/wCjuJmruY=";
53     })
54   ];
56   postPatch = ''
57     substituteInPlace Makefile \
58       --replace " -o root -g root" ""
59   '';
61   makeFlags = [
62     "PREFIX=$(out)"
63     "CC=cc"
64   ];
66   meta = with lib; {
67     description = "Dump password hashes from a Windows NT/2k/XP installation";
68     mainProgram = "samdump2";
69     homepage = "https://sourceforge.net/projects/ophcrack/files/samdump2";
70     license = licenses.gpl2Plus;
71     maintainers = with maintainers; [ d3vil0p3r ];
72     platforms = platforms.unix;
73   };