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

name                unp
version             2.0
revision            0

categories          archivers
license             GPL-2
maintainers         {i0ntempest @i0ntempest} openmaintainer

description         unpack (almost) everything with one command
long_description    ${description} - ${name} automatically finds the suitable utility on\
                    your system to unpack any archive given to it

homepage            https://salsa.debian.org/blade/${name}

master_sites        ${homepage}/-/archive/debian/${version}/
distname            ${name}-debian-${version}

checksums           rmd160  4865ad597693d27d85d6fa45f6c724bc4fb71783 \
                    sha256  b9e4dcb31af41a6773d036f110771868ee37c8e50aaae2dad898be4cde4fd8fe \
                    size    21217

set perl_version    5.34

depends_run-append  port:perl${perl_version}

post-patch {
    reinplace "s|#! /usr/bin/perl|#! ${prefix}/bin/perl${perl_version}|" ${worksrcpath}/${name} 
}

use_configure       no
build {}

destroot {
    xinstall -m 0755 ${worksrcpath}/${name} ${destroot}${prefix}/bin
    xinstall -m 0600 ${worksrcpath}/debian/${name}.1 ${destroot}${prefix}/share/man/man1
    ln -s ${name} ${destroot}${prefix}/bin/ucat
}

livecheck.url       ${homepage}/-/tags
livecheck.regex     {debian/(\d+(?:\.\d+)*)}
