diff options
author | Robert Schuster <thebohemian@gmx.net> | 2008-01-17 15:51:03 +0000 |
---|---|---|
committer | Robert Schuster <thebohemian@gmx.net> | 2008-01-17 15:51:03 +0000 |
commit | 94760031fd32486d95b2699bbb9656dcf0b74653 (patch) | |
tree | a5af4cbae1bf47e265cdb7e4e5f9ea599e87e51c /classes/java.bbclass | |
parent | 9d1b8ff9cc28b6c4e0208b2cd0dc946b59b2b50f (diff) |
java.bbclass: New bbclass for java recipes.
java-library.bbclass: New bbclass for java library (jar) recipes.
swt3.3-gtk: New recipe.
swt3.4-gtk: New recipe.
swt3.4-gtk-hildon: New recipe.
Diffstat (limited to 'classes/java.bbclass')
-rw-r--r-- | classes/java.bbclass | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/classes/java.bbclass b/classes/java.bbclass new file mode 100644 index 0000000000..7fa6dc1786 --- /dev/null +++ b/classes/java.bbclass @@ -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 +} |