# -*- 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 55743 2009-08-18 05:43:57Z jmr@macports.org $

PortSystem      1.0

name            perl5
version         5.8.9
categories      lang
platforms       darwin freebsd linux
maintainers     ricci mcalhoun
#description     Perl 5 - Practical Extraction and Report Language (maintenance release)

#long_description \
#    Perl is a general-purpose programming language originally developed \
#    for text manipulation and now used for a wide range of tasks including \
#    system administration, web development, network programming, GUI \
#    development, and more.

#distname        perl-${version}
#use_bzip2       yes
homepage        http://www.perl.org/
#master_sites    http://www.cpan.org/src/

#checksums        \
#    md5     1cb52a76ce77fa300218da96577793ec \
#    sha1    19843b5a7585cf35d96c07dbcd419bbdd5813617 \
#    rmd160  680004238d626ec985075e1b4519b7f0b34f57e5

#post-patch {
#    reinplace "s|/opt/local|${prefix}|g" ${worksrcpath}/Configure
#    # Ensure that the ld value set in configure.args is used
#    reinplace "s|ld='cc';||" ${worksrcpath}/hints/darwin.sh
#}

#configure.env       LC_ALL=C
#configure.cmd       /bin/sh Configure
#configure.pre_args
#configure.args \
#    -des \
#    -D prefix='${prefix}' \
#    -D cppflags="\${CPPFLAGS}" \
#    -D ldflags="\${LDFLAGS}" \
#    -D vendorprefix='${prefix}' \
#    -D man3ext='3pm' \
#    -D cc=\${CC} \
#    -D ld=\${CC}

#set exclude_libs {bind gdbm db}

#post-patch {
#    foreach lib ${exclude_libs} {
#        configure.args-append  -U i_${lib}
#        reinplace "s|\\(libswanted=.*\\)${lib} *\\(.*\\)|\\1\\2|" ${worksrcpath}/Configure
#    }
#}

universal_variant   no

#test.run            yes

#post-destroot {
#    ln -s perl${version} ${destroot}${prefix}/bin/$name
#}

#variant threads description {Build with thread support} {
#    configure.args-append   -Dusethreads
#}

#variant shared description {Build shared perl library} {
#    configure.args-append   -Duseshrplib
#}

#variant gdbm description {Build with gdbm support} {
#    depends_lib-append port:gdbm
#    set exclude_libs [ldelete ${exclude_libs} gdbm]
#}

#variant db description {Build with Berkeley Data Base support} {
#    depends_lib-append port:db47
#    set exclude_libs [ldelete ${exclude_libs} db]
    
#    post-patch {
#        reinplace "s|${prefix}/include|${prefix}/include ${prefix}/include/db47|g" ${worksrcpath}/Configure
#        reinplace "s|${prefix}/lib|${prefix}/lib ${prefix}/lib/db47|g" ${worksrcpath}/Configure
#    }
#}

#livecheck.check regex
#livecheck.url   http://www.cpan.org/src
#livecheck.regex {perl-(5\.8\.\d)\.}


#######################################################
fetch {}
checksum {}
extract {}
use_configure       no
build {}
description Placeholder port. See http://trac.macports.org/ticket/16830
long_description ${description}
destroot {
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    system "echo ${long_description} > ${destroot}${prefix}/share/doc/${name}/README.txt"
}
archive {}
livecheck.check     none
master_sites
depends_lib port:perl5.8

post-destroot {
    ln -s perl${version} ${destroot}${prefix}/bin/$name
}
#######################################################
