git.iko.soy/typeable/nixpkgs
on master help sign in
selinux-python: init at 2.7

tools written in python that upstream moved from policycoreutils into a separate package

commit905f4725562b8cf07d1a75fd6e5d6573d5cb5520 authorxeji <xeji@cat3.de> dateTue 20 Mar 2018, 14:56 (9 years ago) parentcc8bf58
2 files changed+54
pkgs/os-specific/linux/selinux-python/default.nix+49 pkgs/top-level/all-packages.nix+5
pkgs/os-specific/linux/selinux-python/default.nixnew file+49
@@ -0,0 +1,49 @@
1+{ stdenv, fetchurl, python3
2+, libselinux, libsemanage, libsepol, setools }:
3+
4+# this is python3 only because setools only supports python3
5+
6+with stdenv.lib;
7+with python3.pkgs;
8+
9+stdenv.mkDerivation rec {
10+ name = "selinux-python-${version}";
11+ version = "2.7";
12+ se_release = "20170804";
13+ se_url = "https://raw.githubusercontent.com/wiki/SELinuxProject/selinux/files/releases";
14+
15+ src = fetchurl {
16+ url = "${se_url}/${se_release}/selinux-python-${version}.tar.gz";
17+ sha256 = "1va0y4b7cah7rprh04b3ylmwqgnivpkw5z2zw68nrafdbsbcn5s2";
18+ };
19+
20+ nativeBuildInputs = [ wrapPython ];
21+ buildInputs = [ libsepol python3 ];
22+ propagatedBuildInputs = [ libselinux libsemanage setools ipy ];
23+
24+ postPatch = ''
25+ substituteInPlace sepolicy/Makefile --replace "echo --root" "echo --prefix"
26+ '';
27+
28+ preBuild = ''
29+ makeFlagsArray+=("PREFIX=$out")
30+ makeFlagsArray+=("DESTDIR=$out")
31+ makeFlagsArray+=("LOCALEDIR=$out/share/locale")
32+ makeFlagsArray+=("LIBSEPOLA=${libsepol}/lib/libsepol.a")
33+ makeFlagsArray+=("BASHCOMPLETIONDIR=$out/share/bash-completion/completions")
34+ makeFlagsArray+=("PYTHON=${python3}/bin/python")
35+ makeFlagsArray+=("PYTHONLIBDIR=lib/${python3.libPrefix}/site-packages")
36+ '';
37+
38+ postFixup = ''
39+ wrapPythonPrograms
40+ '';
41+
42+ meta = {
43+ description = "SELinux policy core utilities written in Python";
44+ license = licenses.gpl2;
45+ homepage = https://selinuxproject.org;
46+ platforms = platforms.linux;
47+ };
48+}
49+
pkgs/top-level/all-packages.nix+5
@@ -20660,6 +20660,11 @@ with pkgs;
2066020660 seafile-shared = callPackage ../misc/seafile-shared { };
2066120661
2066220662 serviio = callPackage ../servers/serviio {};
20663+ selinux-python = callPackage ../os-specific/linux/selinux-python {
20664+ # needs python3 bindings
20665+ libselinux = libselinux.override { python = python3; };
20666+ libsemanage = libsemanage.override { python = python3; };
20667+ };
2066320668
2066420669 slock = callPackage ../misc/screensavers/slock {
2066520670 conf = config.slock.conf or null;