# $Id: Portfile 82547 2011-08-15 16:46:16Z jmr@macports.org $

PortSystem        1.0
PortGroup         perl5 1.0

perl5.setup       Net-LibIDN 0.12
revision          2
license           {Artistic GPL}
maintainers       oaf.dk:mni
description       Perl bindings for GNU Libidn
long_description  Net::LibIDN is bindings for GNU Libidn, which is an \
                  implementation of the Stringprep, Punycode and IDNA \
                  specifications defined by the IETF Internationalized \
                  Domain Names (IDN) working group.
checksums         md5     c3e4de2065009d67bcb1df0afb473e12 \
                  sha1    ac446edf66ac523d5463b59ed9698e2ccb9b04ab \
                  rmd160  a595c3758c9577b6d09d856cf220c303fdc3d2a2
platforms         darwin

if {${perl5.major} != ""} {
depends_lib-append      port:libidn

patchfiles-append       patch-Makefile.PL.diff

post-patch {
    if {[variant_isset universal]} {
        set archflags ${configure.universal_cflags}
    } else {
        set archflags ${configure.cc_archflags}
    }
    
    reinplace "s|@CC@|${configure.cc} ${archflags}|g" ${worksrcpath}/Makefile.PL
}

configure.args-append   --with-libidn=${prefix}/lib \
                        --with-libidn-inc=${prefix}/include
}
