#
# Script to configure Apache as distributed by SCO.
#
# Prerequisites: OpenSSL, MM installed (i.e. gwxlibs package)
#                mod_ssl configured
#
# mod_ssl has an OSDBUILD script too. Use it. All other modules are
# configured post-apache compilation (and most probably installtion)
# using APXS.
#

SSL_BASE=SYSTEM EAPI_MM=SYSTEM CC=gcc \
CFLAGS='-mcpu=i686 -march=i586 -O6 -fomit-frame-pointer' \
CXXFLAGS='-mcpu=i686 -march=i586 -O6 -fomit-frame-pointer' \
LIBS="-lgdbm -ldb -lmm -lsocket" ./configure \
  --with-layout=Apache \
  --prefix=/usr/lib/apache \
  --enable-module=all \
  --disable-module=example \
  --enable-shared=max \
  --enable-shared=ssl \
  --server-uid=nouser \
  --server-gid=nogroup \
  --with-port=80 \
  --enable-suexec \
  --suexec-caller=nouser \
  --suexec-docroot=/usr/lib/apache/htdocs \
  --suexec-logfile=/usr/lib/apache/logs/suexec_log \
  --suexec-safepath="/bin:/usr/bin:/usr/gnu/bin" \
  --mandir=/usr/man \
  --manualdir=/usr/lib/apache/manual \
  --enable-rule=EAPI \
  --enable-rule=SSL_SDBM \
  --disable-rule=SSL_COMPAT $@

echo "OSD: changing conf/httpd.conf to conf/cf.d"
sed -e 's,conf/httpd.conf,conf/cf.d,g' src/apaci > foo
mv foo src/apaci
chmod +x src/apaci
