# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           perl5 1.0
PortGroup           github 1.0

github.setup        imapsync imapsync 1.945 imapsync-
categories          mail perl
platforms           darwin
maintainers         nomaintainer
license             Permissive
description         imapsync is an IMAP synchronization, copy or migration tool.
long_description    imapsync is an IMAP synchronization, copy or migration \
                    tool. Synchronize mailboxes between two imap servers. It is \
                    especially good at IMAP migration.

homepage            https://imapsync.lamiral.info/

checksums           rmd160  d7d84bc81fdd289daa3e6f464b9b5edeff58d1ca \
                    sha256  2feca4af4513d2fd6d654a9c24daf72f860443772a67c23139fc184580e8253b \
                    size    1708624

perl5.branches      5.26 5.28

perl5.require_variant   yes
perl5.conflict_variants yes
perl5.create_variants   ${perl5.branches}

depends_run         port:p${perl5.major}-crypt-openssl-rsa \
                    port:p${perl5.major}-data-uniqid \
                    port:p${perl5.major}-digest-md5 \
                    port:p${perl5.major}-digest-hmac \
                    port:p${perl5.major}-encode \
                    port:p${perl5.major}-file-copy-recursive \
                    port:p${perl5.major}-file-tail \
                    port:p${perl5.major}-html-parser \
                    port:p${perl5.major}-io-socket-inet6 \
                    port:p${perl5.major}-io-socket-ip \
                    port:p${perl5.major}-io-socket-ssl \
                    port:p${perl5.major}-io-tee \
                    port:p${perl5.major}-json \
                    port:p${perl5.major}-json-webtoken \
                    port:p${perl5.major}-json-xs \
                    port:p${perl5.major}-libwww-perl \
                    port:p${perl5.major}-mail-imapclient \
                    port:p${perl5.major}-net-ssleay \
                    port:p${perl5.major}-pod-escapes \
                    port:p${perl5.major}-pod-simple \
                    port:p${perl5.major}-podlators \
                    port:p${perl5.major}-readonly \
                    port:p${perl5.major}-regexp-common \
                    port:p${perl5.major}-sys-meminfo \
                    port:p${perl5.major}-term-readkey \
                    port:p${perl5.major}-text-parsewords \
                    port:p${perl5.major}-time-hires \
                    port:p${perl5.major}-unicode-string \
                    port:p${perl5.major}-uri

supported_archs     noarch

post-patch {
    reinplace -locale C "s|^#!.*|#!${perl5.bin}|g" ${worksrcpath}/imapsync
}

use_configure       no

build               {}

destroot {
    xinstall -m 755 ${worksrcpath}/imapsync ${destroot}${prefix}/bin/imapsync.pl
    ln -sf imapsync.pl ${destroot}${prefix}/bin/imapsync
    xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 644 -W ${worksrcpath} CREDITS ChangeLog FAQ LICENSE INSTALL README \
        TODO VERSION ${destroot}${prefix}/share/doc/${name}
}