1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 JAVA_PKG_IUSE
="doc source"
9 DESCRIPTION
="Java 2 Micro Edition Wireless Toolkit for developing wireless applications"
10 HOMEPAGE
="http://java.sun.com/products/j2mewtoolkit/"
12 DOWNLOAD_URL
="http://java.sun.com/products/sjwtoolkit/download.html?feed=JSC"
13 BINARY
="sun_java_wireless_toolkit-${PV//./_}-linux.bin"
14 #PATCH="j2me_wireless_toolkit-2_2-update_2-linux.zip"
16 #SRC_URI="${BINARY} ${PATCH}"
18 LICENSE
="sun-bcla-j2me"
20 KEYWORDS
="~amd64 ~x86"
28 RDEPEND
="${COMMON_DEP}
35 MY_FILE
=${DISTDIR}/${BINARY}
39 einfo
"Please navigate your browser to ${DOWNLOAD_URL}"
40 einfo
"scroll down and notice the two download buttons."
41 einfo
"Click the first Download button for J2ME Wireless Toolkit 2.2"
42 einfo
"and download ${BINARY} to ${DISTDIR} and resume the installation"
48 if [[ ! -r ${MY_FILE} ]]; then
50 eerror
"cannot read ${A}. Please check the permission and try again."
55 #extract compressed data and unpack
56 ebegin
"Unpacking ${BINARY}"
57 dd bs
=1024 if=${MY_FILE} of
=install.
zip skip
=26 2>/dev
/null || die
59 unzip install.
zip || die
65 #Set the java-bin-path in some scripts
66 for file in ktoolbar emulator mekeytool prefs utils wscompile defaultdevice
; do
68 "s@pathtowtk=\$@pathtowtk=\`java-config --jdk-home\`\"/bin/\"@" \
69 ${WORKDIR}/bin
/${file} || die
73 rm -f activation.jar
mail.jar xsdlib.jar
83 cp -r j2mewtk_template j2mewtk_template
/appdb bin lib wtklib
${D}/${DIR}
84 use examples
&& cp -r apps
${D}/${DIR}
86 einfo
"Setting permissions"
87 chmod 755 ${D}/${DIR}/bin
/* || die
88 chmod 644 ${D}/${DIR}/bin
/*.jar || die
90 einfo
"Installing documentation"
92 use doc
&& java-pkg_dohtml
-r docs
/*
95 java-pkg_jar-from sun-jaf activation.jar
96 java-pkg_jar-from sun-javamail
mail.jar
97 java-pkg_jar-from xsdlib xsdlib.jar
99 einfo
"Registering jar files"
100 # The zip files are somehow broken and python zip handling errors on them
101 JAVA_PKG_STRICT
= java-pkg_regjar \
102 ${D}${DIR}/lib
/*.jar \
103 ${D}${DIR}/wtklib
/kenv.
zip \
104 ${D}${DIR}/wtklib
/*.jar
106 if java-config
--select-vm=emul-linux-x86-java
-O 2> /dev
/null
> /dev
/null
; then
107 sed -i ${D}/${DIR}/bin
/emulator
-e 's:java-config --jdk-home:java-config --select-vm=emul-linux-x86-java --jdk-home:'
111 dosym
${DIR}/bin
/ktoolbar
/usr
/bin
/ktoolbar