# $Id: Portfile 80784 2011-07-17 13:51:24Z jmr@macports.org $

PortSystem                   1.0
PortGroup                    perl5 1.0

perl5.setup                  libwww-perl 6.02 LWP
maintainers                  narf_tm openmaintainer
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                    sha1    211393d014a9c991e572138aaaf367d10ea7103e \
                             rmd160  741b292c6adbe70b6b33827606b8df0786a09922

platforms                    darwin

depends_lib-append           port:p5-encode-locale \
                             port:p5-file-listing \
                             port:p5-html-form \
                             port:p5-html-parser \
                             port:p5-http-cookies \
                             port:p5-http-daemon \
                             port:p5-http-date \
                             port:p5-http-message \
                             port:p5-http-negotiate \
                             port:p5-lwp-mediatypes \
                             port:p5-net-http \
                             port:p5-uri \
                             port:p5-www-robotrules

use_parallel_build           yes

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

notes \
    "As of version 6.00, libwww-perl has been broken up into multiple" \
    "packages.  If you were using ${name} 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/${name}/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

default_variants   +ssl

variant ssl description {Include optional SSL/TLS (HTTPS) support} {
    depends_lib-append  port:p5-lwp-protocol-https
}
