# -*- 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 119325 2014-04-22 21:32:40Z 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         Net-HTTP 6.01
revision            2
platforms           darwin
maintainers         l2g openmaintainer
license             Artistic GPL
supported_archs     noarch

description         Low-level HTTP connection (client)

long_description    ${description}

checksums           rmd160  156670bd93ce465d7a9d2fcac685820e4708f252 \
                    sha256  76d883f9b249b16393dc183de04b4e4fed99bb0eb776ab9149d915607c69ea46

# This hack is needed because of the libwww-perl 6.0 breakup (Trac #28865)
pre-activate {
    if {[file exists ${perl5.lib}/Net/HTTP.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]
    }
}
