# $Id: Portfile 91630 2012-04-07 01:53:46Z ryandesign@macports.org $

PortSystem                   1.0
PortGroup                    perl5 1.0

perl5.setup                  libwww-perl 6.03 LWP
revision                     1
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  95b17df5dcb97cb67775411574e4543aad43228a \
                             sha256  af11179badf55dc60cb83e81fac212a74bce959dc9d16d0acfc087493df996fe

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
