# -*- 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
# $Id: Portfile 71090 2010-09-01 06:47:44Z ryandesign@macports.org $

PortSystem          1.0

name                spawn-fcgi
version             1.6.3
categories          www
platforms           darwin
maintainers         ryandesign openmaintainer
license             BSD
homepage            http://www.lighttpd.net/
master_sites        ${homepage}download/

description         Program to spawn fast-cgi processes

long_description    ${description}

checksums           md5     6d75f9e9435056fa1e574d836d823cd0 \
                    sha1    2b97ea57d9d79745fe8d6051d830fa507b421169 \
                    rmd160  4c09fb3d8b03e17b491c733469570d538d3ff5ce

use_parallel_build  yes

pre-configure {
    # As of version 1.4.23, the lighttpd port depends on the spawn-fcgi port,
    # but lighttpd 1.4.22 and earlier provided the same files spawn-fcgi now
    # installs. If lighttpd 1.4.22 or earlier is installed and the user \
    # upgrades to 1.4.23, spawn-fcgi will be installed first, which would cause
    # a conflict on these files at activation time. Therefore tell the user to
    # first deactivate their old lighttpd.
    # Note: lighttpd.1 is only installed by lighttpd 1.4.22 and earlier. In
    # lighttpd 1.4.23 the manpage was moved to lighttpd.8.
    if {[file exists ${prefix}/share/man/man1/lighttpd.1.gz]} {
        return -code error "Please deactivate your currently-installed lighttpd port, then try again"
    }
}

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        NEWS \
        README \
        ${docdir}
}
