# -*- 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 119319 2014-04-22 21:20:09Z mojca@macports.org $

PortSystem          1.0
PortGroup           perl5 1.0

perl5.branches      5.8 5.10 5.12 5.14 5.16 5.18
perl5.setup         HTTP-Message 6.06
platforms           darwin
maintainers         l2g openmaintainer
license             {Artistic GPL}
supported_archs     noarch

description         HTTP::Message - Representation of HTTP messages

long_description \
    The HTTP-Message distribution contains classes useful for representing \
    the messages passed in HTTP style communication.  These are classes \
    representing requests, responses and the headers contained within them.

checksums           rmd160  439c9a1c4aeb9bdbcda398b35f66bfa8efa166ab \
                    sha256  087e97009c5239dca4631cf433d836771b3fc5ba5685eef1965f9d3415cbad63

if {${perl5.major} != ""} {
depends_lib-append  port:p${perl5.major}-encode-locale \
                    port:p${perl5.major}-html-parser \
                    port:p${perl5.major}-http-date \
                    port:p${perl5.major}-lwp-mediatypes \
                    port:p${perl5.major}-uri
}
# This hack is needed because of the libwww-perl 6.0 breakup (Trac #28865)
pre-activate {
    if {[file exists ${perl5.lib}/HTTP/Message.pm]
      && ![catch {set vers [lindex [registry_active p5-libwww-perl] 0]}]
      && [vercmp [lindex $vers 1] 6.0] < 0} {
        ui_warn "Deactivating old, pre-6.x libwww-perl to activate ${name}"
        registry_deactivate_composite p5-libwww-perl "" [list ports_nodepcheck 1]
    }
}
