The multiarch filesystem layout for Ubuntu uses directories such as
/usr/lib/{i386-linux-gnu,x86_64-linux-gnu,arm-linux-gnueabihf} so
peeking into /usr/{lib,lib64} is no longer sufficient.

This patch uses ldconfig to print out the libraries that it knows about
and grep that output for libapparmor.so or libimmunix.so.

Signed-off-by: Tyler Hicks <[email protected]>
---
 tests/regression/apparmor/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/regression/apparmor/Makefile 
b/tests/regression/apparmor/Makefile
index 0e49517..c910c00 100644
--- a/tests/regression/apparmor/Makefile
+++ b/tests/regression/apparmor/Makefile
@@ -103,9 +103,9 @@ CHANGEHAT_FLAGS=$(shell if [ ! -f 
/usr/include/sys/apparmor.h ] ; then \
                                fi ;\
                        fi )
 
-LIBIMMUNIX:=$(shell    if [ -f /usr/lib/libapparmor.so -o -f 
/usr/lib64/libapparmor.so ] ; then \
+LIBIMMUNIX:=$(shell    if ldconfig -p | grep -q libapparmor\.so ; then \
                                echo -lapparmor ; \
-                       elif [ -f /lib/libimmunix.so.1 -o -f 
/lib64/libimmunix.so ] ; then \
+                       elif ldconfig -p | grep -q libimmunix\.so ; then \
                                echo -limmunix ; \
                        fi )
 
-- 
1.8.3.2


-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to