summaryrefslogtreecommitdiff
blob: f94758ceec6c5ea0fdeb5417dd7152ac34af0fbb (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# Copyright 1999-2005 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.2.2.017.ebuild,v 1.4 2005/01/01 18:19:47 axxo Exp $

inherit java

At="jdk-1_2_2_017-linux-i586.tar.gz"
S="${WORKDIR}/jdk1.2.2"
SRC_URI="${At}"
DESCRIPTION="Sun Java Development"
HOMEPAGE="http://java.sun.com/products/archive/"
PROVIDE="virtual/jre-1.2.2
	virtual/jdk-1.2.2
	virtual/java-scheme-2"
LICENSE="sun-bcla-java-vm-1.2"
SLOT="1.2"
KEYWORDS="~x86 -ppc -sparc -alpha -mips -hppa -arm"
RESTRICT="fetch"
IUSE="doc mozilla X"
# NOTE:  Sun's JDK also requires the XFree86 be installed to use the graphical
# libraries.  Even some non-graphical libraries (such as JavaMail) have bizarre
# dependencies on windowing toolkits.
DEPEND="virtual/libc
	>=dev-java/java-config-0.2.7
	doc? ( =dev-java/java-sdk-docs-1.2.2* )"
RDEPEND="sys-libs/lib-compat"

DOWNLOAD_URL="http://javashoplm.sun.com/ECom/docs/Welcome.jsp?StoreId=22&PartDetailId=7740-j2sdk-1.2.2_017-oth-JPR&SiteId=JSC&TransactionId=noreg"

pkg_nofetch() {
	einfo "Please download ${At} from:"
	einfo ${DOWNLOAD_URL}
	einfo "(Java(TM) 2 SDK, Standard Edition 1.2.2_017, Linux Platform)"
	einfo "and move it to ${DISTDIR}"
}

pkg_setup() {
	# Issue a warning that this product has been marked as End-of-Life.
	ewarn "BEWARE"
	ewarn "Sun's JDK 1.2.2 has completed the Sun End of Life (EOL) process."
	ewarn "This version is no longer supported by Sun"
	ewarn "Sun is advising users to move to more recent JDK versions."
	echo
	ewarn "Currently this works fine with the x86 glibc version, but break"
	ewarn "with the ~x86 versions, there is bug open on the compatibility"
	ewarn "issue, so i'm hoping it will still work on upcoming versions of"
	ewarn "x86 glibc, so be warned if it doesn't work"
	echo
}

src_install() {
	# Make the root directory for the installation.
	dodir /opt/${P}

	# Copy each of the directories over.
	local dirs="bin include include-old jre lib"
	for i in $dirs ; do
		cp -dPR $i ${D}/opt/${P}/
	done

	# Copy the documentation to Gentoo's documentation directory.
	dodoc CHANGES COPYRIGHT README LICENSE
	dohtml README.html

	# Copy the demo and the source jar to a share directory
	dodir /opt/${P}/share/
	cp -dPR demo src.jar ${D}/opt/${P}/share/

	# Symlink to maintain the directory structure
	dosym /opt/${P}/share/demo /opt/${P}
	dosym /opt/${P}/share/src.jar /opt/${P}

	# From Mozilla's release notes for 1.x:
	# "Java J2SE releases previous to 1.3.0_01 will not work with Mozilla"
	# In Mozilla 1.2.x and higher, they go on to strongly recommend JDK 1.4.x
	# only.

	set_java_env ${FILESDIR}/${VMHANDLE} || die
}

pkg_postinst() {
	# Set as default VM if none exists
	java_pkg_postinst

	# Again, this will not work as a Mozilla plugin.
	if use mozilla ; then
		echo
		einfo "JDK 1.2.2 does not work with Mozilla.  A more recent JDK is"
		einfo "required."
	fi

	# Warn the user if they don't appear to have XFree86 installed.
	if ! use X ; then
		echo
		ewarn "Some parts of Sun's JDK require XFree86 to be installed."
		ewarn "Be careful which Java libraries you attempt to use."
	fi
}