# -*- 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 129939 2014-12-23 17:57:16Z mojca@macports.org $

PortSystem          1.0
PortGroup           perl5 1.0

perl5.branches      5.10 5.12 5.14 5.16 5.18 5.20
perl5.setup         LWP-Protocol-http10 6.03
platforms           darwin
maintainers         nomaintainer
license             {Artistic-1 GPL}
supported_archs     noarch

description         Deprecated support for HTTP/1.0 in libwww-perl

long_description    ${description}

checksums           rmd160  aa3dfdb5bcc9473636506e4447444233d6d63572 \
                    sha256  f3ffa911f9d59181f1717910ea26620905c298b74dc30f7d4e5139ee3020b8d3

if {${perl5.major} != ""} {
    depends_lib-append \
                    port:p${perl5.major}-libwww-perl
}
# This hack is needed because of the libwww-perl 6.0 breakup (Trac #28865)
pre-activate {
    if {[file exists ${perl5.lib}/LWP/Protocol/http10.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]
    }
}
