[apparmor] [patch] utils/test/Makefile: add libapparmor to PYTHONPATH
Christian Boltz
apparmor at cboltz.de
Wed Oct 21 22:02:53 UTC 2015
Hello,
the last utils/test/Makefile change switched to using the in-tree
libapparmor by default (unless USE_SYSTEM=1 is given). However, I missed
to add the swig/python parts of libapparmor to PYTHONPATH, so the
system-wide LibAppArmor/__init__.py was always used.
This patch adds the in-tree libapparmor python module to PYTHONPATH.
I'm sorry for the interesting[tm] way to find out that path, but
a) I don't know a better / less ugly way and
b) a similar monster already works in libapparmor/swig/python/test/ ;-)
I propose this patch for trunk and 2.9
[ 02-utils-test-Makefile-pythonpath-libapparmor.diff ]
=== modified file ./utils/test/Makefile
--- utils/test/Makefile 2015-10-18 22:14:36.782317464 +0200
+++ utils/test/Makefile 2015-10-21 23:44:10.732079102 +0200
@@ -24,8 +24,10 @@
LD_LIBRARY_PATH=
PYTHONPATH=
else
+ # PYTHON_DIST_BUILD_PATH based on libapparmor/swig/python/test/Makefile.am
+ PYTHON_DIST_BUILD_PATH = ../../libraries/libapparmor/swig/python/build/$$($(PYTHON) -c "import distutils.util; import platform; print(\"lib.%s-%s\" %(distutils.util.get_platform(), platform.python_version()[:3]))")
LD_LIBRARY_PATH=../../libraries/libapparmor/src/.libs/
- PYTHONPATH=..
+ PYTHONPATH=..:$(PYTHON_DIST_BUILD_PATH)
endif
.PHONY: __libapparmor
Regards,
Christian Boltz
--
NEVER use bad english as an excuse for anything with me :D
cuz my english SUCKED when I got involved with FOSS. Now I can give
talks to hundereds of ppl in english and not worry about my language
anymore - thanks to Free Software! [jospoortvliet in #opensuse-project]
More information about the AppArmor
mailing list