2013-02-24 12:25:53 +00:00
|
|
|
{ stdenv, fetchurl, intltool, pcre, libcap_ng, libcgroup
|
2013-11-28 08:58:06 +00:00
|
|
|
, libsepol, libselinux, libsemanage, setools
|
2013-02-24 12:25:53 +00:00
|
|
|
, python, sepolgen }:
|
2011-03-27 05:46:19 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
|
|
|
name = "policycoreutils-${version}";
|
2013-12-12 22:39:20 +00:00
|
|
|
version = "2.2.5";
|
2013-02-24 12:25:53 +00:00
|
|
|
inherit (libsepol) se_release se_url;
|
2011-03-27 05:46:19 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-02-24 12:25:53 +00:00
|
|
|
url = "${se_url}/${se_release}/policycoreutils-${version}.tar.gz";
|
2013-12-12 22:39:20 +00:00
|
|
|
sha256 = "1i0chc3km3wdgzrd556mmhvsglydxrimclnn77s73wy2qfl51y5v";
|
2011-03-27 05:46:19 +01:00
|
|
|
};
|
|
|
|
|
2013-02-24 12:25:53 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace po/Makefile --replace /usr/bin/install install
|
2013-11-28 08:58:06 +00:00
|
|
|
find . -type f -exec sed -i 's,/usr/bin/python,${python}/bin/python,' {} \;
|
2013-02-24 12:25:53 +00:00
|
|
|
'';
|
2011-03-27 05:46:19 +01:00
|
|
|
|
2013-02-24 12:25:53 +00:00
|
|
|
buildInputs = [ intltool pcre libcap_ng libcgroup
|
2013-11-28 08:58:06 +00:00
|
|
|
libsepol libselinux libsemanage setools
|
2013-02-24 12:25:53 +00:00
|
|
|
python sepolgen # ToDo? these are optional
|
|
|
|
];
|
2011-03-28 08:38:16 +01:00
|
|
|
|
2013-02-24 12:25:53 +00:00
|
|
|
preBuild = ''
|
|
|
|
mkdir -p "$out/lib" && cp -s "${libsepol}/lib/libsepol.a" "$out/lib"
|
|
|
|
'';
|
|
|
|
|
2013-11-28 08:58:06 +00:00
|
|
|
# Creation of the system-config-selinux directory is broken
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/share/system-config-selinux
|
|
|
|
'';
|
|
|
|
|
2013-02-24 12:25:53 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-fstack-protector-all";
|
|
|
|
NIX_LDFLAGS = "-lsepol -lpcre";
|
|
|
|
|
|
|
|
makeFlags = "PREFIX=$(out) DESTDIR=$(out) LOCALEDIR=$(out)/share/locale";
|
2011-03-27 05:46:19 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "SELinux policy core utilities";
|
|
|
|
license = licenses.gpl2;
|
2013-02-24 12:25:53 +00:00
|
|
|
inherit (libsepol.meta) homepage platforms maintainers;
|
2011-03-27 05:46:19 +01:00
|
|
|
};
|
2013-02-24 12:25:53 +00:00
|
|
|
}
|
|
|
|
|