1let version = "2.9.7"; in
2{ stdenv, lib, buildPackages, fetchurl, zlib, gettext
3, wordlists ? [ (fetchurl {
4 url = "https://github.com/cracklib/cracklib/releases/download/v${version}/cracklib-words-${version}.gz";
5 sha256 = "12fk8w06q628v754l357cf8kfjna98wj09qybpqr892az3x4a33z";
6}) ]
7}:
8
9stdenv.mkDerivation rec {
10 pname = "cracklib";
11 inherit version;
12
13 src = fetchurl {
14 url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
15 sha256 = "1rimpjsdnmw8f5b7k558cic41p2qy2n2yrlqp5vh7mp4162hk0py";
16 };
17
18 nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib;
19 buildInputs = [ zlib gettext ];
20
21 postPatch = ''
22 chmod +x util/cracklib-format
23 patchShebangs util
24
25 ln -vs ${toString wordlists} dicts/
26 '';
27
28 postInstall = ''
29 make dict-local
30 '';
31 doInstallCheck = true;
32 installCheckTarget = "test";
33
34 meta = with lib; {
35 homepage = https://github.com/cracklib/cracklib;
36 description = "A library for checking the strength of passwords";
37 license = licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists
38 maintainers = with maintainers; [ lovek323 ];
39 platforms = platforms.unix;
40 };
41}