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