2016-07-22 16:57:26 +01:00
|
|
|
{ stdenv, fetchurl
|
|
|
|
, bison, flex
|
|
|
|
, pam
|
|
|
|
}:
|
2014-02-17 14:23:31 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gradm-${version}";
|
2016-08-17 10:51:20 +01:00
|
|
|
version = "3.1-201608131257";
|
2014-02-17 14:23:31 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-02-22 18:23:27 +00:00
|
|
|
url = "http://grsecurity.net/stable/${name}.tar.gz";
|
2016-08-17 10:51:20 +01:00
|
|
|
sha256 = "0y5565rhil5ciprwz7nx4s4ah7dsxx7zrkg42dbq0mcg8m316xrb";
|
2014-02-17 14:23:31 +00:00
|
|
|
};
|
|
|
|
|
2016-07-22 16:57:26 +01:00
|
|
|
nativeBuildInputs = [ bison flex ];
|
|
|
|
buildInputs = [ pam ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"LEX=${flex}/bin/flex"
|
|
|
|
"MANDIR=/share/man"
|
|
|
|
"MKNOD=true"
|
|
|
|
];
|
|
|
|
|
2014-02-17 14:23:31 +00:00
|
|
|
preBuild = ''
|
2016-07-22 16:57:26 +01:00
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace "/usr/bin/" "" \
|
|
|
|
--replace "/usr/include/security/pam_" "${pam}/include/security/pam_"
|
2014-02-17 14:23:31 +00:00
|
|
|
|
2016-07-22 16:57:26 +01: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-17 23:29:28 +00:00
|
|
|
|
2016-07-22 16:57:26 +01:00
|
|
|
echo 'inherit-learn /nix/store' >>learn_config
|
2016-07-23 16:00:22 +01:00
|
|
|
|
|
|
|
mkdir -p "$out/etc/udev/rules.d"
|
2014-02-17 14:23:31 +00:00
|
|
|
'';
|
|
|
|
|
2016-07-22 16:57:26 +01:00
|
|
|
postInstall = ''rmdir $out/dev'';
|
2014-02-17 14:23:31 +00:00
|
|
|
|
2014-02-22 19:11:33 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-02-17 14:23:31 +00:00
|
|
|
description = "grsecurity RBAC administration and policy analysis utility";
|
|
|
|
homepage = "https://grsecurity.net";
|
2014-02-22 19:11:33 +00:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2016-07-22 16:57:26 +01:00
|
|
|
maintainers = with maintainers; [ thoughtpolice joachifm ];
|
2014-02-17 14:23:31 +00:00
|
|
|
};
|
|
|
|
}
|