[apparmor] "Fun" with building tomcat_apparmor

Christian Boltz apparmor at cboltz.de
Mon Sep 12 23:21:24 UTC 2011


Hello,

please have a look at the build log below. Notice especially the 
    fatal error: jni.h: No such file or directory
line, followed by a "BUILD SUCCESSFUL" ;-)
Any idea from which package this jni.h should come from?

I don't use tomcat myself, therefore please take this as a bugreport
and try to come up with a patch that fixes the error checking ;-)

While you are on it, please also add support for RPM_BUILD_ROOT in the
tomcat_5_5/Makefile - I had to use
    CATALINA_HOME=%{buildroot}/%{CATALINA_HOME}
in the make install call in the specfile (but still don't know if it 
works because the build fails).

You can find the latest buildlog at 
https://build.opensuse.org/package/live_build_log?arch=x86_64&package=apparmor&project=home%3Acboltz%3Abranches%3Asecurity%3Aapparmor%3Afactory&repository=openSUSE_Factory
(Note: you might need to use the "download logfile" link because the
webinterface only shows the last $number of lines.)

Right now, the build still fails :-( - I'm open for suggestions how to 
fix it.



make: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5'
 ant -Dcatalina_home=/usr/share/tomcat6 -Dtarget=1.5 jar jni_so
Buildfile: /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/build.xml
 
 compile:
     [mkdir] Created dir: /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/build
     [javac] Compiling 2 source files to /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/build

 jar:
     [mkdir] Created dir: /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/dist
       [jar] Building jar: /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/dist/changeHatValve.jar
 
 compile:
 
 jni_so:
     [exec] make[1]: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] javah -jni -classpath ../../build com.novell.apparmor.JNIChangeHat 
     [exec] gcc -I/usr//lib/jvm/java/include  -I/usr//lib/jvm/java/include/linux -I../../../../../libraries/libapparmor/src/ -g -O2 -Wall -Wstrict-
prototypes -Wl,-soname,libJNIChangeHat.so.1 -pipe  -fpic -D_REENTRANT -shared -o libJNIChangeHat.so  JNIChangeHat.c -
L../../../../../libraries/libapparmor/src/.libs -lapparmor
      [exec] make[1]: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] JNIChangeHat.c:14:17: fatal error: jni.h: No such file or directory
      [exec] compilation terminated.
      [exec] make[1]: *** [libJNIChangeHat.so] Error 1
      [exec] Result: 2
 
 BUILD SUCCESSFUL
 Total time: 7 seconds
 make: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5'
 + mkdir -p /usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64//usr/share/tomcat6
 + make DESTDIR=/usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64 install -C changehat/tomcat_apparmor/tomcat_5_5 
CATALINA_HOME=/usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64//usr/share/tomcat6
 make: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5'
 __REPO_VERSION=`([ -x /usr/bin/bzr ] && /usr/bin/bzr version-info . 2> /dev/null || awk '{ print "revno: "$2 }' common/.stamp_rev) | awk '/^revno:/ { 
print $2 }'` ; \
 sed -e "s/@@immunix_version@@/2.7.0~beta1/g" \
     -e "s/@@repo_version@@/${__REPO_VERSION}/g" tomcat_apparmor.spec.in > tomcat_apparmor.spec
 ant  -Dversion=2.7.0~beta1 -Drelease="AppArmor 2.7.0~beta1" -
Dcatalina_home=/usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64//usr/share/tomcat6 -Dinstall_lib=lib install_jar install_jni
 Buildfile: /usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/build.xml

 compile:
 
 jni_so:
      [exec] make[1]: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] javah -jni -classpath ../../build com.novell.apparmor.JNIChangeHat 
     [exec] gcc -I/usr/lib/jvm/java/include  -I/usr/lib/jvm/java/include/linux -I../../../../../libraries/libapparmor/src/ -g -O2 -Wall -Wstrict-
prototypes -Wl,-soname,libJNIChangeHat.so.1 -pipe  -fpic -D_REENTRANT -shared -o libJNIChangeHat.so  JNIChangeHat.c -
L../../../../../libraries/libapparmor/src/.libs -lapparmor
      [exec] JNIChangeHat.c:14:17: fatal error: jni.h: No such file or directory
      [exec] compilation terminated.
      [exec] make[1]: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] make[1]: *** [libJNIChangeHat.so] Error 1
      [exec] Result: 2
 
 install_jar:
     [mkdir] Created dir: /usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64/usr/share/tomcat6/lib
      [copy] Copying 1 file to /usr/src/packages/BUILDROOT/apparmor-2.7.beta1-185.1.x86_64/usr/share/tomcat6/lib
 
 compile:
 
 jni_so:
      [exec] make[1]: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] javah -jni -classpath ../../build com.novell.apparmor.JNIChangeHat 
     [exec] gcc -I/usr/lib/jvm/java/include  -I/usr/lib/jvm/java/include/linux -I../../../../../libraries/libapparmor/src/ -g -O2 -Wall -Wstrict-
prototypes -Wl,-soname,libJNIChangeHat.so.1 -pipe  -fpic -D_REENTRANT -shared -o libJNIChangeHat.so  JNIChangeHat.c -
L../../../../../libraries/libapparmor/src/.libs -lapparmor
      [exec] JNIChangeHat.c:14:17: fatal error: jni.h: No such file or directory
      [exec] compilation terminated.
      [exec] make[1]: *** [libJNIChangeHat.so] Error 1
      [exec] make[1]: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] Result: 2
 
 install_jni:
      [exec] make[1]: Entering directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] javah -jni -classpath ../../build com.novell.apparmor.JNIChangeHat 
     [exec] gcc -I/usr/lib/jvm/java/include  -I/usr/lib/jvm/java/include/linux -I../../../../../libraries/libapparmor/src/ -g -O2 -Wall -Wstrict-
prototypes -Wl,-soname,libJNIChangeHat.so.1 -pipe  -fpic -D_REENTRANT -shared -o libJNIChangeHat.so  JNIChangeHat.c -
L../../../../../libraries/libapparmor/src/.libs -lapparmor
      [exec] JNIChangeHat.c:14:17: fatal error: jni.h: No such file or directory
      [exec] compilation terminated.
      [exec] make[1]: *** [libJNIChangeHat.so] Error 1
      [exec] make[1]: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5/src/jni_src'
      [exec] Result: 2
 
 BUILD SUCCESSFUL
 Total time: 8 seconds
 make: Leaving directory `/usr/src/packages/BUILD/apparmor-2.7.0~beta1/changehat/tomcat_apparmor/tomcat_5_5'









Regards,

Christian Boltz
-- 
>Programmieren in C++ hält die grauen Zellen am Leben.
Es schaerft alle fuenf Sinne: den Schwachsinn, den Bloedsinn,
den Wahnsinn, den Unsinn und den Stumpfsinn.
[Felix von Leitner und Holger Veit in doc]



More information about the AppArmor mailing list