2021-01-15 15:45:37 +01:00
|
|
|
{ lib, stdenv, fetchurl, python3
|
2018-03-20 14:56:08 +01:00
|
|
|
, libselinux, libsemanage, libsepol, setools }:
|
|
|
|
|
|
|
|
# this is python3 only because setools only supports python3
|
|
|
|
|
2021-01-15 15:45:37 +01:00
|
|
|
with lib;
|
2018-03-20 14:56:08 +01:00
|
|
|
with python3.pkgs;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "selinux-python";
|
2019-08-17 18:13:30 +02:00
|
|
|
version = "2.9";
|
|
|
|
|
|
|
|
inherit (libsepol) se_release se_url;
|
2018-03-20 14:56:08 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "${se_url}/${se_release}/selinux-python-${version}.tar.gz";
|
2019-08-17 18:13:30 +02:00
|
|
|
sha256 = "1pjzsyay5535cxcjag7y7k193ajry0s0xc3dqv5905qd7cwval1n";
|
2018-03-20 14:56:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ wrapPython ];
|
|
|
|
buildInputs = [ libsepol python3 ];
|
|
|
|
propagatedBuildInputs = [ libselinux libsemanage setools ipy ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace sepolicy/Makefile --replace "echo --root" "echo --prefix"
|
2019-08-17 18:13:30 +02:00
|
|
|
substituteInPlace sepolgen/src/share/Makefile --replace "/var/lib/sepolgen" \
|
|
|
|
"\$PREFIX/var/lib/sepolgen"
|
2018-03-20 14:56:08 +01:00
|
|
|
'';
|
|
|
|
|
2019-08-17 18:13:30 +02:00
|
|
|
makeFlags = [
|
|
|
|
"PREFIX=$(out)"
|
|
|
|
"LOCALEDIR=$(out)/share/locale"
|
|
|
|
"BASHCOMPLETIONDIR=$(out)/share/bash-completion/completions"
|
|
|
|
"PYTHON=python"
|
|
|
|
"PYTHONLIBDIR=$(out)/${python.sitePackages}"
|
2021-01-15 15:45:37 +01:00
|
|
|
"LIBSEPOLA=${lib.getLib libsepol}/lib/libsepol.a"
|
2019-08-17 18:13:30 +02:00
|
|
|
];
|
|
|
|
|
2018-03-20 14:56:08 +01:00
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapPythonPrograms
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "SELinux policy core utilities written in Python";
|
|
|
|
license = licenses.gpl2;
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://selinuxproject.org";
|
2018-03-20 14:56:08 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|