# -*- 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 119336 2014-04-22 23:30:55Z 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         LWP-Protocol-https 6.02
revision            2
platforms           darwin
maintainers         l2g openmaintainer
license             {Artistic GPL}
supported_archs     noarch

description         LWP::Protocol::https - SSL support for libwww-perl

long_description \
    The LWP::Protocol::https module used to be bundled with p5-libwww-perl, \
    but it was unbundled in v6.02 so that dependencies could be declared \
    properly.  Ports that need https support can just declare their \
    dependency on ${name} and will no longer need to know what \
    underlying modules to install.

checksums           rmd160  a4ee19e141a4da9dc0d6a415573204c80a330569 \
                    sha256  c50388fde02a4c3eb98f9cfb74fa4422a6136a4244ccafb54355927736b14a78

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