--- /usr/portage/eclass/webapp-apache.eclass 2003-12-16 06:10:45.000000000 -0500 +++ webapp-apache.eclass 2004-01-03 18:30:49.000000000 -0500 @@ -13,7 +13,8 @@ ECLASS=webapp-apache INHERITED="$INHERITED $ECLASS" -DEPEND="${DEPEND} net-www/apache" +# comment out dependency since we can handle apache not installed +#DEPEND="${DEPEND} net-www/apache" EXPORT_FUNCTIONS pkg_setup @@ -33,22 +34,34 @@ if [ "${APACHEVER}+" = "+" ]; then # no apache version detected - return 1 + # return 1 + # we can handle apache not installed + WEBAPP_SERVER="" + else + WEBAPP_SERVER="Apache v${APACHEVER}" fi + APACHECONF_DIR="/etc/apache${CONFVER}/conf/" APACHECONF="/etc/apache${CONFVER}/conf/apache${CONFVER}.conf" - APACHECONF_COMMON="/etc/apache${CONFVER}/conf/commonapache${CONFVER}.conf" - APACHECONF_DIR="/etc/apache${CONFVER}/conf/" - WEBAPP_SERVER="Apache v${APACHEVER}" + + if [ -f "${APACHECONF}" ]; then + COMMONAPACHE="`grep '^Include' "${APACHECONF}" | grep -i common | head -n1 | cut -d ' ' -f 2`" + if [ -z "${COMMONAPACHE}" ] && COMMONAPACHE="conf/commonapache${CONFVER}.conf" + APACHECONF_COMMON="/etc/apache${CONFVER}/${COMMONAPACHE}" + else + APACHECONF_COMMON="/etc/apache${CONFVER}/conf/commonapache${CONFVER}.conf" + fi } # run the function, so we know which version of apache we are using function webapp-detect () { - webapp-apache-detect || return 1 + # comment out return since we can handle apache not installed + # this allows us to avoid dependencies + webapp-apache-detect # || return 1 webapp-determine-installowner webapp-determine-htdocsdir - webapp-determine-cgibindir + webapp-determine-cgibindir # explicit return here to ensure the return code # from webapp-determine-cgibindir above isn't returned instead @@ -56,9 +69,10 @@ return 0 } -function webapp-mkdirs () { +function webapp-mkdirs () +{ webapp-determine-htdocsdir - webapp-determine-cgibindir + webapp-determine-cgibindir keepdir "$HTTPD_ROOT" fowners "$HTTPD_USER":"$HTTPD_GROUP" "$HTTPD_ROOT" @@ -74,18 +88,22 @@ { webapp-determine-installowner -# HTTPD_ROOT="`grep '^DocumentRoot' ${APACHECONF} | cut -d ' ' -f 2`" -# [ -z "${HTTPD_ROOT}" ] && HTTPD_ROOT="/home/httpd/htdocs/" - # temporary fix for webapps - HTTPD_ROOT="/var/www/localhost/htdocs/" + if [ -f "${APACHECONF}" ]; then + HTTPD_ROOT="`grep '^DocumentRoot' "${APACHECONF}" | cut -d ' ' -f 2`" + [ -z "${HTTPD_ROOT}" ] && HTTPD_ROOT="/var/www/localhost/htdocs/" + else + HTTPD_ROOT="/var/www/localhost/htdocs/" + fi } function webapp-determine-cgibindir () { - #HTTPD_CGIBIN="`grep 'ScriptAlias /cgi-bin/' ${APACHECONF_COMMON} | cut -d ' ' -f 7`" - #[ -z "${HTTPD_CGIBIN}" ] && HTTPD_CGIBIN="/home/httpd/cgi-bin/" - # temporary fix for webapps - HTTPD_CGIBIN="/var/www/localhost/cgi-bin/" + if [ -f "${APACHECONF_COMMON}" ]; then + HTTPD_CGIBIN="`grep 'ScriptAlias /cgi-bin/' "${APACHECONF_COMMON}" | cut -d ' ' -f 7`" + [ -z "${HTTPD_CGIBIN}" ] && HTTPD_CGIBIN="/var/www/localhost/cgi-bin/" + else + HTTPD_CGIBIN="/var/www/localhost/cgi-bin/" + fi } function webapp-determine-installowner ()