+
+ WEB_GROUP=www
+ for x in www www-data apache httpd nogroup nobody; do
+ echo "$as_me:$LINENO: checking if group $x exists" >&5
+echo $ECHO_N "checking if group $x exists... $ECHO_C" >&6
+ if $PERL -e"exit( defined getgrnam('$x') ? 0 : 1)" ; then
+ echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6; WEB_GROUP=$x ; break
+else
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+fi
+
+ done
+
+fi;
+
+
+
+# Check whether --with-rt-group or --without-rt-group was given.
+if test "${with_rt_group+set}" = set; then
+ withval="$with_rt_group"
+ RTGROUP=$withval
+else
+
+ RTGROUP=rt
+ for x in rt3 rt $WEB_GROUP; do
+ echo "$as_me:$LINENO: checking if group $x exists" >&5
+echo $ECHO_N "checking if group $x exists... $ECHO_C" >&6
+ if $PERL -e"exit( defined getgrnam('$x') ? 0 : 1)" ; then
+ echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6; RTGROUP=$x ; break
+else
+ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6
+fi
+
+ done
+
+fi;
+
+
+# XXX TODO: The command below to figure out the group brokenly relies on
+# output order (and "id -gn" doesn't work on all platforms).
+my_group=$(groups|cut -f1 -d' ')
+my_user=${USER:-$LOGNAME}
+
+# Check whether --with-my-user-group or --without-my-user-group was given.
+if test "${with_my_user_group+set}" = set; then
+ withval="$with_my_user_group"
+ RTGROUP=$my_group
+ BIN_OWNER=$my_user
+ LIBS_OWNER=$my_user
+ LIBS_GROUP=$my_group
+ WEB_USER=$my_user
+ WEB_GROUP=$my_group
+fi;
+
+# Test for valid database names
+if test "$DB_TYPE" == "mysql" ; then
+ echo "$as_me:$LINENO: checking if database name is valid" >&5
+echo $ECHO_N "checking if database name is valid... $ECHO_C" >&6
+ if echo $DB_DATABASE | $AWK '/-/ { exit 1 }' ; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+ { { echo "$as_me:$LINENO: error: no. database name ($DB_DATABASE) contains '-' which is not valid for mysql" >&5
+echo "$as_me: error: no. database name ($DB_DATABASE) contains '-' which is not valid for mysql" >&2;}
+ { (exit 1); exit 1; }; }
+
+fi
+
+
+
+fi
+
+
+
+
+# Check whether --with-apachectl or --without-apachectl was given.
+if test "${with_apachectl+set}" = set; then
+ withval="$with_apachectl"
+ APACHECTL=$withval
+else
+ APACHECTL=`which apachectl`