# $Id: Portfile 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem 1.0

name			mod_python25
version			3.3.1
revision		3
categories		www python
platforms		darwin
maintainers		mww jwa
description		Apache2 module that embeds Python within the server.
long_description	Mod_python is an Apache 2 module that embeds the \
    Python interpreter within the server. With mod_python \
    you can write web-based applications in Python that \
    will run many times faster than traditional CGI and \
    will have access to advanced features such as ability \
    to retain database connections and other data between \
    hits and access to Apache internals.

homepage		http://www.modpython.org/
master_sites	apache:httpd/modpython
distname	mod_python-${version}
extract.suffix	.tgz
checksums		sha1 e538170fd78e09408b6d8593da980b126a0fef93

depends_build	port:flex
depends_lib		port:apache2 port:python25

patchfiles	patch-dist-Makefile.in.diff \
		patch-src-connobject.c.diff \
		patch-configure.diff

configure.args	--with-apxs=${prefix}/apache2/bin/apxs \
    --with-python=${prefix}/bin/python2.5 \
    --with-flex=${prefix}/bin/flex \
    --enable-so

destroot.violate_mtree	yes

pre-destroot {
    xinstall -d -m 755 ${destroot}${prefix}/apache2/modules \
	${destroot}${prefix}/share/doc
    file copy ${worksrcpath}/doc-html ${destroot}${prefix}/share/doc/${name}
}

# Workaround for #17998
post-destroot {
    move ${destroot}${frameworks_dir}/Python.framework/Versions/2.5/lib/python2.5 \
        ${destroot}${prefix}/lib/python2.5
}

post-install {
    ui_msg "########################################################"
    ui_msg "# to enable mod_python add"
    ui_msg "#  LoadModule python_module modules/mod_python.so"
    ui_msg "# to your apache2 config file:"
    ui_msg "#  ${prefix}/apache2/conf/httpd.conf"
    ui_msg "########################################################"
}

livecheck.type	regex
livecheck.url	http://httpd.apache.org/modules/python-download.cgi
livecheck.regex	mod_python-(\[0-9\\.\]+)\\.tgz

