summaryrefslogtreecommitdiff
path: root/packages/avetanabt/avetanabt_20060413.bb
blob: 5140b078744385fc92962c7d5a3d8c29c0bb1dba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
DESCRIPTION = "avetanaBT: Bluetooth API implementation for Java (JSR-82)"
SECTION = "devel"
DEPENDS = "findutils-native jikes-native kaffeh-native fastjar-native bluez-libs classpath"
LICENSE = "GPL"
HOMEPAGE = "http://sourceforge.net/projects/avetanabt/"

PR = "r0"

SRC_URI = "${SOURCEFORGE_MIRROR}/avetanabt/avetanaBluetooth-${PV}.tgz"

S = "${WORKDIR}/avetanabt"

PACKAGES = "${PN}"
FILES_${PN} = "${libdir}/libavetanaBT.so ${datadir}/avetanabt/avetanaBT.jar"

do_compile() {

  # doing nearly the same as in Makefile written...

  # clean build directory
  mkdir -p build
  rm -fr build/*

  # generate classes
  # javac -> jikes
  ${STAGING_BINDIR_NATIVE}/find {de,javax,com} -iname *.java > file.list
  ${STAGING_BINDIR_NATIVE}/jikes -verbose --bootclasspath ${STAGING_DIR}/${BUILD_SYS}/share/kaffeh/rt.jar -d build @file.list

  # create own version.xml (add version information available at runtime)
  head -n 4 version.xml >> build/version.xml
  echo "    <build value=\"cvs${SRCDATE}\" date=\"${SRCDATE}\" time=\"${@time.strftime('%H:%M',time.gmtime())}\"/>" >> build/version.xml
  tail -n 3 version.xml >> build/version.xml

  # move classes into jar archive
  # jar -> fastjar
  ${STAGING_BINDIR_NATIVE}/fastjar -v -cf avetanaBT.jar -C build de -C build javax -C build com -C build version.xml
  
  # JNI generated header file - de_avetana_bluetooth_stack_BlueZ.h
  # javah -> kaffeh
  ${STAGING_BINDIR_NATIVE}/kaffeh -jni -classpath avetanaBT.jar:${STAGING_DIR}/${BUILD_SYS}/share/kaffeh/rt.jar -d c de.avetana.bluetooth.stack.BlueZ

  # Native language (C) library - libavetanaBT.so
  ${CXX} ${CXXFLAGS}  -shared -lbluetooth -I${STAGING_INCDIR}/classpath c/BlueZ.cpp -o libavetanaBT.so ${LDFLAGS}

}

do_stage() {

  install -d ${STAGING_DIR}/${BUILD_SYS}/share/avetanabt
  install avetanaBT.jar ${STAGING_DIR}/${BUILD_SYS}/share/avetanabt/

}

do_install() {

  install -d ${D}${libdir}
  install -m 0755 libavetanaBT.so ${D}${libdir}/

  install -d ${D}${datadir}/avetanabt
  install avetanaBT.jar ${D}${datadir}/avetanabt/
 
}