# Xbuild windows make
#

install -m 755 -d $RPM_BUILD_ROOT$_javadir
install -m 755 -d $RPM_BUILD_ROOT$_bindir
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
export BUILD_CPU=$_arch_win
pushd src/native/windows
pushd apps/prunsrv
$__make install
test $? -ne 0 && exit 1
popd
popd
pushd src/native/windows
pushd apps/prunmgr
$__make install
test $? -ne 0 && exit 1
popd
popd

if [ -f target/amd64/amd64/prunmgr.exe ]
then
    install -m 755 target/amd64/amd64/prunmgr.exe $RPM_BUILD_ROOT$_bindir
    install -m 755 target/amd64/prunsrv.exe $RPM_BUILD_ROOT$_sbindir
else
    install -m 755 target/prunmgr.exe $RPM_BUILD_ROOT$_bindir
    install -m 755 target/prunsrv.exe $RPM_BUILD_ROOT$_sbindir
fi
files="$_bindir $_sbindir $_javadir"
files_doc="README LICENSE.txt NOTICE.txt RELEASE-NOTES.txt"
