# Build jsvc and commons-daemon
#
CC=cc
CFLAGS="$SUNCC_CFLAGS -KPIC"
LDFLAGS="$CFLAGS"
export CC
export CFLAGS
export LDFLAGS

install -m 755 -d $RPM_BUILD_ROOT$_javadir
install -m 755 -d $RPM_BUILD_ROOT$_sbindir

ant -Dcompile.source=1.5 -Dcompile.target=1.5 -Dbuild.sysclasspath=ignore jar
test $? -ne 0 && exit 1
install -m 644 dist/commons-daemon-$version.jar \
        $RPM_BUILD_ROOT$_javadir/commons-daemon-$version-redhat-1.jar
pushd src/native/unix
./configure --build=$_arch_sun-pc-solaris10
test $? -ne 0 && exit 1
$__make
test $? -ne 0 && exit 1
install -m 755 jsvc $RPM_BUILD_ROOT$_sbindir
popd
pushd "$RPM_BUILD_ROOT$_javadir"
ln -s commons-daemon-$version-redhat-1.jar commons-daemon.jar
popd
pushd "$RPM_BUILD_ROOT$_sbindir"
ln -s ../share/java/commons-daemon-$version-redhat-1.jar commons-daemon.jar
popd

files="$_sbindir $_javadir"
files_doc="README LICENSE.txt NOTICE.txt RELEASE-NOTES.txt"
