# $Id: Portfile,v 1.7 2006/03/22 08:10:24 blb Exp $

PortSystem 1.0
name              lighttpd
version           1.4.11
categories        www
maintainers       jstetser@icongarden.com
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 webservers and takes care of cpu-load.
homepage          http://www.lighttpd.net/
master_sites      ${homepage}/download/
checksums         ${distname}.tar.gz sha1 ca904d3d4d9dde76f85156f2c709a394f30e28c8 \
                  lighttpd.conf sha1 b13edd7e9f7da3761f4e152ff92d5f34044bd91d
depends_lib       lib:libpcre:pcre \
                  lib:libz.1:zlib 

configure.args    --mandir=${prefix}/share/man

post-destroot {
   file mkdir "${destroot}${prefix}/etc/${name}/"
   xinstall -m 644 -v "${worksrcpath}/doc/lighttpd.conf" \
                      "${destroot}${prefix}/etc/${name}/lighttpd.conf.default"
}

platform darwin 8 {
        configure.env CC=/usr/bin/gcc-4.0 CPP=/usr/bin/cpp-4.0 CXX=/usr/bin/g++-4.0
}

variant mysql {
   depends_lib-append    lib:libmysqlclient:mysql4
   configure.args-append --with-mysql=${prefix}/bin/mysql_config

   post-configure {
      reinplace "s|<mysql/mysql.h>|\"${prefix}/include/mysql/mysql.h\"|g" \
                "${worksrcpath}/src/mod_mysql_vhost.c"
   }
}

variant ssl {
   depends_lib-append   bin:openssl:openssl
   configure.args-append --with-openssl=${prefix}/include/openssl
}

variant cml {
   depends_lib-append   lib:liblua:lua \
                        lib:libmemcache:libmemcache \
                        bin:memcached:memcached \
                        bin:pkgconfig:pkgconfig
                        
   configure.args-append --with-lua \
                         --with-memcache
}

variant davprops {
   depends_lib-append   lib:libxml:libxml2 \
                        lib:libsqlite3:sqlite3 \
                        bin:pkgconfig:pkgconfig
                        
   configure.args-append --with-webdav-props
}

