summary refs log tree commit diff
path: root/pkgs/os-specific/linux/apparmor
diff options
context:
space:
mode:
authorJoachim Fasting <joachifm@fastmail.fm>2015-07-15 09:45:22 +0200
committerJoachim Fasting <joachifm@fastmail.fm>2015-08-26 22:58:12 +0200
commitfdb4633e4bcaf99fafe42a86455e7f9bff771cbd (patch)
treed9e57f0f987785e2c60e213ed79df02ef415a5a5 /pkgs/os-specific/linux/apparmor
parented5f6be317176d9a9eeeb2081744050027d77410 (diff)
downloadnixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar.gz
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar.bz2
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar.lz
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar.xz
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.tar.zst
nixpkgs-fdb4633e4bcaf99fafe42a86455e7f9bff771cbd.zip
apparmor-utils: wrap python and perl scripts
This allows all utilties to at least run, though most still fail
because they expect to be able to read a non-existent config file.

Also, aa-notify refuses to run due to a self-check on the filename,
which cannot be preceded by a '.'. This has to be patched or we
need to set PERL5LIB some other way.
Diffstat (limited to 'pkgs/os-specific/linux/apparmor')
-rw-r--r--pkgs/os-specific/linux/apparmor/default.nix21
1 files changed, 17 insertions, 4 deletions
diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix
index 33625cc3681..64c6f66575b 100644
--- a/pkgs/os-specific/linux/apparmor/default.nix
+++ b/pkgs/os-specific/linux/apparmor/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, autoconf, autoreconfHook, automake, libtool, pkgconfig, perl, which
-, glibc, flex, bison, python27, swig, pam
+{ stdenv, fetchurl, makeWrapper, autoconf, autoreconfHook, automake, libtool, pkgconfig, perl, which
+, glibc, flex, bison, python27Packages, swig, pam
 }:
 
 let
@@ -40,7 +40,7 @@ let
       libtool
       perl
       pkgconfig
-      python27
+      python27Packages.python
       swig
       which
     ];
@@ -64,8 +64,11 @@ let
     src = apparmor-sources;
 
     buildInputs = [
-      python27
+      perl
+      python27Packages.python
+      python27Packages.readline
       libapparmor
+      makeWrapper
       which
     ];
 
@@ -74,6 +77,16 @@ let
     makeFlags = ''LANGS='';
     installFlags = ''DESTDIR=$(out) BINDIR=$(out)/bin VIM_INSTALL_PATH=$(out)/share PYPREFIX='';
 
+    postInstall = ''
+      for prog in aa-audit aa-autodep aa-cleanprof aa-complain aa-disable aa-enforce aa-genprof aa-logprof aa-mergeprof aa-status aa-unconfined ; do
+        wrapProgram $out/bin/$prog --prefix PYTHONPATH : "$out/lib/${python27Packages.python.libPrefix}/site-packages:$PYTHONPATH"
+      done
+
+      for prog in aa-exec aa-notify ; do
+        wrapProgram $out/bin/$prog --prefix PERL5LIB : "${libapparmor}/lib/perl5:$PERL5LIB"
+      done
+    '';
+
     meta = apparmor-meta "user-land utilities";
   };