[oe-commits] org.oe.angstrom-2007.12-stable Add missing files from 9005ec7475f13738f08b14c023c457704df3f4af.

pfalcon commit openembedded-commits at lists.openembedded.org
Sun Jan 27 17:28:04 UTC 2008


Add missing files from 9005ec7475f13738f08b14c023c457704df3f4af.
* mtn sucks at cherry-picking.

Author: pfalcon at openembedded.org
Branch: org.openembedded.angstrom-2007.12-stable
Revision: cd2d41ea3b8fbc5b64415359a8219586f2406750
ViewMTN: http://monotone.openembedded.org/revision/info/cd2d41ea3b8fbc5b64415359a8219586f2406750
Files:
1
classes/java-library.bbclass
classes/java.bbclass
Diffs:

#
# mt diff -r6eea50b93ed9d226cc54f6b5aebe50d4e546d125 -rcd2d41ea3b8fbc5b64415359a8219586f2406750
#
# 
# 
# add_file "classes/java-library.bbclass"
#  content [ba884554b916e0ee77988f7e42644eb50f0bcf92]
# 
# add_file "classes/java.bbclass"
#  content [4c1064a0c1677fa3f136bebf5736ace413a11f30]
# 
============================================================
--- classes/java-library.bbclass	ba884554b916e0ee77988f7e42644eb50f0bcf92
+++ classes/java-library.bbclass	ba884554b916e0ee77988f7e42644eb50f0bcf92
@@ -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}"
+
============================================================
--- classes/java.bbclass	4c1064a0c1677fa3f136bebf5736ace413a11f30
+++ classes/java.bbclass	4c1064a0c1677fa3f136bebf5736ace413a11f30
@@ -0,0 +1,62 @@
+# Defines the commonly used target directories and provides a convenience
+# function to install jar files.
+
+# Jar location on target
+datadir_java ?= ${datadir}/java
+
+# JNI library location on target
+libdir_jni ?= ${libdir}/jni
+
+STAGING_DATADIR_JAVA ?= ${STAGING_DATADIR}/java
+STAGING_LIBDIR_JNI ?= ${STAGING_LIBDIR}/jni
+
+oe_jarinstall() {
+  # Purpose: Install a jar file and create all the given symlinks to it.
+  # Example:
+  # oe_jarinstall foo-1.3.jar foo.jar
+  # Installs foo-1.3.jar and creates symlink foo.jar.
+  #
+  # oe_jarinstall -s foo-1.3.jar foo.jar
+  # Installs foo-1.3.jar to staging and creates symlink foo.jar.
+  #
+  # oe_jarinstall -r foo-1.3.jar foo_1_3.jar foo.jar
+  # Installs foo_1_3.jar as foo-1.3.jar and creates a symlink to this.
+  #
+  dir=${D}${datadir_java}
+  destname=""
+  while [ "$#" -gt 0 ]; do
+    case "$1" in
+    -s)
+      dir=${STAGING_DATADIR_JAVA}
+      ;;
+    -r)
+      shift
+      destname=$1
+      ;;
+    -*)
+      oefatal "oe_jarinstall: unknown option: $1"
+      ;;
+    *)
+      break;
+      ;;
+    esac
+    shift
+  done
+
+  jarname=$1
+  destname=${destname:-`basename $jarname`}
+  shift
+
+  install -d $dir
+  install -m 0644 $jarname $dir/$destname
+
+  # Creates symlinks out of the remaining arguments.
+  while [ "$#" -gt 0 ]; do
+    if [ -e $dir/$1 ]; then
+      oewarn "file was in the way. removing:" $dir/$1
+      rm $dir/$1
+    fi
+    ln -s $destname $dir/$1
+    shift
+  done
+}






More information about the Openembedded-commits mailing list