# $Id$

PortSystem          1.0

name                mod_fcgid
version             2.3.7
categories          www
license             Apache-2
platforms           darwin
maintainers         pixilla openmaintainer

description         An alternative FastCGI module for Apache2
long_description    ${description}

homepage            http://httpd.apache.org/mod_fcgid/
master_sites        apache:httpd/${name}

use_bzip2           yes

checksums           rmd160  6c917383374da6629f4857f3c922844acabbc47a \
                    sha256  4fcfadd2804734cc7a266d8c6044b34a21d5a4a1e2e0c1a882fc59a3e012eb80

depends_lib         port:apache2

patch.pre_args      -p1
patchfiles          patch-modules-fcgid-fcgid_conf.c.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" \
        ${worksrcpath}/modules/fcgid/fcgid_conf.c
    reinplace "s|@NAME@|${name}|g" \
        ${worksrcpath}/modules/fcgid/fcgid_conf.c
}

configure.env       APXS=${prefix}/apache2/bin/apxs
configure.cmd       ./configure.apxs
configure.pre_args  

destroot.violate_mtree   yes
destroot.keepdirs   ${destroot}${prefix}/var/run/${name}
post-destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} \
        CHANGES-FCGID LICENSE-FCGID NOTICE-FCGID README-FCGID STATUS-FCGID \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 755 -d ${destroot}${prefix}/apache2/conf/extra
    xinstall -m 644 ${filespath}/httpd-fcgid.conf \
        ${destroot}${prefix}/apache2/conf/extra/
}

notes "
==========
This port installs a configuration file to enable mod_fcgid in Apache.
After install add these lines to the end of ${prefix}/apache2/conf/httpd.conf to enable mod_fcgid.
    # Include module mod_fcgid
    Include conf/extra/httpd-fcgid.conf

You should then restart apache2 to load the module.
    $ sudo port unload apache2
    $ sudo port load apache2

For further configuration information please visit
    http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html

When upgrading from version 2.2, please see the above URL
    about deprecated config options!
=========="

livecheck.url       http://httpd.apache.org/download.cgi
livecheck.type      regex
livecheck.regex     "(?!${name}).*${name}-((?!${extract.suffix}).*)${extract.suffix}"