summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Matthijs <axxo@gentoo.org>2004-12-21 21:38:25 +0000
committerThomas Matthijs <axxo@gentoo.org>2004-12-21 21:38:25 +0000
commit76dfeb53e79931c77d8c9900f60a22ee1683934a (patch)
tree7aac679cfeeca895553be6508eb4df95943e9f55 /dev-java
parentRestored name in ChangeLog (Manifest recommit) (diff)
downloadgentoo-2-76dfeb53e79931c77d8c9900f60a22ee1683934a.tar.gz
gentoo-2-76dfeb53e79931c77d8c9900f60a22ee1683934a.tar.bz2
gentoo-2-76dfeb53e79931c77d8c9900f60a22ee1683934a.zip
version bump
Diffstat (limited to 'dev-java')
-rw-r--r--dev-java/sun-jdk/ChangeLog8
-rw-r--r--dev-java/sun-jdk/Manifest20
-rw-r--r--dev-java/sun-jdk/files/digest-sun-jdk-1.5.0.013
-rw-r--r--dev-java/sun-jdk/files/sun-jdk-1.5.0.0112
-rw-r--r--dev-java/sun-jdk/sun-jdk-1.5.0.01.ebuild238
-rw-r--r--dev-java/sun-jre-bin/ChangeLog8
-rw-r--r--dev-java/sun-jre-bin/Manifest11
-rw-r--r--dev-java/sun-jre-bin/files/digest-sun-jre-bin-1.5.0.012
-rw-r--r--dev-java/sun-jre-bin/files/sun-jre-bin-1.5.0.0111
-rw-r--r--dev-java/sun-jre-bin/sun-jre-bin-1.5.0.01.ebuild197
10 files changed, 490 insertions, 20 deletions
diff --git a/dev-java/sun-jdk/ChangeLog b/dev-java/sun-jdk/ChangeLog
index 151fa8ab2fd0..98e611e556b2 100644
--- a/dev-java/sun-jdk/ChangeLog
+++ b/dev-java/sun-jdk/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-java/sun-jdk
# Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/ChangeLog,v 1.96 2004/10/27 14:37:06 axxo Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/ChangeLog,v 1.97 2004/12/21 21:37:17 axxo Exp $
+
+*sun-jdk-1.5.0.01 (21 Dec 2004)
+
+ 21 Dec 2004; Thomas Matthijs <axxo@gentoo.org> +files/sun-jdk-1.5.0.01,
+ +sun-jdk-1.5.0.01.ebuild:
+ version bump
26 Oct 2004; Thomas Matthijs <axxo@gentoo.org> sun-jdk-1.4.2.06.ebuild:
Added r flag to chpax flags #68829
diff --git a/dev-java/sun-jdk/Manifest b/dev-java/sun-jdk/Manifest
index 60584c0b938f..bcf4e5a47b1c 100644
--- a/dev-java/sun-jdk/Manifest
+++ b/dev-java/sun-jdk/Manifest
@@ -1,11 +1,9 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-MD5 59bf21f3d7980e2b7b2f0b7260b9dd9a sun-jdk-1.3.1.13.ebuild 3802
-MD5 e22788803f0fd581cd5e60e23cdefa97 sun-jdk-1.4.2.06.ebuild 6393
+MD5 2ca35f6b88d7676ab68fb142edb9cdfd sun-jdk-1.5.0.01.ebuild 7223
+MD5 7f963787aa686ab6aaf5624dd716cf66 sun-jdk-1.3.1.13.ebuild 3828
+MD5 a412c0b1974e565352ea68960731374f sun-jdk-1.4.2.06.ebuild 6419
MD5 8cd7b78a6f968cc64098ac22461a7f30 sun-jdk-1.2.2.017.ebuild 3149
-MD5 e5fdb7cb12af035716e81715eff30ad2 sun-jdk-1.5.0.ebuild 7123
-MD5 2ad661ec7ec297fbc0f63fc66cd1fe42 sun-jdk-1.4.2.05.ebuild 6420
+MD5 02e0856138489c962dcc8130a9e4a682 sun-jdk-1.5.0.ebuild 7149
+MD5 cc77d7db12a46c623008b08e7d04a053 sun-jdk-1.4.2.05.ebuild 6446
MD5 9f849dd6055b1368a7870eca44bc7f60 ChangeLog 20258
MD5 16c9e337522b7e477aece60ff98dde54 metadata.xml 239
MD5 e69378131ebaaa3322d156533d441dce files/digest-sun-jdk-1.5.0 206
@@ -18,10 +16,4 @@ MD5 f0482e3f52521721aec8df64b7c2d0a7 files/sun-jdk-1.5.0 468
MD5 d1e29e8acce3cfec9912e23aa366478a files/digest-sun-jdk-1.3.1.13 76
MD5 dbb142ea361e1f8ac87d899f62f66c89 files/digest-sun-jdk-1.4.2.05 140
MD5 25d7339acdf5210791eb94ee7bfc5e7e files/digest-sun-jdk-1.4.2.06 140
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.2.6 (GNU/Linux)
-
-iD8DBQFBf7K3/rLF9B432nYRAtmsAJ9DNFcPxilX0cI3B9MLYT8zYZtUDgCfQp/g
-zaN0fWwrEn/tYXgXlmP8sUE=
-=CoCd
------END PGP SIGNATURE-----
+MD5 e94f26fe6387bf27dc7b105879ca1be6 files/digest-sun-jdk-1.5.0.01 212
diff --git a/dev-java/sun-jdk/files/digest-sun-jdk-1.5.0.01 b/dev-java/sun-jdk/files/digest-sun-jdk-1.5.0.01
new file mode 100644
index 000000000000..67a58ab76aa1
--- /dev/null
+++ b/dev-java/sun-jdk/files/digest-sun-jdk-1.5.0.01
@@ -0,0 +1,3 @@
+MD5 3e3aa7f89685a30c5c343f8f70966800 jdk-1_5_0_01-linux-i586.bin 46120566
+MD5 99261de1c6c7774502eaa505cdfb1dec jdk-1_5_0_01-linux-amd64.bin 42091128
+MD5 169441bba1ca95e84e030e116f258d79 jce_policy-1_5_0.zip 8826
diff --git a/dev-java/sun-jdk/files/sun-jdk-1.5.0.01 b/dev-java/sun-jdk/files/sun-jdk-1.5.0.01
new file mode 100644
index 000000000000..edb637dd3ed0
--- /dev/null
+++ b/dev-java/sun-jdk/files/sun-jdk-1.5.0.01
@@ -0,0 +1,12 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/files/sun-jdk-1.5.0.01,v 1.1 2004/12/21 21:37:17 axxo Exp $
+
+VERSION="Sun JDK @PV@"
+JAVA_HOME=/opt/@P@
+JDK_HOME=/opt/@P@
+JAVAC=${JAVA_HOME}/bin/javac
+ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/jre/bin"
+ADDLDPATH="/opt/@P@/jre/lib"
+MANPATH="/opt/@P@/man"
+ENV_VARS="JAVA_HOME JDK_HOME JAVAC ADDPATH ADDLDPATH MANPATH"
diff --git a/dev-java/sun-jdk/sun-jdk-1.5.0.01.ebuild b/dev-java/sun-jdk/sun-jdk-1.5.0.01.ebuild
new file mode 100644
index 000000000000..4fe103389a98
--- /dev/null
+++ b/dev-java/sun-jdk/sun-jdk-1.5.0.01.ebuild
@@ -0,0 +1,238 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/sun-jdk-1.5.0.01.ebuild,v 1.1 2004/12/21 21:37:17 axxo Exp $
+
+inherit java eutils
+
+MY_PVL=${PV%.*}_${PV##*.}
+MY_PVA=${PV//./_}
+
+amd64file="jdk-${MY_PVA}-linux-amd64.bin"
+x86file="jdk-${MY_PVA}-linux-i586.bin"
+
+jcefile="jce_policy-${MY_PVA%_*}.zip"
+
+if use x86; then
+ At=${x86file}
+elif use amd64; then
+ At=${amd64file}
+fi
+
+S="${WORKDIR}/jdk${MY_PVL}"
+DESCRIPTION="Sun's J2SE Development Kit, version ${PV}"
+HOMEPAGE="http://java.sun.com/j2se/1.5.0/"
+SRC_URI="x86? ( $x86file ) amd64? ( $amd64file )
+ jce? ( $jcefile )"
+SLOT="1.5"
+LICENSE="sun-bcla-java-vm"
+KEYWORDS="~x86 ~amd64"
+RESTRICT="fetch"
+IUSE="doc gnome kde mozilla jce"
+
+#
+DEPEND=">=dev-java/java-config-1.2
+ sys-apps/sed
+ doc? ( =dev-java/java-sdk-docs-1.5.0* )
+ virtual/lpr"
+
+RDEPEND="x86? ( sys-libs/lib-compat )
+ doc? ( =dev-java/java-sdk-docs-1.5.0* )
+ virtual/lpr"
+
+PROVIDE="virtual/jre-1.5
+ virtual/jdk-1.5"
+
+PACKED_JARS="lib/tools.jar jre/lib/rt.jar jre/lib/jsse.jar jre/lib/charsets.jar jre/lib/ext/localedata.jar jre/lib/plugin.jar jre/lib/javaws.jar jre/lib/deploy.jar"
+
+# this is needed for proper operating under a PaX kernel without activated grsecurity acl
+CHPAX_CONSERVATIVE_FLAGS="pemsv"
+
+FETCH_SDK="http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jdk-${MY_PVL}-oth-JPR&SiteId=JSC&TransactionId=noreg"
+FETCH_JCE="http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jce_policy-${PV%.*}-oth-JPR&SiteId=JSC&TransactionId=noreg"
+
+
+pkg_nofetch() {
+ einfo "Please download ${At} from:"
+ einfo ${FETCH_SDK}
+ einfo "(Select the Linux or Linux AMD64 Self-extracting (.bin), depending on your arch)"
+ einfo "and move it to ${DISTDIR}"
+
+ if use jce; then
+ echo
+ einfo "Also download ${jcefile} from:"
+ einfo ${FETCH_JCE}
+ einfo "Java(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files"
+ einfo "and move it to ${DISTDIR}"
+ fi
+
+}
+
+src_unpack() {
+ if [ ! -r ${DISTDIR}/${At} ]; then
+ die "cannot read ${At}. Please check the permission and try again."
+ fi
+ if use jce; then
+ if [ ! -r ${DISTDIR}/${jcefile} ]; then
+ die "cannot read ${jcefile}. Please check the permission and try again."
+ fi
+ fi
+
+ #Search for the ELF Header
+ testExp=`echo -e "\105\114\106"`
+ startAt=`grep -aonm 1 ${testExp} ${DISTDIR}/${At} | cut -d: -f1`
+ tail -n +${startAt} ${DISTDIR}/${At} > install.sfx
+ chmod +x install.sfx
+ ./install.sfx || die
+ rm install.sfx
+
+ if [ -f ${S}/bin/unpack200 ]; then
+ UNPACK_CMD=${S}/bin/unpack200
+ chmod +x $UNPACK_CMD
+ for i in $PACKED_JARS; do
+ PACK_FILE=${S}/`dirname $i`/`basename $i .jar`.pack
+ if [ -f ${PACK_FILE} ]; then
+ echo " unpacking: $i"
+ $UNPACK_CMD ${PACK_FILE} ${S}/$i
+ rm -f ${PACK_FILE}
+ fi
+ done
+ rm -f ${UNPACK_CMD}
+ else
+ die "unpack not found"
+ fi
+ ${S}/bin/java -client -Xshare:dump
+}
+
+src_install() {
+ local dirs="bin include jre lib man"
+ dodir /opt/${P}
+
+ for i in $dirs ; do
+ cp -a $i ${D}/opt/${P}/ || die "failed to copy"
+ done
+ dodoc COPYRIGHT LICENSE README.html
+ dohtml README.html
+ dodir /opt/${P}/share/
+ cp -a demo src.zip ${D}/opt/${P}/share/
+ if ( use x86 || use amd64 ); then
+ cp -a sample ${D}/opt/${P}/share/
+ fi
+
+ if use jce ; then
+ cd ${D}/opt/${P}/jre/lib/security
+ unzip ${DISTDIR}/${jcefile} || die "failed to unzip jce"
+ mv jce unlimited-jce
+ dodir /opt/${P}/jre/lib/security/strong-jce
+ mv ${D}/opt/${P}/jre/lib/security/US_export_policy.jar ${D}/opt/${P}/jre/lib/security/strong-jce
+ mv ${D}/opt/${P}/jre/lib/security/local_policy.jar ${D}/opt/${P}/jre/lib/security/strong-jce
+ dosym /opt/${P}/jre/lib/security/unlimited-jce/US_export_policy.jar /opt/${P}/jre/lib/security/
+ dosym /opt/${P}/jre/lib/security/unlimited-jce/local_policy.jar /opt/${P}/jre/lib/security/
+ fi
+
+ if use mozilla; then
+ local plugin_dir="ns7-gcc29"
+ if has_version '>=gcc-3*' ; then
+ plugin_dir="ns7"
+ fi
+
+ if use x86 ; then
+ install_mozilla_plugin /opt/${P}/jre/plugin/i386/$plugin_dir/libjavaplugin_oji.so
+ else
+ eerror "No plugin available for amd64 arch"
+ fi
+ fi
+
+ # create dir for system preferences
+ dodir /opt/${P}/.systemPrefs
+
+ # install control panel for Gnome/KDE
+ sed -e "s/INSTALL_DIR\/JRE_NAME_VERSION/\/opt\/${P}\/jre/" \
+ -e "s/\(Name=Java\)/\1 Control Panel/" \
+ ${D}/opt/${P}/jre/plugin/desktop/sun_java.desktop > \
+ ${T}/sun_java.desktop
+
+ if use x86; then
+ if use gnome ; then
+ #TODO check this on Gnome
+ dodir /usr/share/gnome/apps/Internet
+ insinto /usr/share/gnome/apps/Internet
+ doins ${T}/sun_java.desktop
+ fi
+
+ if use kde ; then
+ dodir /usr/share/applnk/Internet
+ insinto /usr/share/applnk/Internet
+ doins ${T}/sun_java.desktop
+ fi
+ else
+ eerror "Sorry no kde, gnome support for your arch now."
+ fi
+
+ set_java_env ${FILESDIR}/${VMHANDLE}
+
+ # TODO prepman "fixes" symlink ja -> ja__JP.eucJP in 'man' directory,
+ # creating ja.gz -> ja_JP.eucJP.gz. This is broken as ja_JP.eucJP
+ # is a directory and will not be gzipped ;)
+}
+
+pkg_postinst() {
+ # Create files used as storage for system preferences.
+ PREFS_LOCATION=/opt/${P}/jre
+ mkdir -p ${PREFS_LOCATION}/.systemPrefs
+ if [ ! -f ${PREFS_LOCATION}/.systemPrefs/.system.lock ] ; then
+ touch $PREFS_LOCATION/.systemPrefs/.system.lock
+ chmod 644 $PREFS_LOCATION/.systemPrefs/.system.lock
+ fi
+ if [ ! -f $PREFS_LOCATION/.systemPrefs/.systemRootModFile ] ; then
+ touch $PREFS_LOCATION/.systemPrefs/.systemRootModFile
+ chmod 644 $PREFS_LOCATION/.systemPrefs/.systemRootModFile
+ fi
+
+ # Set as default VM if none exists
+ java_pkg_postinst
+
+ #Show info about netscape
+ if has_version '>=netscape-navigator-4.79-r1' || has_version '>=netscape-communicator-4.79-r1' ; then
+ echo
+ einfo "If you want to install the plugin for Netscape 4.x, type"
+ einfo
+ einfo " cd /usr/lib/nsbrowser/plugins/"
+ einfo " ln -sf /opt/${P}/jre/plugin/i386/ns4/libjavaplugin.so"
+ fi
+
+ # if chpax is on the target system, set the appropriate PaX flags
+ # this will not hurt the binary, it modifies only unused ELF bits
+ # but may confuse things like AV scanners and automatic tripwire
+ if has_version "sys-apps/chpax"
+ then
+ echo
+ einfo "setting up conservative PaX flags for jar, javac and java"
+
+ for paxkills in "jar" "javac" "java"
+ do
+ chpax -${CHPAX_CONSERVATIVE_FLAGS} /opt/${PN}-${PV}/bin/$paxkills
+ done
+
+ # /opt/$VM/jre/bin/java_vm
+ chpax -${CHPAX_CONSERVATIVE_FLAGS} /opt/${PN}-${PV}/jre/bin/java_vm
+
+ einfo "you should have seen lots of chpax output above now"
+ ewarn "make sure the grsec ACL contains those entries also"
+ ewarn "because enabling it will override the chpax setting"
+ ewarn "on the physical files - help for PaX and grsecurity"
+ ewarn "can be given by #gentoo-hardened + pappy@gentoo.org"
+ fi
+
+ echo
+ eerror "Some parts of Sun's JDK require XFree86 to be installed."
+ eerror "Be careful which Java libraries you attempt to use."
+
+ echo
+ einfo " Be careful: ${P}'s Java compiler uses"
+ einfo " '-source 1.5' as default. Some keywords such as 'enum'"
+ einfo " are not valid identifiers any more in that mode,"
+ einfo " which can cause incompatibility with certain sources."
+
+ ebeep 5
+ epause 8
+}
diff --git a/dev-java/sun-jre-bin/ChangeLog b/dev-java/sun-jre-bin/ChangeLog
index 1e9d72ce3777..c41666cd9d34 100644
--- a/dev-java/sun-jre-bin/ChangeLog
+++ b/dev-java/sun-jre-bin/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for dev-java/sun-jre-bin
# Copyright 2000-2004 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jre-bin/ChangeLog,v 1.12 2004/10/18 08:02:16 axxo Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jre-bin/ChangeLog,v 1.13 2004/12/21 21:38:25 axxo Exp $
+
+*sun-jre-bin-1.5.0.01 (21 Dec 2004)
+
+ 21 Dec 2004; Thomas Matthijs <axxo@gentoo.org>
+ +files/sun-jre-bin-1.5.0.01, +sun-jre-bin-1.5.0.01.ebuild:
+ version bump
*sun-jre-bin-1.5.0 (18 Oct 2004)
diff --git a/dev-java/sun-jre-bin/Manifest b/dev-java/sun-jre-bin/Manifest
index 86a92fefa35f..fc55a2f465d9 100644
--- a/dev-java/sun-jre-bin/Manifest
+++ b/dev-java/sun-jre-bin/Manifest
@@ -1,11 +1,14 @@
+MD5 2fbe937bcd6f100b6c6006430b1373dd sun-jre-bin-1.4.2.05-r1.ebuild 4807
+MD5 02bb0fec57bb548e2c469dafeda1bf24 sun-jre-bin-1.5.0.ebuild 5236
+MD5 df3b8dae259226fbc66df0667c121a08 sun-jre-bin-1.5.0.01.ebuild 5287
MD5 ef2b4480a4a06937e71bc962cadcabb5 ChangeLog 2454
MD5 ca35f917561afc166491d77810b71095 metadata.xml 242
-MD5 02bb0fec57bb548e2c469dafeda1bf24 sun-jre-bin-1.5.0.ebuild 5236
MD5 7d17587f01ed6c441db2b7c0e754a144 sun-jre-bin-1.4.2.06.ebuild 4848
-MD5 2fbe937bcd6f100b6c6006430b1373dd sun-jre-bin-1.4.2.05-r1.ebuild 4807
+MD5 e769eaeb7ddf420cace1a83890d42703 files/digest-sun-jre-bin-1.4.2.06 75
+MD5 37325b1ce12abd1a1a66277a305be8ef files/digest-sun-jre-bin-1.5.0.01 149
MD5 ea64994bb63f18d8c29ce57e4f5d80ea files/digest-sun-jre-bin-1.4.2.05-r1 75
-MD5 acb452269bc2a3897ba121b5ebfd7524 files/digest-sun-jre-bin-1.5.0 143
MD5 4a0f05a5dd8f5357dec66ae47dce0ebf files/sun-jre-bin-1.5.0 436
+MD5 acb452269bc2a3897ba121b5ebfd7524 files/digest-sun-jre-bin-1.5.0 143
MD5 65240bd8b9977fbe20b35c7f5201c10d files/sun-jre-bin-1.4.2.05 439
-MD5 e769eaeb7ddf420cace1a83890d42703 files/digest-sun-jre-bin-1.4.2.06 75
MD5 6ec9cb0d5657017ab82a1e42f6e677b1 files/sun-jre-bin-1.4.2.06 439
+MD5 4a0f05a5dd8f5357dec66ae47dce0ebf files/sun-jre-bin-1.5.0.01 436
diff --git a/dev-java/sun-jre-bin/files/digest-sun-jre-bin-1.5.0.01 b/dev-java/sun-jre-bin/files/digest-sun-jre-bin-1.5.0.01
new file mode 100644
index 000000000000..46868378dd86
--- /dev/null
+++ b/dev-java/sun-jre-bin/files/digest-sun-jre-bin-1.5.0.01
@@ -0,0 +1,2 @@
+MD5 24cdc55898afd18d9eb893813a07a560 jre-1_5_0_01-linux-i586.bin 16517969
+MD5 75a38825f4b2c18f08d4bc2da6e9b768 jre-1_5_0_01-linux-amd64.bin 16138383
diff --git a/dev-java/sun-jre-bin/files/sun-jre-bin-1.5.0.01 b/dev-java/sun-jre-bin/files/sun-jre-bin-1.5.0.01
new file mode 100644
index 000000000000..95250bb7aef4
--- /dev/null
+++ b/dev-java/sun-jre-bin/files/sun-jre-bin-1.5.0.01
@@ -0,0 +1,11 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jre-bin/files/sun-jre-bin-1.5.0.01,v 1.1 2004/12/21 21:38:25 axxo Exp $
+
+VERSION="Sun JRE @PV@"
+JAVA_HOME=/opt/@P@
+JRE_HOME=/opt/@P@
+ADDPATH="${JAVA_HOME}/bin:${JAVA_HOME}/javaws"
+ADDLDPATH="/opt/@P@/lib"
+MANPATH="/opt/@P@/man"
+ENV_VARS="JAVA_HOME JRE_HOME ADDPATH ADDLDPATH MANPATH"
diff --git a/dev-java/sun-jre-bin/sun-jre-bin-1.5.0.01.ebuild b/dev-java/sun-jre-bin/sun-jre-bin-1.5.0.01.ebuild
new file mode 100644
index 000000000000..3bcfdc62da9a
--- /dev/null
+++ b/dev-java/sun-jre-bin/sun-jre-bin-1.5.0.01.ebuild
@@ -0,0 +1,197 @@
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jre-bin/sun-jre-bin-1.5.0.01.ebuild,v 1.1 2004/12/21 21:38:25 axxo Exp $
+
+inherit java eutils
+
+MY_PVL=${PV%.*}_${PV##*.}
+MY_PVA=${PV//./_}
+
+amd64file="jre-${MY_PVA}-linux-amd64.bin"
+x86file="jre-${MY_PVA}-linux-i586.bin"
+
+if use x86; then
+ At=${x86file}
+elif use amd64; then
+ At=${amd64file}
+fi
+
+S="${WORKDIR}/jre${MY_PVL}"
+DESCRIPTION="Sun's J2SE Platform"
+HOMEPAGE="http://java.sun.com/j2se/"
+SRC_URI="x86? ( $x86file ) amd64? ( $amd64file )"
+SLOT="1.5"
+LICENSE="sun-bcla-java-vm"
+KEYWORDS="~x86 ~amd64"
+RESTRICT="fetch"
+IUSE="gnome kde mozilla"
+
+DEPEND=">=dev-java/java-config-1.2
+ sys-apps/sed
+ virtual/lpr"
+
+RDEPEND="x86? ( sys-libs/lib-compat )
+ virtual/lpr"
+
+PROVIDE="virtual/jre-1.5"
+
+PACKED_JARS="lib/rt.jar lib/jsse.jar lib/charsets.jar lib/ext/localedata.jar lib/plugin.jar lib/javaws.jar lib/deploy.jar"
+
+# this is needed for proper operating under a PaX kernel without activated grsecurity acl
+CHPAX_CONSERVATIVE_FLAGS="pemsv"
+
+FETCH_SDK="http://javashoplm.sun.com:80/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=jre-${MY_PVL}-oth-JPR&SiteId=JSC&TransactionId=noreg"
+
+
+pkg_nofetch() {
+ einfo "Please download ${At} from:"
+ einfo ${FETCH_SDK}
+ einfo "(Select the Linux or Linux AMD64 Self-extracting (.bin), depending on your arch)"
+ einfo "and move it to ${DISTDIR}"
+}
+
+src_unpack() {
+ if [ ! -r ${DISTDIR}/${At} ]; then
+ die "cannot read ${At}. Please check the permission and try again."
+ fi
+
+ #Search for the ELF Header
+ testExp=`echo -e "\105\114\106"`
+ startAt=`grep -aonm 1 ${testExp} ${DISTDIR}/${At} | cut -d: -f1`
+ tail -n +${startAt} ${DISTDIR}/${At} > install.sfx
+ chmod +x install.sfx
+ ./install.sfx || die
+ rm install.sfx
+
+ if [ -f ${S}/bin/unpack200 ]; then
+ UNPACK_CMD=${S}/bin/unpack200
+ chmod +x $UNPACK_CMD
+ for i in $PACKED_JARS; do
+ PACK_FILE=${S}/`dirname $i`/`basename $i .jar`.pack
+ if [ -f ${PACK_FILE} ]; then
+ echo " unpacking: $i"
+ $UNPACK_CMD ${PACK_FILE} ${S}/$i
+ rm -f ${PACK_FILE}
+ fi
+ done
+ rm -f ${UNPACK_CMD}
+ else
+ die "unpack not found"
+ fi
+}
+
+src_install() {
+
+ if use amd64; then
+ local dirs="bin lib man"
+ else
+ local dirs="bin lib man plugin javaws"
+ fi
+
+
+ dodir /opt/${P}
+
+ for i in $dirs ; do
+ cp -a $i ${D}/opt/${P}/ || die "failed to build"
+ done
+
+ dodoc COPYRIGHT LICENSE README
+ dohtml Welcome.html
+
+ if use mozilla; then
+ local plugin_dir="ns7-gcc29"
+ if has_version '>=gcc-3*' ; then
+ plugin_dir="ns7"
+ fi
+
+ if use x86 ; then
+ install_mozilla_plugin /opt/${P}/plugin/i386/$plugin_dir/libjavaplugin_oji.so
+ else
+ eerror "No plugin available for amd64 arch"
+ fi
+ fi
+
+ # create dir for system preferences
+ dodir /opt/${P}/.systemPrefs
+
+ # install control panel for Gnome/KDE
+ sed -e "s/INSTALL_DIR\/JRE_NAME_VERSION/\/opt\/${P}/" \
+ -e "s/\(Name=Java\)/\1 Control Panel/" \
+ ${D}/opt/${P}/plugin/desktop/sun_java.desktop > \
+ ${T}/sun_java.desktop
+
+ if use x86; then
+ if use gnome ; then
+ #TODO check this on Gnome
+ dodir /usr/share/gnome/apps/Internet
+ insinto /usr/share/gnome/apps/Internet
+ doins ${T}/sun_java.desktop
+ fi
+
+ if use kde ; then
+ dodir /usr/share/applnk/Internet
+ insinto /usr/share/applnk/Internet
+ doins ${T}/sun_java.desktop
+ fi
+ else
+ eerror "Sorry no kde, gnome support for your arch now."
+ fi
+
+ set_java_env ${FILESDIR}/${VMHANDLE}
+}
+
+pkg_postinst() {
+ # Create files used as storage for system preferences.
+ PREFS_LOCATION=/opt/${P}/
+ mkdir -p ${PREFS_LOCATION}/.systemPrefs
+ if [ ! -f ${PREFS_LOCATION}/.systemPrefs/.system.lock ] ; then
+ touch $PREFS_LOCATION/.systemPrefs/.system.lock
+ chmod 644 $PREFS_LOCATION/.systemPrefs/.system.lock
+ fi
+ if [ ! -f $PREFS_LOCATION/.systemPrefs/.systemRootModFile ] ; then
+ touch $PREFS_LOCATION/.systemPrefs/.systemRootModFile
+ chmod 644 $PREFS_LOCATION/.systemPrefs/.systemRootModFile
+ fi
+
+ # Set as default VM if none exists
+ java_pkg_postinst
+
+ #Show info about netscape
+ if has_version '>=netscape-navigator-4.79-r1' || has_version '>=netscape-communicator-4.79-r1' ; then
+ echo
+ einfo "If you want to install the plugin for Netscape 4.x, type"
+ einfo
+ einfo " cd /usr/lib/nsbrowser/plugins/"
+ einfo " ln -sf /opt/${P}/plugin/i386/ns4/libjavaplugin.so"
+ fi
+
+ # if chpax is on the target system, set the appropriate PaX flags
+ # this will not hurt the binary, it modifies only unused ELF bits
+ # but may confuse things like AV scanners and automatic tripwire
+ if has_version "sys-apps/chpax"
+ then
+ echo
+ einfo "setting up conservative PaX flags for jar, javac and java"
+
+ for paxkills in "java"
+ do
+ chpax -${CHPAX_CONSERVATIVE_FLAGS} /opt/${P}/bin/$paxkills
+ done
+
+ # /opt/$VM/bin/java_vm
+ chpax -${CHPAX_CONSERVATIVE_FLAGS} /opt/${P}/bin/java_vm
+
+ einfo "you should have seen lots of chpax output above now"
+ ewarn "make sure the grsec ACL contains those entries also"
+ ewarn "because enabling it will override the chpax setting"
+ ewarn "on the physical files - help for PaX and grsecurity"
+ ewarn "can be given by #gentoo-hardened + pappy@gentoo.org"
+ fi
+
+ echo
+ eerror "Some parts of Sun's JRE require XFree86 to be installed."
+ eerror "Be careful which Java libraries you attempt to use."
+
+ ebeep 5
+ epause 8
+}