From fdb4633e4bcaf99fafe42a86455e7f9bff771cbd Mon Sep 17 00:00:00 2001 From: Joachim Fasting Date: Wed, 15 Jul 2015 09:45:22 +0200 Subject: 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. --- pkgs/os-specific/linux/apparmor/default.nix | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'pkgs/os-specific') diff --git a/pkgs/os-specific/linux/apparmor/default.nix b/pkgs/os-specific/linux/apparmor/default.nix index 33625cc3681d..64c6f66575b6 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"; }; -- cgit 1.4.1