# -*- 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

PortSystem          1.0
PortGroup           perl5 1.0

name                perfect_maildir
version             0.3
revision            5
categories          mail
platforms           darwin
supported_archs     noarch
license             GPL-2+
maintainers         nomaintainer
description         Simple but Perfect mbox to Maildir converter
long_description    ${description} by Philip Mak.

homepage            http://perfectmaildir.home-dn.net/
master_sites        ${homepage}/${name}/
checksums           rmd160  f076ea65732d1c49996f68c19956aa33b2eaaed3 \
                    sha256  e053602aacffee6f871d0610c0b6329bb8af6c915e4a6d80fde880b052ee7109

distfiles           ${name}.pl

perl5.branches      5.26

depends_run         port:perl${perl5.major} \
                    port:p${perl5.major}-timedate

extract.mkdir       yes
extract {
    file copy ${distpath}/${distfiles} ${worksrcpath}
}

patch {
    reinplace "s|/usr/bin/perl|${perl5.bin}|g" ${worksrcpath}/${name}.pl
}

use_configure       no

build {}

destroot {
    xinstall ${worksrcpath}/${name}.pl ${destroot}${prefix}/bin/${name}
}

livecheck.type      regex
livecheck.url       ${master_sites}CHANGES
livecheck.regex     {v(\d+(?:\.\d+)*)}