Merge branch 'opendreambox-1.6' into vuplus-1.6
[vuplus_openembedded] / recipes / jakarta-commons / jakarta-commons.inc
1 LICENSE = "AL2.0"
2 AUTHOR = "Apache Software Foundation"
3
4 inherit java-library
5
6 DEPENDS = "fastjar-native"
7
8 S = "${WORKDIR}/${BP}-src"
9
10 # Directory in which the projects sources are located.
11 MAINSOURCES = "src/java"
12
13 # Directories which should appear in the -sourcepath argument.
14 COMPILE_SOURCEPATH = "src/java"
15
16 COMPILE_FINDARGS = "-name '*.java'"
17 FINDARGS = "-name '*.properties'"
18
19 # Directories to be removed after compilation.
20 CLEAN_PATH = ""
21
22 # Some projects have a replaceable version number in their manifest template.
23 do_unpackpost() {
24   if [ -d src/conf ]
25   then
26     find src/conf -exec \
27       sed -i -e "s|@version@|${PV}|" {} \;
28   fi
29 }
30
31 addtask unpackpost after do_unpack before do_patch
32 # Compile step is very similar for Jakarta commons packages
33 do_compile() {
34   mkdir -p build
35
36   if [ "${CP}" ]
37   then
38                 oe_makeclasspath cp -s ${CP}
39   else
40     cp=.
41   fi
42
43   echo "javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build \`find ${MAINSOURCES} ${COMPILE_FINDARGS}\`"
44   javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build `find ${MAINSOURCES} ${COMPILE_FINDARGS}`
45
46   # Copy extraneous files
47   echo "(cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;)"
48   (cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;)
49
50         # Optionally remove stuff after compilation (needed for sourcepath hacks).
51         if [ ${CLEAN_PATH} ]; then
52                 rm -rf ${CLEAN_PATH}
53         fi
54
55   # Some projects have manifest, some have not. This works for both.
56   if [ -f src/conf/MANIFEST.MF ]
57   then
58     fastjar -C build -c -m src/conf/MANIFEST.MF -f ${JARFILENAME} .
59   else
60     fastjar -C build -c -f ${JARFILENAME} .
61   fi
62 }