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.
This commit is contained in:
Joachim Fasting 2015-07-15 09:45:22 +02:00
parent ed5f6be317
commit fdb4633e4b

View file

@ -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";
};