# -*- 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    Guardsquare proguard 7.4.1 v
revision        0

categories      java
platforms       darwin
license         GPL-2
maintainers     nomaintainer

description     Java bytecode shrinker, optimizer, and obfuscator.
long_description \
    ProGuard is a free Java class file shrinker, optimizer, \
    obfuscator, and preverifier.  It detects and removes unused \
    classes, fields, methods, and attributes.  It optimizes bytecode \
    and removes unused instructions.  It renames the remaining \
    classes, fields, and methods using short meaningless names. \
    Finally, it preverifies the processed code for Java 6 or for Java \
    Micro Edition.

homepage        https://www.guardsquare.com/en/products/proguard

github.tarball_from \
                releases

checksums       rmd160  adf7c7295a04bddf8e79f066381165d8755f7055 \
                sha256  d3a83be58eb2a4a9baf8c462d8c2774a9b473a4afc66c3aa0da83811ef5db889 \
                size    32076938

depends_lib     bin:java:kaffe

use_configure   no

build {}

destroot {
    set javadir ${destroot}${prefix}/share/java
    set docdir ${destroot}${prefix}/share/doc/${name}

    xinstall -d -m 0755 ${javadir}
    xinstall -d -m 0755 ${docdir}

    foreach f [glob -directory ${worksrcpath}/lib *.jar] {
        file copy ${f} ${javadir}/
    }
    foreach f [glob -directory ${worksrcpath}/docs *] {
        file copy ${f} ${docdir}/
    }
    foreach f {LICENSE examples} {
        file copy ${worksrcpath}/${f} ${docdir}/
    }
}

livecheck.regex ${name}(\\d+(?:\\.\\d+))${extract.suffix}
