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

name                ftpsync
version             1.3.06
revision            0
categories          net
license             GPL-2+
maintainers         nomaintainer
description         Synchronizes a local and a remote ftp directory tree
long_description    ${description}

homepage            https://confluence.clazzes.org/display/FTPSYNC
master_sites        https://download.clazzes.org/ftpsync/

checksums           rmd160  0c7491b470aba408614ba3a2c43e2e79b0f17502 \
                    sha256  c301f4c848144550d2133af1d45c8ab5708f847baa3c5bdff48afa5d507efbaa \
                    size    17493

distname            ${name}-${version}-0
supported_archs     noarch
platforms           any

perl5.require_variant   yes
perl5.conflict_variants yes
perl5.branches          5.28 5.30 5.32 5.34
perl5.default_branch    5.34
perl5.create_variants   ${perl5.branches}

# File-Listing distributed separately from libwww-perl since 2011-02-25
depends_run         port:p${perl5.major}-net \
                    port:p${perl5.major}-file-listing

use_bzip2           yes

configure {
    reinplace "s|/usr/bin/perl|${perl5.bin}|1" ${worksrcpath}/ftpsync.pl
}

build {}

destroot {
    xinstall -m 755 ${worksrcpath}/ftpsync.pl ${destroot}${prefix}/bin
    ln -s ftpsync.pl ${destroot}${prefix}/bin/ftpsync
    xinstall -d -m 755 ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0444 -W ${worksrcpath} License.txt ReadMe.txt ToDo.txt changelog \
        ${destroot}${prefix}/share/doc/${name}
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     ${name}-(\[0-9.\]+)
