aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/jakarta-commons/jakarta-commons.inc
diff options
context:
space:
mode:
authorHenning Heinold <h.heinold@tarent.de>2010-07-12 15:29:01 +0200
committerHenning Heinold <h.heinold@tarent.de>2010-07-26 15:34:21 +0200
commitd55efd6bfb7f3b51569e15acf0727a32224f1b63 (patch)
treeceac82a8140c3509a172efc1c5d0365678c1dd5a /recipes/jakarta-commons/jakarta-commons.inc
parent7dce72886aadbaeb1c68eb5a52f6c5763bddff16 (diff)
downloadopenembedded-d55efd6bfb7f3b51569e15acf0727a32224f1b63.tar.gz
openembedded-d55efd6bfb7f3b51569e15acf0727a32224f1b63.tar.bz2
openembedded-d55efd6bfb7f3b51569e15acf0727a32224f1b63.zip
jakarta-commons: backport from openembedded-dev
* checksums already in conf/checksums.ini Acked-by: Koen Kooi <koen@openembedded.org> Acked-by: Marcin Juszkiewicz <marcin@juszkiewicz.com.pl>
Diffstat (limited to 'recipes/jakarta-commons/jakarta-commons.inc')
-rw-r--r--recipes/jakarta-commons/jakarta-commons.inc62
1 files changed, 62 insertions, 0 deletions
diff --git a/recipes/jakarta-commons/jakarta-commons.inc b/recipes/jakarta-commons/jakarta-commons.inc
new file mode 100644
index 0000000000..48cbe170c2
--- /dev/null
+++ b/recipes/jakarta-commons/jakarta-commons.inc
@@ -0,0 +1,62 @@
+LICENSE = "AL2.0"
+AUTHOR = "Apache Software Foundation"
+
+inherit java-library
+
+DEPENDS = "fastjar-native"
+
+S = "${WORKDIR}/${BP}-src"
+
+# Directory in which the projects sources are located.
+MAINSOURCES = "src/java"
+
+# Directories which should appear in the -sourcepath argument.
+COMPILE_SOURCEPATH = "src/java"
+
+COMPILE_FINDARGS = "-name '*.java'"
+FINDARGS = "-name '*.properties'"
+
+# Directories to be removed after compilation.
+CLEAN_PATH = ""
+
+# Some projects have a replaceable version number in their manifest template.
+do_unpackpost() {
+ if [ -d src/conf ]
+ then
+ find src/conf -exec \
+ sed -i -e "s|@version@|${PV}|" {} \;
+ fi
+}
+
+addtask unpackpost after do_unpack before do_patch
+# Compile step is very similar for Jakarta commons packages
+do_compile() {
+ mkdir -p build
+
+ if [ "${CP}" ]
+ then
+ oe_makeclasspath cp -s ${CP}
+ else
+ cp=.
+ fi
+
+ echo "javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build \`find ${MAINSOURCES} ${COMPILE_FINDARGS}\`"
+ javac -sourcepath ${COMPILE_SOURCEPATH} -cp $cp -d build `find ${MAINSOURCES} ${COMPILE_FINDARGS}`
+
+ # Copy extraneous files
+ echo "(cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;)"
+ (cd ${MAINSOURCES} && find . ${FINDARGS} -exec cp {} ../../build/{} \;)
+
+ # Optionally remove stuff after compilation (needed for sourcepath hacks).
+ if [ ${CLEAN_PATH} ]; then
+ rm -rf ${CLEAN_PATH}
+ fi
+
+ # Some projects have manifest, some have not. This works for both.
+ if [ -f src/conf/MANIFEST.MF ]
+ then
+ fastjar -C build -c -m src/conf/MANIFEST.MF -f ${JARFILENAME} .
+ else
+ fastjar -C build -c -f ${JARFILENAME} .
+ fi
+}