Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl 2, bison, flex 3, pam 4}: 5 6stdenv.mkDerivation rec { 7 pname = "gradm"; 8 version = "3.1-202102241600"; 9 10 src = fetchurl { 11 url = "https://grsecurity.net/stable/${pname}-${version}.tar.gz"; 12 sha256 = "02ni34hpggv00140p9gvh0lqi173zdddd2qhfi96hyr1axd5pl50"; 13 }; 14 15 nativeBuildInputs = [ bison flex ]; 16 buildInputs = [ pam ]; 17 18 enableParallelBuilding = true; 19 20 makeFlags = [ 21 "DESTDIR=$(out)" 22 "LEX=${flex}/bin/flex" 23 "MANDIR=/share/man" 24 "MKNOD=true" 25 ]; 26 27 preBuild = '' 28 substituteInPlace Makefile \ 29 --replace "/usr/bin/" "" \ 30 --replace "/usr/include/security/pam_" "${pam}/include/security/pam_" 31 32 substituteInPlace gradm_defs.h \ 33 --replace "/sbin/grlearn" "$out/bin/grlearn" \ 34 --replace "/sbin/gradm" "$out/bin/gradm" \ 35 --replace "/sbin/gradm_pam" "$out/bin/gradm_pam" 36 37 echo 'inherit-learn /nix/store' >>learn_config 38 39 mkdir -p "$out/etc/udev/rules.d" 40 ''; 41 42 postInstall = "rmdir $out/dev"; 43 44 meta = with lib; { 45 description = "grsecurity RBAC administration and policy analysis utility"; 46 homepage = "https://grsecurity.net"; 47 license = licenses.gpl2Only; 48 platforms = platforms.linux; 49 maintainers = with maintainers; [ thoughtpolice joachifm ]; 50 }; 51}