setuptools will install into what python3-native thinks $libdir is, which may
not match the target $libdir.  Pass in libdir as appropriate to force the
correct paths.

Signed-off-by: Ross Burton <ross.bur...@intel.com>
---
 recipes-security/AppArmor/apparmor_2.12.bb      |  5 ++--
 recipes-security/AppArmor/files/py-libdir.patch | 40 +++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 2 deletions(-)
 create mode 100644 recipes-security/AppArmor/files/py-libdir.patch

diff --git a/recipes-security/AppArmor/apparmor_2.12.bb 
b/recipes-security/AppArmor/apparmor_2.12.bb
index efa93e6..073b62d 100644
--- a/recipes-security/AppArmor/apparmor_2.12.bb
+++ b/recipes-security/AppArmor/apparmor_2.12.bb
@@ -18,6 +18,7 @@ SRC_URI = " \
        file://disable_perl_h_check.patch \
        file://crosscompile_perl_bindings.patch \
        file://tool-paths.patch \
+       file://py-libdir.patch \
        file://apparmor.rc \
        file://functions \
        file://apparmor \
@@ -79,9 +80,9 @@ do_install () {
        install -d ${D}/${INIT_D_DIR}
        install -d ${D}/lib/apparmor
                
-       oe_runmake -C ${B}/libraries/libapparmor DESTDIR="${D}" install
+       oe_runmake -C ${B}/libraries/libapparmor DESTDIR="${D}" 
PYLIBDIR=${PYTHON_SITEPACKAGES_DIR} install
        oe_runmake -C ${B}/binutils DESTDIR="${D}" install
-       oe_runmake -C ${B}/utils DESTDIR="${D}" install
+       oe_runmake -C ${B}/utils DESTDIR="${D}" 
PYLIBDIR=${PYTHON_SITEPACKAGES_DIR} install
        oe_runmake -C ${B}/parser DESTDIR="${D}" install
        oe_runmake -C ${B}/profiles DESTDIR="${D}" install
 
diff --git a/recipes-security/AppArmor/files/py-libdir.patch 
b/recipes-security/AppArmor/files/py-libdir.patch
new file mode 100644
index 0000000..2b88e54
--- /dev/null
+++ b/recipes-security/AppArmor/files/py-libdir.patch
@@ -0,0 +1,40 @@
+Let the user override the Python libdir so it goes to the right place, as
+python3-native's idea of $libdir may not match the target's $libdir.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.bur...@intel.com>
+
+diff --git a/libraries/libapparmor/swig/python/Makefile.am 
b/libraries/libapparmor/swig/python/Makefile.am
+index 421acba9..d2b842a6 100644
+--- a/libraries/libapparmor/swig/python/Makefile.am
++++ b/libraries/libapparmor/swig/python/Makefile.am
+@@ -14,7 +14,7 @@ all-local: libapparmor_wrap.c setup.py
+       $(PYTHON) setup.py build
+ 
+ install-exec-local:
+-      $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)"
++      $(PYTHON) setup.py install --root="/$(DESTDIR)" --prefix="$(prefix)" 
--install-lib="$(PYLIBDIR)"
+ 
+ clean-local:
+       if test -x "$(PYTHON)"; then $(PYTHON) setup.py clean; fi
+diff --git a/utils/Makefile b/utils/Makefile
+index 68f8c376..025f9da5 100644
+--- a/utils/Makefile
++++ b/utils/Makefile
+@@ -42,6 +42,7 @@ DESTDIR=/
+ BINDIR=${DESTDIR}/usr/sbin
+ CONFDIR=${DESTDIR}/etc/apparmor
+ PYPREFIX=/usr
++PYLIBDIR=$PYPREFIX/lib
+ 
+ PYFLAKES=pyflakes
+ 
+@@ -60,7 +61,7 @@ install: ${MANPAGES} ${HTMLMANPAGES}
+       $(MAKE) install_manpages DESTDIR=${DESTDIR}
+       $(MAKE) -C vim install DESTDIR=${DESTDIR}
+       ln -sf aa-status.8 ${DESTDIR}/${MANDIR}/man8/apparmor_status.8
+-      ${PYTHON} ${PYSETUP} install --prefix=${PYPREFIX} --root=${DESTDIR} 
--version=${VERSION}
++      ${PYTHON} ${PYSETUP} install --prefix=${PYPREFIX} 
--install-lib=${PYLIBDIR} --root=${DESTDIR} --version=${VERSION}
+ 
+ .PHONY: clean
+ ifndef VERBOSE
-- 
2.11.0

-- 
_______________________________________________
yocto mailing list
yocto@yoctoproject.org
https://lists.yoctoproject.org/listinfo/yocto

Reply via email to