# Build tomcat-native
#

LDFLAGS="-L$RPM_ROOT_DIR$_libdir -Wl,+b,$RPM_BUILD_ROOT$_libdir"
export LDFLAGS

pushd jni/native
./configure \
    --prefix="" \
    --libdir="$_libdir" \
    --with-apr="$RPM_ROOT_DIR$_libdir/httpd/build/apr-1-config" \
    --with-java-home="$JAVA_HOME" \
    --with-java-platform=2 \
    --with-ssl="$RPM_ROOT_DIR"
test $? -ne 0 && exit 1
gmake
test $? -ne 0 && exit 1
gmake DESTDIR="$RPM_BUILD_ROOT" install
test $? -ne 0 && exit 1
popd
pushd $RPM_BUILD_ROOT$_libdir
rm -rf pkgconfig
rm -f *.a
rm -f *.la
chmod 775 *.so || true
$__chrpath -r '.:$ORIGIN' *.so || true
popd

files="$_libdir"
files_doc="CHANGELOG.txt README.txt LICENSE NOTICE"
