# -*- 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 119332 2014-04-22 22:12:59Z 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         libwww-perl 6.06 LWP
maintainers         nomaintainer
license             {Artistic GPL}
supported_archs     noarch

description         The World-Wide Web library for Perl
long_description    The libwww-perl collection is a set of Perl \
                    modules which provides a simple and consistent \
                    application programming interface to the \
                    World-Wide Web.  The main focus of the library \
                    is to provide classes and functions that allow \
                    you to write WWW clients. The library also \
                    contain modules that are of more general use \
                    and even classes that help you implement \
                    simple HTTP servers.

checksums           rmd160  5843faeda6aac23fd8eae8244f4cd1245a8c110e \
                    sha256  55d0417d0b52fef4d238bfacdce0440e69cd3b0ee15b1554251f32fffd532ed2

platforms           darwin

if {${perl5.major} != ""} {
depends_lib-append  port:p${perl5.major}-encode-locale \
                    port:p${perl5.major}-file-listing \
                    port:p${perl5.major}-html-form \
                    port:p${perl5.major}-html-parser \
                    port:p${perl5.major}-http-cookies \
                    port:p${perl5.major}-http-daemon \
                    port:p${perl5.major}-http-date \
                    port:p${perl5.major}-http-message \
                    port:p${perl5.major}-http-negotiate \
                    port:p${perl5.major}-lwp-mediatypes \
                    port:p${perl5.major}-net-http \
                    port:p${perl5.major}-uri \
                    port:p${perl5.major}-www-robotrules

use_parallel_build  yes

post-destroot {
    # Install miscellaneous doc files
    file mkdir ${destroot}${prefix}/share/doc/${subport}
    file copy ${worksrcpath}/AUTHORS \
              ${worksrcpath}/Changes \
              ${worksrcpath}/README \
              ${worksrcpath}/README.SSL \
        ${destroot}${prefix}/share/doc/${subport}
}

variant ssl description {Include optional SSL/TLS (HTTPS) support} {
    depends_lib-append  port:p${perl5.major}-lwp-protocol-https
}

default_variants    +ssl
}

notes "
As of version 6.00, libwww-perl has been broken up into multiple packages. If\
you were using ${subport} for just one or two of its modules before, you may\
be able to pare down your installation to just those modules now. Other\
important changes have been made that may affect your code\; for details,\
please see: ${prefix}/share/doc/${subport}/Changes
"

# Starting with version 6.02, LWP::Protocol::https began to be packaged
# separately from libwww-perl as well.  The thinking seems to have been that
# any package requiring HTTPS support would just declare an extra dependency
# on LWP::Protocol::https, and those that didn't, wouldn't.
#
# However, at this writing, there are 59 ports in MacPorts that depend on
# p5-libwww-perl, and I don't want to audit them all for their HTTPS
# requirements.  So in keeping with the Principle of Least Astonishment while
# recognizing that some people won't need or want the extra modules installed,
# I've decided to add a new variant and have it enabled by default.
#     --Larry Gilbert (L2G) 2011-06-02
