# Apache Httpd XBuild
#
EXTLIBPATH="$RPM_ROOT_DIR/$_lib"
EXTINCPATH="$RPM_ROOT_DIR/include"
export EXTLIBPATH
export EXTINCPATH
INCLUDE="$INCLUDE:`pwd`"
export INCLUDE
$__make -f NMAKEmakefile PREFIX=`pwd`/distr install

install -m 755 -d "$RPM_BUILD_ROOT$_bindir"
install -m 755 -d "$RPM_BUILD_ROOT$_libdir"
install -m 755 -d "$RPM_BUILD_ROOT$_sbindir"
install -m 755 -d "$RPM_BUILD_ROOT$_localstatedir"
install -m 755 -d "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf"
install -m 755 -d "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf.d"

copypdir distr/include "$RPM_BUILD_ROOT$_includedir/httpd"
copypdir distr/$_lib "$RPM_BUILD_ROOT$_libdir"
copypdir distr/modules "$RPM_BUILD_ROOT$_libdir/httpd/modules"
for i in error icons manual
do
  copypdir distr/$i "$RPM_BUILD_ROOT$_localstatedir/www/$i"
done
pushd distr/bin
for i in ab.exe httpd.exe htdbm.exe htdigest.exe htpasswd.exe logresolve.exe *.dll
do
    install -m 755 $i "$RPM_BUILD_ROOT$_bindir/$i"
done
for i in ApacheMonitor htcacheclean rotatelogs wintty
do
    install -m 755 $i.exe "$RPM_BUILD_ROOT$_sbindir/$i.exe"
done
popd

install -m 644 $_sourcedir/httpd.conf.windows \
               "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf/httpd.conf.in"
install -m 644 $_sourcedir/ssl.conf.windows \
               "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf.d/ssl.conf.in"
for i in welcome.conf manual.conf proxy_ajp.conf
do
    install -m 644 $_sourcedir/$i "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf.d/$i.in"
done

install -m 644 "distr/conf/default/magic" \
               "$RPM_BUILD_ROOT$_sysconfdir/httpd/conf/magic"
install -m 644 "distr/conf/default/mime.types" \
               "$RPM_BUILD_ROOT$_sysconfdir/mime.types.in"
install -m 644 "distr/conf/default/charset.conv" \
               "$RPM_BUILD_ROOT$_sysconfdir/charset.conv.in"

files="$_bindir $_sbindir $_sysconfdir $_localstatedir $_libdir/httpd/modules"
files_doc="CHANGES LICENSE README README-win32.txt NOTICE VERSIONING"
files_devel="$_libdir/*.lib $_includedir"
files_devel_doc="INSTALL LAYOUT"
