[apparmor] [patch] utils/test/Makefile: add libapparmor to PYTHONPATH
John Johansen
john.johansen at canonical.com
Wed Nov 18 11:14:32 UTC 2015
On 10/21/2015 03:02 PM, Christian Boltz wrote:
> 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
>
yikes that is ugly, but I don't know a better way either.
Acked-by: John Johansen <john.johansen at canonical.com>
>
> [ 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
>
More information about the AppArmor
mailing list