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

github.setup    megastep makeself 2.5.0 release-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
categories      archivers
platforms       any
maintainers     nomaintainer
license         GPL-2+
supported_archs noarch

description     A small shell script that generates a self-extractable archives

long_description \
    makeself.sh is a small shell script that generates a \
    self-extractable tar.gz archive  from a directory. The \
    resulting file appears as a shell script (many of those have \
    a .run suffix), and can be launched as is. 

homepage        https://makeself.io

checksums       rmd160  82cf73eef117e5c14cc6f28fa305868b7c658970 \
                sha256  8af799c5637e30e5b4d0510506f2f664476e36c6b86708da2b999fe9b9ff9b2a \
                size    43995

patchfiles      header_location.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/makeself.sh
}

use_configure   no

build {}

destroot {
    xinstall -d ${destroot}${prefix}/libexec/makeself
    xinstall ${worksrcpath}/makeself-header.sh ${destroot}${prefix}/libexec/makeself
    xinstall ${worksrcpath}/makeself.sh ${destroot}${prefix}/bin/makeself

    xinstall ${worksrcpath}/makeself.1 ${destroot}${prefix}/share/man/man1

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} COPYING README.md ${destroot}${docdir}
}
