# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem 1.0

name			mod_fastcgi
version			2.4.6
categories		www
maintainers		geeklair.net:dluke
description		An Apache module that implements the FastCGI protocol
long_description	FastCGI is a language independent, scalable, open \
			extension  to CGI that provides high performance \
			without the limitations of server specific APIs. \
			This is the Apache module.

homepage		http://www.fastcgi.com/
platforms		darwin
master_sites		${homepage}/dist/
checksums		md5 a21a613dd5dacf4c8ad88c8550294fed

depends_lib		port:apache2

destroot.violate_mtree	yes

configure {
	file copy ${worksrcpath}/Makefile.AP2 ${worksrcpath}/Makefile
	reinplace "s|/usr/local/apache2|${prefix}/apache2|g" \
		${worksrcpath}/Makefile
	reinplace "s|apachectl|${prefix}/apache2/bin/apachectl|g" \
		${worksrcpath}/Makefile
	reinplace "s|apxs|${prefix}/apache2/bin/apxs|g" ${worksrcpath}/Makefile
}

build.args		INCLUDES=-I${prefix}/apache2/include

destroot {
	xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name} \
		${destroot}${prefix}/apache2/modules
	xinstall -m 644 ${worksrcpath}/.libs/mod_fastcgi.so \
		${destroot}${prefix}/apache2/modules
	xinstall -m 644 -W ${worksrcpath}/docs LICENSE.TERMS mod_fastcgi.html \
		${destroot}${prefix}/share/doc/${name}
}

post-install {
	ui_msg	"=========="
	ui_msg	"To enable mod_fastcgi in Apache, add"
	ui_msg	"   LoadModule fastcgi_module modules/mod_fastcgi.so"
	ui_msg	"to ${prefix}/apache2/conf/httpd.conf"
	ui_msg	""
	ui_msg	"For further configuration information please visit"
	ui_msg	"   http://www.fastcgi.com/mod_fastcgi/docs/mod_fastcgi.html"
	ui_msg	"=========="
}
