# -*- 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        neurobin shc 4.0.3
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0

categories          devel
license             GPL-3
maintainers         {khindenburg @kurthindenburg} openmaintainer

description         Shell Script Compiler
long_description    SHC is a generic shell script compiler. It takes a script,\
    which is specified on the command line and produces C source code. \
    The generated source code is then compiled and linked to produce a stripped\
    binary. The compiled binary will still be dependent on the shell specified \
    in the first line of the shell code (i.e shebang: #!/bin/sh or such), \
    thus shc does not create completely independent binaries. \
    shc itself is not a compiler such as cc, it rather encodes and encrypts \
    a shell script and generates C source code with the added expiration\
    capability. It then uses the system compiler to compile a stripped binary \
    which behaves exactly like the original script. Upon execution, the \
    compiled binary will decrypt and execute the code with the shells' -c \
    option.

checksums           rmd160  e9ec69646a07c68a50e9c25e0d7496cc2716238f \
                    sha256  a372b0c349f19cb5048499777fc8dd5c67a3c6b8a11da61225ad00bd7cbb6213 \
                    size    124300

patchfiles          patch-test.diff

test.run            yes
test.dir            ${worksrcpath}
test.cmd            ./test/ttest.sh
test.target
test.env-append     CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

# Do not grab alpha releases
livecheck.regex     (\[0-9\]+\\.\[0-9\]+\\.\[0-9\]+)${extract.suffix}
