# $Id: Portfile 86325 2011-10-24 14:11:11Z jmr@macports.org $

PortSystem                1.0
PortGroup                 perl5 1.0

perl5.setup               libapreq2 2.13 Apache2
revision                  2
license                   Apache-2
maintainers               nomaintainer
description               Methods for dealing with client request data
long_description          Apache::Request is a subclass of the Apache class, \
                          which adds methods for parsing GET requests and POST \
                          requests where Content-type is one of \
                          application/x-www-form-urlencoded or \
                          multipart/form-data.

platforms                 darwin

checksums                md5 c11fb0861aa84dcc6cd0f0798b045eee \
                         sha1 db3761625a62230147896b47e9b047660b20ba28 \
                         rmd160 8d7d2573624193b6dfbbe354b3771012257c1578

if {${perl5.major} != ""} {
depends_lib-append        port:apache2 \
                          port:mod_perl2 \
                          port:p${perl5.major}-extutils-xsbuilder

configure.args            --with-apache2-apxs=${prefix}/apache2/bin/apxs --with-mm-opts="${configure.args}"

destroot.pre_args         install

destroot.violate_mtree    yes

## stolen from perl5 group code
post-destroot         {
                          foreach packlist [exec find ${destroot} -name .packlist] {
                              ui_info "Fixing packlist ${packlist}"
                              reinplace "s|${destroot}||" ${packlist}
                          }
                          foreach badfile [exec find ${destroot} -name perllocal.pod] {
                              ui_info "Removing ${badfile}"
                              file delete ${badfile}
                          }
                      }

post-install          {
                          ui_msg "\nIf this your first install, you might want to"
                          ui_msg " * enable apreq in apache :\n"
                          ui_msg "${prefix}/apache2/bin/apxs -a -e -n \"apreq\" mod_apreq2.so\n"     
                          ui_msg " * And then relaunch apache \n"
                          ui_msg "${prefix}/apache2/bin/apachectl restart\n"
                      }
}
