diff options
author | Florian Boor <florian.boor@kernelconcepts.de> | 2008-01-21 21:09:09 +0000 |
---|---|---|
committer | Florian Boor <florian.boor@kernelconcepts.de> | 2008-01-21 21:09:09 +0000 |
commit | afd58cdcce656ced784bfca78d7d96e2edca8cee (patch) | |
tree | b49291fedc042760b35f74afa9b7e82b591147e5 /classes/java-library.bbclass | |
parent | ac6de0f3c0d8d5fe5708d9125c1319fbf5d627a6 (diff) | |
parent | a7a4c7d6f9bbcda53d3bf07d51142d41e1a4558b (diff) |
merge of '1cc9d40e03f431fac4150580f6a58521cae55509'
and 'a250ef0b1707ead866fe051ca88c56e538d51bfb'
Diffstat (limited to 'classes/java-library.bbclass')
-rw-r--r-- | classes/java-library.bbclass | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass new file mode 100644 index 0000000000..8aecfef1b9 --- /dev/null +++ b/classes/java-library.bbclass @@ -0,0 +1,37 @@ +# Inherit this bbclass for each java recipe that builds a Java library (jar file[s]). +# +# It automatically adds important build dependencies, defines JPN (Java Package Name) +# a package named ${JPN} whose contents are those of ${datadir}/java (the jar location). +# +# The JPN is basically lib${PN}-java but takes care of the fact that ${PN} already +# starts with "lib" and/or ends with "-java". In case the "lib" prefix is part of +# your package's normal name (e.g. liberator) the guessing is wrong and you have +# to set JPN manually! + +inherit java + +def java_package_name(d): + import bb; + + pre="" + post="" + + pn = bb.data.getVar('PN', d, 1) + if not pn.startswith("lib"): + pre='lib' + + if not pn.endswith("-java"): + post='-java' + + return pre + pn + post + +JPN ?= "${@java_package_name(d)}" + +DEPENDS_prepend = "virtual/javac-native fastjar-native " + +PACKAGES = "${JPN}" + +PACKAGE_ARCH_${JPN} = "all" + +FILES_${JPN} = "${datadir_java}" + |