core/pkgs/by-name/cr/cracklib/default.nix

48 lines
1.3 KiB
Nix
Raw Normal View History

2024-05-13 21:24:10 +00:00
let version = "2.9.11";
in { stdenv, lib, buildPackages, fetchurl, zlib, gettext, lists ? [
(fetchurl {
url =
"https://github.com/cracklib/cracklib/releases/download/v${version}/cracklib-words-${version}.gz";
hash = "sha256-popxGjE1c517Z+nzYLM/DU7M+b1/rE0XwNXkVqkcUXo=";
})
] }:
2024-05-02 00:46:19 +00:00
stdenv.mkDerivation rec {
pname = "cracklib";
inherit version;
src = fetchurl {
2024-05-13 21:24:10 +00:00
url =
"https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
2024-05-02 00:46:19 +00:00
hash = "sha256-yosEmjwtOyIloejRXWE3mOvHSOOVA4jtomlN5Qe6YCA=";
};
2024-05-13 21:24:10 +00:00
nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
buildPackages.cracklib;
2024-05-02 00:46:19 +00:00
buildInputs = [ zlib gettext ];
2024-05-13 21:24:10 +00:00
postPatch =
lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
chmod +x util/cracklib-format
patchShebangs util
2024-05-02 00:46:19 +00:00
2024-05-13 21:24:10 +00:00
'' + ''
ln -vs ${toString lists} dicts/
'';
2024-05-02 00:46:19 +00:00
postInstall = ''
make dict-local
'';
doInstallCheck = true;
installCheckTarget = "test";
meta = with lib; {
2024-05-13 21:24:10 +00:00
homepage = "https://github.com/cracklib/cracklib";
2024-05-02 00:46:19 +00:00
description = "A library for checking the strength of passwords";
2024-05-13 21:24:10 +00:00
license =
licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists
2024-05-02 00:46:19 +00:00
maintainers = with maintainers; [ lovek323 ];
2024-05-13 21:24:10 +00:00
platforms = platforms.unix;
2024-05-02 00:46:19 +00:00
};
}