summaryrefslogtreecommitdiffstats
path: root/classes/java-library.bbclass
diff options
context:
space:
mode:
authorHenning Heinold <heinold@inf.fu-berlin.de>2011-11-12 20:58:34 +0100
committerHenning Heinold <heinold@inf.fu-berlin.de>2011-11-26 23:41:44 +0100
commit57e069cde6617f00ca8834a82c6f360af43d5067 (patch)
tree48cbe15e96d217c45acfa64b0c13aad8c6424980 /classes/java-library.bbclass
downloadmeta-java-57e069cde6617f00ca8834a82c6f360af43d5067.tar.gz
meta-java: initial commit
* taken over mostly stuff from oe classic * cleaned up recipes * added license checksums * bump icedtea6-native to 1.8.11 * use jamvm from git as native
Diffstat (limited to 'classes/java-library.bbclass')
-rw-r--r--classes/java-library.bbclass58
1 files changed, 58 insertions, 0 deletions
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass
new file mode 100644
index 0000000..4396bb3
--- /dev/null
+++ b/classes/java-library.bbclass
@@ -0,0 +1,58 @@
1# Inherit this bbclass for each java recipe that builds a Java library (jar file[s]).
2#
3# It automatically adds important build dependencies, defines JPN (Java Package Name)
4# a package named ${JPN} whose contents are those of ${datadir}/java (the jar location).
5#
6# The JPN is basically lib${PN}-java but takes care of the fact that ${PN} already
7# starts with "lib" and/or ends with "-java". In case the "lib" prefix is part of
8# your package's normal name (e.g. liberator) the guessing is wrong and you have
9# to set JPN manually!
10
11inherit java
12
13# use java_stage for native packages
14JAVA_NATIVE_STAGE_INSTALL = "1"
15
16def java_package_name(d):
17 import bb;
18
19 pre=""
20 post=""
21
22 pn = bb.data.getVar('PN', d, 1)
23 if not pn.startswith("lib"):
24 pre='lib'
25
26 if not pn.endswith("-java"):
27 post='-java'
28
29 return pre + pn + post
30
31JPN ?= "${@java_package_name(d)}"
32
33DEPENDS_prepend = "virtual/javac-native fastjar-native "
34
35PACKAGES = "${JPN}"
36
37PACKAGE_ARCH_${JPN} = "all"
38
39FILES_${JPN} = "${datadir_java}"
40
41# File name of the libraries' main Jar file
42JARFILENAME = "${BP}.jar"
43
44# Space-separated list of alternative file names.
45ALTJARFILENAMES = "${BPN}.jar"
46
47# Java "source" distributions often contain precompiled things
48# we want to delete first.
49do_removebinaries() {
50 find ${WORKDIR} -name "*.jar" -exec rm {} \;
51 find ${WORKDIR} -name "*.class" -exec rm {} \;
52}
53
54addtask removebinaries after do_unpack before do_patch
55
56do_install() {
57 oe_jarinstall ${JARFILENAME} ${ALTJARFILENAMES}
58}