#  -*- 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           github 1.0
PortGroup           perl5 1.0

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}

github.setup        rodnaph ghsum 0.1.1
revision            1
categories          devel shells macports
maintainers         nomaintainer
license             MIT
supported_archs     noarch
platforms           any

description         Helper to checksum GitHub tags

long_description    ghsum allows you to easily print MacPorts checksums for tagged \
                    versions of your project on GitHub (or branches as well). This \
                    can be useful for updating Portfiles.

depends_lib         port:wget \
                    path:lib/libssl.dylib:openssl \
                    port:p${perl5.major}-getopt-long-descriptive

github.tarball_from archive

checksums           rmd160  6ca37150d562e3bf8b905125bb93d4bcfc57f86b \
                    sha256  49a21fc50f7b7a409c7da13aeefd5103f36a841049336b861f4b0772b49c5ec0 \
                    size    1798

use_configure       no

post-patch {
    reinplace       "s&#!/usr/bin/env perl&#!${perl5.bin}&" ${worksrcpath}/ghsum
}

build               {}

destroot {
    xinstall -m 0755 ${worksrcpath}/ghsum \
        ${destroot}${prefix}/bin/ghsum
    xinstall -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 ${worksrcpath}/README.md \
        ${destroot}${prefix}/share/doc/${name}
}
