# $Id$ PNAME="junit" PVER="4.12" PBUILD="r4" PCAT="dev-java" # loop-deps junit needs junit to build # on version change first build junit from a precompiled binary and then rev bump to rebuild from source # 0=disables, 1=enable USE_PRECOMPILED_JUNIT_BINARY=1 DESCRIPTION="JUnit is a simple framework to write repeatable tests." HOMEPAGE="http://junit.org/" DEPEND=">= virtual/java >= dev-java/hamcrest-1.3" sminclude java case ${USE_PRECOMPILED_JUNIT_BINARY} in 0) # commit id COID="e87c6fc" # unusual but it is so SRCFILE="r${PVER}" SRCDIR="${BUILDDIR}/junit-team-${PNAME}-${COID}" SRC_URI=( http://github.com/junit-team/junit/tarball/r${PVER} ) # requires maven! - fixme SDEPEND=">= virtual/java-jdk >= dev-java/apache-ant-1.9 >= app-arch/unzip-5" ;; 1) SRCFILE="${PNAME}-${PVER}.jar" SRCDIR="${BUILDDIR}/$-${PNAME}-${PVER}" SRC_URI=( http://search.maven.org/remotecontent?filepath=${PNAME}/${PNAME}/${PVER}/${SRCFILE} ) ;; esac SRC_URI+=( mirror://${PNAME}/${SRCFILE} ) UP2EXCLUDE="beta" UP2SEPERATOR="r" UP2DATE="updatecmd https://github.com/junit-team/${PNAME}/releases | highesttarball zip" src_prepare() { case ${USE_PRECOMPILED_JUNIT_BINARY} in 0) # munpack needs a suffix tar xvf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${BUILDDIR} || die ;; 1) install -d ${SRCDIR} # minstalljar adds pver automatically - so we rename the jars cp ${SOURCEDIR}/${PNAME}/${SRCFILE} ${SRCDIR}/junit.jar || die ;; esac } if [[ ${USE_PRECOMPILED_JUNIT_BINARY} = 0 ]] then src_compile() { cd ${SRCDIR} local myopts # requires 1.5 source definitions myopts+=" -Dant.build.javac.source=1.5" ant ${myopts} jars || die # fix missing Manifest echo 'Class-Path: hamcrest-core.jar' > ${SRCDIR}/Manifest.txt || die jar ufm junit${PVER}-SNAPSHOT/junit-dep-${PVER}-SNAPSHOT.jar ${SRCDIR}/Manifest.txt || die } src_check() { cd ${SRCDIR} ant test || die } fi src_install() { cd ${SRCDIR} case ${USE_PRECOMPILED_JUNIT_BINARY} in 0) # minstalljar adds pver automatically - so we rename the jars cp junit${PVER}-SNAPSHOT/junit-${PVER}-SNAPSHOT.jar junit.jar || die cp junit${PVER}-SNAPSHOT/junit-dep-${PVER}-SNAPSHOT.jar junit-dep.jar || die minstalljar junit.jar || die minstalljar junit-dep.jar || die minstalldocs README.html cpl-v10.html doc/ReleaseNotes${PVER}.txt *.txt || die ;; 1) cd ${SRCDIR} minstalljar junit.jar || die ;; esac }