# -*- 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                mb2md
version             3.20
revision            7
categories          mail
license             public-domain
maintainers         nomaintainer
description         Script for converting Mbox mailboxes to Maildir format
long_description    Perl script that takes one or more Mbox format \
                    mailbox files in a directory and convert them to \
                    Maildir format mailboxes.  It also converts the \
                    mailspool file.  It is smart enough to not transfer \
                    a dummy message such as the UW IMAPD puts at the \
                    start of Mbox mailboxes - and you could add your own \
                    search terms into the script to make it ignore other \
                    forms of dummy first message.
homepage            http://batleth.sapienti-sat.org/projects/${name}
master_sites        ${homepage}
distfiles           ${name}-${version}.pl.gz

checksums           rmd160  03ee1e543ba070c222aa7e20624aaf5fa390785c \
                    sha256  af45a9b5413a9fe49be0092e560485bf17efc50a4eb4a90744e380c4869f732f 

supported_archs     noarch
platforms           any

perl5.branches      5.34

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

extract.mkdir       yes
extract.post_args   ">${name}-${version}.pl"

patchfiles          patch-${name}

use_configure       no

build {
    copy ${worksrcpath}/${name}-${version}.pl ${worksrcpath}/${name}
    reinplace "s|^#!.*perl|#!${perl5.bin}|" ${worksrcpath}/${name}
}

destroot {
    xinstall -d -m 0755 ${destroot}${prefix}/bin
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin
}
