Magellan Linux

Annotation of /branches/R11-unstable/extras/junit/junit-4.12-r4.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 32706 - (hide annotations) (download)
Mon Apr 29 13:28:57 2019 UTC (5 years, 1 month ago) by niro
File size: 2454 byte(s)
-release branches/R11-unstable
1 niro 29435 # $Id$
2    
3     PNAME="junit"
4     PVER="4.12"
5     PBUILD="r4"
6    
7     PCAT="dev-java"
8    
9     # loop-deps junit needs junit to build
10     # on version change first build junit from a precompiled binary and then rev bump to rebuild from source
11     # 0=disables, 1=enable
12     USE_PRECOMPILED_JUNIT_BINARY=1
13    
14     DESCRIPTION="JUnit is a simple framework to write repeatable tests."
15     HOMEPAGE="http://junit.org/"
16    
17     DEPEND=">= virtual/java
18     >= dev-java/hamcrest-1.3"
19    
20     sminclude java
21    
22     case ${USE_PRECOMPILED_JUNIT_BINARY} in
23     0)
24     # commit id
25     COID="e87c6fc"
26     # unusual but it is so
27     SRCFILE="r${PVER}"
28     SRCDIR="${BUILDDIR}/junit-team-${PNAME}-${COID}"
29     SRC_URI=( http://github.com/junit-team/junit/tarball/r${PVER} )
30    
31     # requires maven! - fixme
32     SDEPEND=">= virtual/java-jdk
33     >= dev-java/apache-ant-1.9
34     >= app-arch/unzip-5"
35     ;;
36     1)
37     SRCFILE="${PNAME}-${PVER}.jar"
38     SRCDIR="${BUILDDIR}/$-${PNAME}-${PVER}"
39     SRC_URI=( http://search.maven.org/remotecontent?filepath=${PNAME}/${PNAME}/${PVER}/${SRCFILE} )
40     ;;
41     esac
42    
43     SRC_URI+=( mirror://${PNAME}/${SRCFILE} )
44    
45     UP2EXCLUDE="beta"
46     UP2SEPERATOR="r"
47     UP2DATE="updatecmd https://github.com/junit-team/${PNAME}/releases | highesttarball zip"
48    
49     src_prepare()
50     {
51     case ${USE_PRECOMPILED_JUNIT_BINARY} in
52     0)
53     # munpack needs a suffix
54     tar xvf ${SOURCEDIR}/${PNAME}/${SRCFILE} -C ${BUILDDIR} || die
55     ;;
56     1)
57     install -d ${SRCDIR}
58     # minstalljar adds pver automatically - so we rename the jars
59     cp ${SOURCEDIR}/${PNAME}/${SRCFILE} ${SRCDIR}/junit.jar || die
60     ;;
61     esac
62     }
63    
64     if [[ ${USE_PRECOMPILED_JUNIT_BINARY} = 0 ]]
65     then
66     src_compile()
67     {
68     cd ${SRCDIR}
69     local myopts
70    
71     # requires 1.5 source definitions
72     myopts+=" -Dant.build.javac.source=1.5"
73    
74     ant ${myopts} jars || die
75    
76     # fix missing Manifest
77     echo 'Class-Path: hamcrest-core.jar' > ${SRCDIR}/Manifest.txt || die
78     jar ufm junit${PVER}-SNAPSHOT/junit-dep-${PVER}-SNAPSHOT.jar ${SRCDIR}/Manifest.txt || die
79     }
80    
81     src_check()
82     {
83     cd ${SRCDIR}
84     ant test || die
85     }
86     fi
87    
88     src_install()
89     {
90     cd ${SRCDIR}
91    
92     case ${USE_PRECOMPILED_JUNIT_BINARY} in
93     0)
94     # minstalljar adds pver automatically - so we rename the jars
95     cp junit${PVER}-SNAPSHOT/junit-${PVER}-SNAPSHOT.jar junit.jar || die
96     cp junit${PVER}-SNAPSHOT/junit-dep-${PVER}-SNAPSHOT.jar junit-dep.jar || die
97    
98     minstalljar junit.jar || die
99     minstalljar junit-dep.jar || die
100     minstalldocs README.html cpl-v10.html doc/ReleaseNotes${PVER}.txt *.txt || die
101     ;;
102     1)
103     cd ${SRCDIR}
104     minstalljar junit.jar || die
105     ;;
106     esac
107     }