# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortGroup legacysupport 1.0
checksums rmd160 24ac7d816918e1c87aaaa1e6ae8f775a464527fc \
sha256 cf14cce2254a96d8fcb6d3181e1a3c29a8f832531c3e86ff6f2524ecda9a8721 \
set branch [join [lrange [split ${version} .] 0 1] .]
maintainers {ryandesign @ryandesign}
description A secure, fast, compliant and flexible web-server
long_description lighttpd is a secure, fast, compliant and very \
flexible web server which has been optimized for \
high-performance environments. It has a very low \
memory footprint compared to other web servers \
and takes care of CPU load.
homepage http://www.lighttpd.net/
master_sites http://download.lighttpd.net/lighttpd/releases-${branch}.x/
depends_build-append port:pkgconfig
patchfiles patch-conf.diff
reinplace "s|@PREFIX@|${prefix}|g" \
${worksrcpath}/doc/config/conf.d/cgi.conf \
${worksrcpath}/doc/config/conf.d/fastcgi.conf \
${worksrcpath}/doc/config/conf.d/mysql_vhost.conf \
${worksrcpath}/doc/config/conf.d/rrdtool.conf \
${worksrcpath}/doc/config/lighttpd.conf
configure.args-append CC_FOR_BUILD="${configure.cc}" \
CFLAGS_FOR_BUILD="${configure.cflags}" \
ac_cv_prog_AWK=/usr/bin/awk
depends_lib-append port:libev
patchfiles-append patch-conf-darwin.diff \
reinplace "s|@USER@|${user}|g" ${worksrcpath}/doc/config/lighttpd.conf
reinplace "s|@GROUP@|${group}|g" ${worksrcpath}/doc/config/lighttpd.conf
configure.args-append --with-libev ac_cv_func_kqueue=no
set lighttpd_config_dir ${prefix}/etc/${name}
startupitem.executable ${prefix}/sbin/lighttpd -D -f ${lighttpd_config_dir}/lighttpd.conf
destroot.keepdirs ${destroot}${prefix}/var/log/lighttpd \
${destroot}${prefix}/www/htdocs \
${destroot}${prefix}/var/run/lighttpd \
${destroot}${prefix}/var/lib/lighttpd/sockets \
${destroot}${prefix}/var/cache/lighttpd/compress
xinstall -d ${destroot}${lighttpd_config_dir}/conf.d
foreach f [glob ${worksrcpath}/doc/config/*.conf] {
xinstall -m 0644 ${f} ${destroot}${lighttpd_config_dir}/[file tail ${f}].default
foreach f [glob ${worksrcpath}/doc/config/conf.d/*.conf] {
xinstall -m 0644 ${f} ${destroot}${lighttpd_config_dir}/conf.d/[file tail ${f}].default
set docdir ${destroot}${prefix}/share/doc/${name}