2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchurl
|
2016-07-22 17:57:26 +02:00
|
|
|
, bison, flex
|
|
|
|
, pam
|
|
|
|
}:
|
2014-02-17 15:23:31 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gradm";
|
2021-03-26 21:08:20 +01:00
|
|
|
version = "3.1-202102241600";
|
2014-02-17 15:23:31 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-03-26 21:08:20 +01:00
|
|
|
url = "https://grsecurity.net/stable/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "02ni34hpggv00140p9gvh0lqi173zdddd2qhfi96hyr1axd5pl50";
|
2014-02-17 15:23:31 +01:00
|
|
|
};
|
|
|
|
|
2016-07-22 17:57:26 +02:00
|
|
|
nativeBuildInputs = [ bison flex ];
|
|
|
|
buildInputs = [ pam ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"LEX=${flex}/bin/flex"
|
|
|
|
"MANDIR=/share/man"
|
|
|
|
"MKNOD=true"
|
|
|
|
];
|
|
|
|
|
2014-02-17 15:23:31 +01:00
|
|
|
preBuild = ''
|
2016-07-22 17:57:26 +02:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr/bin/" "" \
|
|
|
|
--replace "/usr/include/security/pam_" "${pam}/include/security/pam_"
|
2014-02-17 15:23:31 +01:00
|
|
|
|
2016-07-22 17:57:26 +02:00
|
|
|
substituteInPlace gradm_defs.h \
|
|
|
|
--replace "/sbin/grlearn" "$out/bin/grlearn" \
|
|
|
|
--replace "/sbin/gradm" "$out/bin/gradm" \
|
|
|
|
--replace "/sbin/gradm_pam" "$out/bin/gradm_pam"
|
2014-03-18 00:29:28 +01:00
|
|
|
|
2016-07-22 17:57:26 +02:00
|
|
|
echo 'inherit-learn /nix/store' >>learn_config
|
2016-07-23 17:00:22 +02:00
|
|
|
|
|
|
|
mkdir -p "$out/etc/udev/rules.d"
|
2014-02-17 15:23:31 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-24 10:19:10 +01:00
|
|
|
postInstall = "rmdir $out/dev";
|
2014-02-17 15:23:31 +01:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2014-02-17 15:23:31 +01:00
|
|
|
description = "grsecurity RBAC administration and policy analysis utility";
|
|
|
|
homepage = "https://grsecurity.net";
|
2021-03-26 21:08:20 +01:00
|
|
|
license = licenses.gpl2Only;
|
2014-02-22 20:11:33 +01:00
|
|
|
platforms = platforms.linux;
|
2016-07-22 17:57:26 +02:00
|
|
|
maintainers = with maintainers; [ thoughtpolice joachifm ];
|
2014-02-17 15:23:31 +01:00
|
|
|
};
|
|
|
|
}
|