1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-java/sun-jdk/sun-jdk-1.5.0.05.ebuild,v 1.2 2005/10/10 16:23:12 betelgeuse Exp $
5 inherit pax-utils eutils java-pkg-2 java-vm-2
8 openjdk
="openjdk-7-ea-src-b21-27_sep_2007.zip"
10 DESCRIPTION
="Open Source JDK"
11 HOMEPAGE
="https://openjdk.dev.java.net/"
12 SRC_URI
="http://icedtea.classpath.org/download/source/${P}.tar.gz
13 http://download.java.net/openjdk/jdk7/promoted/b21/${openjdk}"
16 # Needs other for Apache asm etc see THIRD_PARTY_README
17 LICENSE
="GPL-2-with-linking-exception sun-prerelease-jdk7"
18 KEYWORDS
="~amd64 ~x86"
19 IUSE
="nsplugin xulrunner"
29 nsplugin? ( net-libs/xulrunner )"
31 # Found by included libs but not built by default I think:
33 # Bundled (should make it to use system copy):
48 x11-proto/xineramaproto
50 >=dev-java/eclipse-ecj-3.3
52 xulrunner? ( net-libs/xulrunner )
55 RDEPEND
="${COMMON_DEP}
56 doc? ( =dev-java/java-sdk-docs-1.6.0* )
61 JAVA_PROVIDE
="jdbc-stdext jdbc-rowset"
64 if ! built_with_use sys-devel
/gcc gcj
; then
65 eerror
"You need to build sys-devel/gcc with USE=gcj enabled."
66 die
"gcc w/o gcj-support detected."
68 einfo
"gcc compiled with gcj-support =)"
77 cp ${DISTDIR}/${openjdk} ${S} || die
"copy of openjdk failed"
81 rm -v ${S}/patches
/icedtea-debuginfo.
patch
83 epatch
"${FILESDIR}/icedtea-1.4-gentoo.patch"
84 epatch
"${FILESDIR}/icedtea-1.4-no-werror.patch"
86 if use xulrunner
; then
87 epatch
"${FILESDIR}/icedtea-1.4-xulrunner.patch"
94 local SUNJDK
="$(java-config --select-vm=sun-jdk-1.7 -O)"
95 #local GCJJDK="$(java-config --select-vm=gcj-jdk-4.3 -O)"
96 local GCJJDK
="/usr/share/$CHOST/$(has_version gcc)java"
97 local ECJJAR
=$
(grep CLASS
/usr
/share
/eclipse-ecj-3.
[3,4]*/package.env |
awk -F= '{print $2}')
101 unset JAVA_HOME CLASSPATH LD_LIBRARY_PATH
103 .
/configure
--with-ecj-jar=${ECJJAR} \
104 --with-libgcj-jar=${GCJJDK} \
105 --with-icedtea-home=${SUNJDK} || die
'configure failed'
107 #--with-gcj-home=/usr/lib/gcj \
111 COMPILER_WARNINGS_FATAL
=false \
112 MILESTONE
=experimental \
113 BUILD_NUMBER
=gentoo-
${P} || die
'make failed'
118 local ddest
="${D}/${dest}"
122 [[ ${ARCH} = amd64
]] && arch
=amd64
124 cd ${S}/openjdk
/control
/build
/linux-
${arch}/
127 dohtml
-r docs
/* || die
132 # For some people the files got 600 so doing it manually
133 # should be investigated why this happened
134 if is-java-strict
; then
135 if [[ $
(find .
-perm 600) ]]; then
136 eerror
"OpenJDK built with permission mask 600"
137 eerror
"report this on #gentoo-java on freenode"
141 # doins can't handle symlinks
142 cp -vRP bin include jre lib man
"${ddest}" || die
"failed to copy"
143 find "${ddest}" -type f
-exec chmod 644 {} +
144 find "${ddest}" -type d
-exec chmod 755 {} +
145 chmod 755 ${ddest}/bin
/* \
147 ${ddest}/jre
/lib
/*/*.
{so
,cfg
} \
148 ${ddest}/jre
/lib
/*/*/*.so \
149 ${ddest}/jre
/lib
/jexec \
150 ${ddest}/lib
/jexec || die
152 if [[ $
(find "${ddest}" -perm 600) ]]; then
153 eerror
"Files with permission set to 600 found in the image"
154 eerror
"please report this to java@gentoo.org"
157 pax-mark m $
(list-paxables
${ddest}{,/jre
}/bin
/*)
159 dodoc LICENSE ASSEMBLY_EXCEPTION THIRD_PARTY_README || die
160 dohtml README.html || die
162 if use examples
; then
163 cp -pPR demo sample
"${ddest}/share/"
166 cp src.
zip "${ddest}" || die
168 if use nsplugin
; then
169 local plugin_dir
="ns7-gcc29"
170 if has_version
'>=sys-devel/gcc-3' ; then
173 install_mozilla_plugin
/opt
/${P}/jre
/lib
/${arch}/gcjwebplugin.so
176 # create dir for system preferences
177 dodir
/opt
/${P}/jre
/.systemPrefs
178 # Create files used as storage for system preferences.
179 touch ${D}/opt
/${P}/jre
/.systemPrefs
/.system.lock
180 chmod 644 ${D}/opt
/${P}/jre
/.systemPrefs
/.system.lock
181 touch ${D}/opt
/${P}/jre
/.systemPrefs
/.systemRootModFile
182 chmod 644 ${D}/opt
/${P}/jre
/.systemPrefs
/.systemRootModFile
188 # Set as default VM if none exists
189 java-vm-2_pkg_postinst
191 ewarn
"!!!!!! THIS IS SOO BETA ITS ALPHA !!!!!!"