2014-02-17 15:23:31 +01:00
|
|
|
{ fetchurl, stdenv, bison, flex, pam,
|
|
|
|
gcc, coreutils, findutils, binutils, bash }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gradm-${version}";
|
2015-07-22 10:04:00 +02:00
|
|
|
version = "3.1-201507191652";
|
2014-02-17 15:23:31 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2014-02-22 19:23:27 +01:00
|
|
|
url = "http://grsecurity.net/stable/${name}.tar.gz";
|
2015-07-22 10:04:00 +02:00
|
|
|
sha256 = "0l3s56wvk5kpd2qppl328x4alh327xnbf271lh1fan84pxbw651g";
|
2014-02-17 15:23:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gcc coreutils findutils binutils pam flex bison bash ];
|
|
|
|
preBuild = ''
|
|
|
|
substituteInPlace ./Makefile --replace "/usr/include/security/pam_" "${pam}/include/security/pam_"
|
|
|
|
substituteInPlace ./gradm_defs.h --replace "/sbin/grlearn" "$out/sbin/grlearn"
|
|
|
|
substituteInPlace ./gradm_defs.h --replace "/sbin/gradm" "$out/sbin/gradm"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/udev/rules.d
|
|
|
|
cat > $out/lib/udev/rules.d/80-grsec.rules <<EOF
|
|
|
|
ACTION!="add|change", GOTO="permissions_end"
|
|
|
|
KERNEL=="grsec", MODE="0622"
|
|
|
|
LABEL="permissions_end"
|
|
|
|
EOF
|
2014-03-18 00:29:28 +01:00
|
|
|
|
|
|
|
echo "inherit-learn /nix/store" >> $out/etc/grsec/learn_config
|
2014-02-17 15:23:31 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags =
|
|
|
|
[ "DESTDIR=$(out)"
|
|
|
|
"CC=${gcc}/bin/gcc"
|
|
|
|
"FLEX=${flex}/bin/flex"
|
|
|
|
"BISON=${bison}/bin/bison"
|
|
|
|
"FIND=${findutils}/bin/find"
|
|
|
|
"STRIP=${binutils}/bin/strip"
|
|
|
|
"INSTALL=${coreutils}/bin/install"
|
|
|
|
"MANDIR=/share/man"
|
|
|
|
"MKNOD=true"
|
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2014-02-22 20:11:33 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-02-17 15:23:31 +01:00
|
|
|
description = "grsecurity RBAC administration and policy analysis utility";
|
|
|
|
homepage = "https://grsecurity.net";
|
2014-02-22 20:11:33 +01:00
|
|
|
license = licenses.gpl2;
|
|
|
|
platforms = platforms.linux;
|
2015-10-05 11:17:56 +02:00
|
|
|
maintainers = with maintainers; [ thoughtpolice ];
|
2014-02-17 15:23:31 +01:00
|
|
|
};
|
|
|
|
}
|