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

60 lines
1.4 KiB
Nix
Raw Normal View History

2024-06-30 08:12:46 +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 {
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
hash = "sha256-yosEmjwtOyIloejRXWE3mOvHSOOVA4jtomlN5Qe6YCA=";
};
2024-06-30 08:12:46 +00:00
nativeBuildInputs = lib.optional (
stdenv.hostPlatform != stdenv.buildPlatform
) buildPackages.cracklib;
buildInputs = [
zlib
gettext
];
2024-05-02 00:46:19 +00:00
2024-06-30 08:12:46 +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-06-30 08:12:46 +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-06-30 08:12:46 +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";
license = licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists
maintainers = with maintainers; [ lovek323 ];
2024-06-30 08:12:46 +00:00
platforms = platforms.unix;
2024-05-02 00:46:19 +00:00
};
}