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

github.setup            cglib cglib 3_3_0 RELEASE_
github.tarball_from     archive
version                 [string map {_ .} ${version}]
epoch                   1

categories              java
license                 Apache-2
platforms               any
supported_archs         noarch
maintainers             nomaintainer

description             cglib - a code generation library for java byte code
long_description        cglib is a powerful, high performance and quality Code \
                        Generation Library.  It is used to extend Java classes \
                        and implement interfaces at runtime.

java.version            1.8
java.fallback           openjdk8

checksums               rmd160  0ab5243a6d8c88de01a80a89a4e515f52688dcb5 \
                        sha256  0c16a5d9d94e96690df19ec649a17b39eecfdb87504dcfc05a44bf5e910a6d1f \
                        size    151490

build.args-append       --define=maven.javadoc.skip

destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}
    set destjavadir ${destroot}${prefix}/share/java

    set modules {
        cglib
        cglib-nodep
        cglib-sample
    }

    xinstall -d ${destjavadir}
    foreach module ${modules} {
        xinstall -m 644 \
            ${worksrcpath}/${module}/target/${module}-${version}.jar \
            ${destjavadir}/${module}.jar
    }

    xinstall -d ${destdocdir}
    xinstall -m 644 \
        ${worksrcpath}/LICENSE \
        ${worksrcpath}/NOTICE \
        ${worksrcpath}/README.md \
        ${destdocdir}

    if {[variant_isset doc]} {
        xinstall -d ${destdocdir}/javadoc
        foreach module ${modules} {
            copy \
                ${worksrcpath}/${module}/target/apidocs \
                ${destdocdir}/javadoc/${module}
        }
    }
}

variant doc \
        description {Install javadoc} {
    build.args-delete   --define=maven.javadoc.skip
}
