# Build mod_cluster
#

CC=cc
export CC

install -m 755 -d "$RPM_BUILD_ROOT$_libdir/httpd/modules"
install -m 755 -d "$RPM_BUILD_ROOT$_confdir/httpd/conf"

for i in mod_slotmem mod_manager mod_proxy_cluster advertise
do
    pushd native/$i
    ./buildconf
    ./configure --with-apxs="$RPM_ROOT_DIR$_libdir/httpd/build/apxs"
    test $? -ne 0 && exit 1
    popd
done

for i in mod_slotmem mod_manager mod_proxy_cluster
do
    pushd native/$i
    make
    test $? -ne 0 && exit 1
    install -m 755 $i.so "$RPM_BUILD_ROOT$_libdir/httpd/modules/"
    popd
done
pushd native/advertise
make
test $? -ne 0 && exit 1
install -m 755 mod_advertise.so "$RPM_BUILD_ROOT$_libdir/httpd/modules/"
popd
$__chrpath -r '.:$ORIGIN/../..' $RPM_BUILD_ROOT$_libdir/httpd/modules/*.so || true
i=mod_cluster-native.conf
install -m 644 $_sourcedir/$i "$RPM_BUILD_ROOT$_confdir/httpd/conf/$i.in"

files="$_libdir $_confdir"
files_doc="README.txt lgpl.txt release.txt"
