# Build tomcat-native
#

LDFLAGS="-L$RPM_ROOT_DIR$_libdir -R $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
make
test $? -ne 0 && exit 1
make DESTDIR="$RPM_BUILD_ROOT" install
test $? -ne 0 && exit 1
popd
rm -rf $RPM_BUILD_ROOT$_libdir/pkgconfig
rm -f $RPM_BUILD_ROOT$_libdir/*.a
rm -f $RPM_BUILD_ROOT$_libdir/*.la
$__chrpath -r '.:$ORIGIN' $RPM_BUILD_ROOT$_libdir/*.so || true

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