aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--www/lighttpd/Makefile40
-rw-r--r--www/lighttpd/files/lighttpd.in12
-rw-r--r--www/lighttpd/pkg-plist58
3 files changed, 62 insertions, 48 deletions
diff --git a/www/lighttpd/Makefile b/www/lighttpd/Makefile
index ba65a8335db7..1fbbbd331333 100644
--- a/www/lighttpd/Makefile
+++ b/www/lighttpd/Makefile
@@ -3,6 +3,7 @@
PORTNAME?= lighttpd
PORTVERSION= 1.4.48
+PORTREVISION= 1
CATEGORIES?= www
MASTER_SITES?= http://download.lighttpd.net/lighttpd/releases-1.4.x/
@@ -103,8 +104,13 @@ LIGHTTPD_CONF_D_FILES= access_log.conf \
simple_vhost.conf ssi.conf status.conf \
trigger_b4_dl.conf userdir.conf webdav.conf
-LOGROOT= /var/log/lighttpd
-PLIST_SUB= LOGROOT="${LOGROOT}"
+USERS= ${WWWOWN}
+GROUPS= ${WWWGRP}
+CACHEDIR= /var/cache/${PORTNAME}
+LOGDIR= /var/log/${PORTNAME}
+HOMEDIR= /var/run/${PORTNAME}
+PLIST_SUB+= WWWOWN="${WWWOWN}" WWWGRP="${WWWGRP}"
+PLIST_SUB+= CACHEDIR="${CACHEDIR}" HOMEDIR="${HOMEDIR}" LOGDIR="${LOGDIR}"
.endif # !defined(_BUILDING_LIGHTTPD_MODULE)
@@ -118,17 +124,18 @@ post-patch:
@${REINPLACE_CMD} -e 's|-std=gnu99||' \
${WRKSRC}/configure ${WRKSRC}/configure.ac
@${REINPLACE_CMD} -E -e \
- 's|^(server.document-root.*=).*|\1 "${PREFIX}/www/data/"|' \
- -e "s|/etc/lighttpd|${PREFIX}/etc/lighttpd|g" \
+ 's|^(server.document-root.*=).*|\1 "${PREFIX}/www" + "/data"|' \
+ -e "s|/etc/lighttpd|${ETCDIR}|g" \
-e 's|^(server.event-handler.*=).*|\1 "freebsd-kqueue"|' \
-e 's|^(server.network-backend.*=).*|\1 "writev"|' \
- -e "s|^(server.username.*=).*|\1 \"${LIGHTTPD_USER}\"|" \
- -e "s|^(server.groupname.*=).*|\1 \"${LIGHTTPD_GROUP}\"|" \
- -e "s|^(var.log_root.*=).*|\1 \"${LIGHTTPD_LOGROOT}\"|" \
- -e "s|^(var.home_dir.*=).*|\1 \"/var/spool/lighttpd\"|" \
- -e "s|^(var.server_root.*=).*|\1 \"${LIGHTTPD_WEBROOT}\"|" \
+ -e "s|^(server.username.*=).*|\1 \"${WWWOWN}\"|" \
+ -e "s|^(server.groupname.*=).*|\1 \"${WWWGRP}\"|" \
+ -e "s|^(var.log_root.*=).*|\1 \"${LOGDIR}\"|" \
+ -e "s|^(var.server_root.*=).*|\1 \"${WWWDIR}\"|" \
+ -e "s|^(var.home_dir.*=).*|\1 \"${HOMEDIR}\"|" \
+ -e "s|^(var.cache_dir.*=).*|\1 \"${CACHEDIR}\"|" \
${WRKSRC}/doc/config/lighttpd.conf
- @${REINPLACE_CMD} -e "s|/etc/lighttpd|${PREFIX}/etc/lighttpd|g" \
+ @${REINPLACE_CMD} -e "s|/etc/lighttpd|${ETCDIR}|g" \
${WRKSRC}/doc/config/conf.d/auth.conf
@${REINPLACE_CMD} -e "s|/usr/bin/python|${LOCALBASE}/bin/python|" \
${WRKSRC}/doc/config/conf.d/cgi.conf \
@@ -140,18 +147,21 @@ post-patch:
${WRKSRC}/doc/config/lighttpd.conf
post-install:
- @${MKDIR} ${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d ${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d
+ @${MKDIR} ${STAGEDIR}${ETCDIR}/conf.d ${STAGEDIR}${ETCDIR}/vhosts.d
.for FILE in ${LIGHTTPD_CONF_FILES}
${INSTALL_DATA} ${WRKSRC}/doc/config/${FILE} \
- ${STAGEDIR}${PREFIX}/etc/lighttpd/${FILE}.sample
+ ${STAGEDIR}${ETCDIR}/${FILE}.sample
.endfor
.for FILE in ${LIGHTTPD_CONF_D_FILES}
${INSTALL_DATA} ${WRKSRC}/doc/config/conf.d/${FILE} \
- ${STAGEDIR}${PREFIX}/etc/lighttpd/conf.d/${FILE}.sample
+ ${STAGEDIR}${ETCDIR}/conf.d/${FILE}.sample
.endfor
${INSTALL_DATA} ${WRKSRC}/doc/config/vhosts.d/vhosts.template \
- ${STAGEDIR}${PREFIX}/etc/lighttpd/vhosts.d/vhosts.template
- @${MKDIR} -m 0700 ${STAGEDIR}${LOGROOT}
+ ${STAGEDIR}${ETCDIR}/vhosts.d/vhosts.template
+ @${MKDIR} ${STAGEDIR}${WWWDIR}
+ @${MKDIR} -m 0700 ${STAGEDIR}${CACHEDIR}
+ @${MKDIR} -m 0700 ${STAGEDIR}${HOMEDIR}/sockets
+ @${MKDIR} -m 0700 ${STAGEDIR}${LOGDIR}
post-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}
diff --git a/www/lighttpd/files/lighttpd.in b/www/lighttpd/files/lighttpd.in
index b003ab57468a..92ac1786c056 100644
--- a/www/lighttpd/files/lighttpd.in
+++ b/www/lighttpd/files/lighttpd.in
@@ -11,7 +11,7 @@
# lighttpd_enable (bool): Set it to "YES" to enable lighttpd
# Default is "NO".
# lighttpd_conf (path): Set full path to configuration file.
-# Default is "%%PREFIX%%/etc/lighttpd/lighttpd.conf".
+# Default is "%%ETCDIR%%/lighttpd.conf".
# lighttpd_pidfile (path): Set full path to pid file.
# Default is "/var/run/lighttpd.pid".
#
@@ -21,7 +21,7 @@
# lighttpd_instances (string): Instances of lighttpd
# Default is "" (no instances).
# lighttpd_${i}_conf (path): Set full path to instance configuration file.
-# Default is "%%PREFIX%%/etc/lighttpd/${i}.conf".
+# Default is "%%ETCDIR%%/${i}.conf".
# lighttpd_${i}_pidfile (path): Set full path to instance pid file
# Default is "/var/run/lighttpd_${i}.pid".
#
@@ -43,7 +43,7 @@ if [ -z "${lighttpd_conf}" ]; then
deprecated_conf=1
lighttpd_conf="%%PREFIX%%/etc/lighttpd.conf"
else
- lighttpd_conf="%%PREFIX%%/etc/lighttpd/lighttpd.conf"
+ lighttpd_conf="%%ETCDIR%%/lighttpd.conf"
fi
fi
@@ -65,7 +65,7 @@ lighttpd_check_deprecated()
echo ""
echo "*** NOTICE: ***"
echo "The default location of %%PREFIX%%/etc/lighttpd.conf is deprecated"
- echo "Please consider moving to %%PREFIX%%/etc/lighttpd/lighttpd.conf"
+ echo "Please consider moving to %%ETCDIR%%/lighttpd.conf"
echo ""
fi
}
@@ -73,7 +73,7 @@ lighttpd_check_deprecated()
lighttpd_checkconfig()
{
echo "Performing sanity check on ${name} configuration:"
- eval "${command} ${command_args} -t"
+ eval "${command} ${command_args} -tt"
}
lighttpd_gracefulstop()
@@ -96,7 +96,7 @@ lighttpd_run_instance()
_rcmd="$2"
name=${_orig_name}_${_i}
eval ${name}_enable=${lighttpd_enable}
- eval lighttpd_conf=\"\${lighttpd_${_i}_conf:-"%%PREFIX%%/etc/lighttpd/${_i}.conf"}\"
+ eval lighttpd_conf=\"\${lighttpd_${_i}_conf:-"%%ETCDIR%%/${_i}.conf"}\"
eval lighttpd_pidfile=\"\${lighttpd_${_i}_pidfile:-"/var/run/lighttpd_${_i}.pid"}\"
command_args="-f ${lighttpd_conf}"
pidfile=${lighttpd_pidfile}
diff --git a/www/lighttpd/pkg-plist b/www/lighttpd/pkg-plist
index fe82bbf9610c..d096d436224c 100644
--- a/www/lighttpd/pkg-plist
+++ b/www/lighttpd/pkg-plist
@@ -1,29 +1,29 @@
-@sample etc/lighttpd/lighttpd.conf.sample
-@sample etc/lighttpd/modules.conf.sample
-@sample etc/lighttpd/conf.d/access_log.conf.sample
-@sample etc/lighttpd/conf.d/auth.conf.sample
-@sample etc/lighttpd/conf.d/cgi.conf.sample
-@sample etc/lighttpd/conf.d/cml.conf.sample
-@sample etc/lighttpd/conf.d/compress.conf.sample
-@sample etc/lighttpd/conf.d/debug.conf.sample
-@sample etc/lighttpd/conf.d/dirlisting.conf.sample
-@sample etc/lighttpd/conf.d/evhost.conf.sample
-@sample etc/lighttpd/conf.d/expire.conf.sample
-@sample etc/lighttpd/conf.d/fastcgi.conf.sample
-@sample etc/lighttpd/conf.d/magnet.conf.sample
-@sample etc/lighttpd/conf.d/mime.conf.sample
-@sample etc/lighttpd/conf.d/mysql_vhost.conf.sample
-@sample etc/lighttpd/conf.d/proxy.conf.sample
-@sample etc/lighttpd/conf.d/rrdtool.conf.sample
-@sample etc/lighttpd/conf.d/scgi.conf.sample
-@sample etc/lighttpd/conf.d/secdownload.conf.sample
-@sample etc/lighttpd/conf.d/simple_vhost.conf.sample
-@sample etc/lighttpd/conf.d/ssi.conf.sample
-@sample etc/lighttpd/conf.d/status.conf.sample
-@sample etc/lighttpd/conf.d/trigger_b4_dl.conf.sample
-@sample etc/lighttpd/conf.d/userdir.conf.sample
-@sample etc/lighttpd/conf.d/webdav.conf.sample
-etc/lighttpd/vhosts.d/vhosts.template
+@sample %%ETCDIR%%/lighttpd.conf.sample
+@sample %%ETCDIR%%/modules.conf.sample
+@sample %%ETCDIR%%/conf.d/access_log.conf.sample
+@sample %%ETCDIR%%/conf.d/auth.conf.sample
+@sample %%ETCDIR%%/conf.d/cgi.conf.sample
+@sample %%ETCDIR%%/conf.d/cml.conf.sample
+@sample %%ETCDIR%%/conf.d/compress.conf.sample
+@sample %%ETCDIR%%/conf.d/debug.conf.sample
+@sample %%ETCDIR%%/conf.d/dirlisting.conf.sample
+@sample %%ETCDIR%%/conf.d/evhost.conf.sample
+@sample %%ETCDIR%%/conf.d/expire.conf.sample
+@sample %%ETCDIR%%/conf.d/fastcgi.conf.sample
+@sample %%ETCDIR%%/conf.d/magnet.conf.sample
+@sample %%ETCDIR%%/conf.d/mime.conf.sample
+@sample %%ETCDIR%%/conf.d/mysql_vhost.conf.sample
+@sample %%ETCDIR%%/conf.d/proxy.conf.sample
+@sample %%ETCDIR%%/conf.d/rrdtool.conf.sample
+@sample %%ETCDIR%%/conf.d/scgi.conf.sample
+@sample %%ETCDIR%%/conf.d/secdownload.conf.sample
+@sample %%ETCDIR%%/conf.d/simple_vhost.conf.sample
+@sample %%ETCDIR%%/conf.d/ssi.conf.sample
+@sample %%ETCDIR%%/conf.d/status.conf.sample
+@sample %%ETCDIR%%/conf.d/trigger_b4_dl.conf.sample
+@sample %%ETCDIR%%/conf.d/userdir.conf.sample
+@sample %%ETCDIR%%/conf.d/webdav.conf.sample
+%%ETCDIR%%/vhosts.d/vhosts.template
lib/lighttpd/mod_access.so
lib/lighttpd/mod_accesslog.so
lib/lighttpd/mod_alias.so
@@ -72,4 +72,8 @@ man/man8/lighttpd.8.gz
%%KRB5%%man/man8/lighttpd-angel.8.gz
sbin/lighttpd
sbin/lighttpd-angel
-@dir(www,www,700) %%LOGROOT%%
+@dir %%WWWDIR%%
+@dir(%%WWWOWN%%,%%WWWGRP%%,700) %%CACHEDIR%%
+@dir(%%WWWOWN%%,%%WWWGRP%%,700) %%HOMEDIR%%/sockets
+@dir(%%WWWOWN%%,%%WWWGRP%%,700) %%HOMEDIR%%
+@dir(%%WWWOWN%%,%%WWWGRP%%,700) %%LOGDIR%%