2018-07-17 21:11:16 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, bison, flex, libsepol, libselinux, bzip2, audit
|
2018-03-14 12:43:48 +00:00
|
|
|
, enablePython ? true, swig ? null, python ? null
|
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
2011-03-27 05:46:12 +01:00
|
|
|
|
2015-07-31 20:40:31 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2011-03-27 05:46:12 +01:00
|
|
|
name = "libsemanage-${version}";
|
2018-03-14 12:43:48 +00:00
|
|
|
version = "2.7";
|
2013-02-24 12:25:53 +00:00
|
|
|
inherit (libsepol) se_release se_url;
|
2011-03-27 05:46:12 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2013-02-24 12:25:53 +00:00
|
|
|
url = "${se_url}/${se_release}/libsemanage-${version}.tar.gz";
|
2018-03-14 12:43:48 +00:00
|
|
|
sha256 = "0xnlp1yg8b1aqc6kq3pss1i1nl06rfj4x4pyl5blasnf2ivlgs87";
|
2011-03-27 05:46:12 +01:00
|
|
|
};
|
|
|
|
|
2018-03-14 12:43:48 +00:00
|
|
|
nativeBuildInputs = [ bison flex pkgconfig ];
|
2018-07-17 21:11:16 +01:00
|
|
|
buildInputs = [ libsepol libselinux bzip2 audit ]
|
2018-03-14 12:43:48 +00:00
|
|
|
++ optionals enablePython [ swig python ];
|
2015-07-31 21:02:41 +01:00
|
|
|
|
2015-07-31 20:40:31 +01:00
|
|
|
preBuild = ''
|
|
|
|
makeFlagsArray+=("PREFIX=$out")
|
|
|
|
makeFlagsArray+=("DESTDIR=$out")
|
2018-03-14 12:43:48 +00:00
|
|
|
makeFlagsArray+=("MAN3DIR=$out/share/man/man3")
|
|
|
|
makeFlagsArray+=("MAN5DIR=$out/share/man/man5")
|
2018-03-20 13:52:05 +00:00
|
|
|
makeFlagsArray+=("PYSITEDIR=$out/lib/${python.libPrefix}/site-packages")
|
2015-07-31 20:40:31 +01:00
|
|
|
'';
|
2013-02-24 12:25:53 +00:00
|
|
|
|
2018-03-14 12:43:48 +00:00
|
|
|
installTargets = [ "install" ] ++ optionals enablePython [ "install-pywrap" ];
|
|
|
|
|
2018-07-29 22:22:56 +01:00
|
|
|
meta = removeAttrs libsepol.meta ["outputsToInstall"] // {
|
2011-03-27 05:46:12 +01:00
|
|
|
description = "Policy management tools for SELinux";
|
2015-07-31 20:40:31 +01:00
|
|
|
license = stdenv.lib.licenses.lgpl21;
|
2011-03-27 05:46:12 +01:00
|
|
|
};
|
2013-02-24 12:25:53 +00:00
|
|
|
}
|