profiles/Makefile hardcodes PYTHONPATH and doesn't use LD_LIBRARY_PATH
When building apparmor 2.13.3 for Arch Linux (and also in earlier versions), I have reverted to inserting an extended PYTHONPATH
and a LD_LIBRARY_PATH
into profiles/Makefile
to get around a hardcoded PYTHON_PATH
:
ifndef LOGPROF
# use ../utils logprof
LOGPROF=PYTHONPATH=../utils $(PYTHON) ../utils/aa-logprof
endif
As libraries/libapparmor
otherwise has to be built and installed, before attempting to use profiles/Makefile
, I'm currently using the following to get around this limitation:
local _py3_ver=$(python --version | cut -d " " -f2)
local path="${PWD}/libraries/libapparmor/swig/python/build/lib.linux-${CARCH}-${_py3_ver%"."*}/LibAppArmor"
local libs="${PWD}/libraries/libapparmor/src/.libs"
sed -e "/PYTHONPATH/ s|utils\ |utils:$path\ LD_LIBRARY_PATH=$libs\ |" \
-i profiles/Makefile
I guess a better way of achieving this could be to make PYTHONPATH
properly settable from the environment and include LD_LIBRARY_PATH
to also be settable via the environment (else be empty?).