Mercurial > hg > portage
comparison dev-java/sun-jdk/sun-jdk-1.4.2.19.ebuild @ 146:44698527bb83
preserve sun-jdk-1.4 from the offical portage
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Wed, 18 Nov 2009 10:35:12 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
145:93b38fc95d26 | 146:44698527bb83 |
---|---|
1 # Copyright 1999-2009 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.4.2.19.ebuild,v 1.4 2009/05/29 20:30:58 caster Exp $ | |
4 | |
5 JAVA_SUPPORTS_GENERATION_1="true" | |
6 inherit pax-utils java-vm-2 eutils | |
7 | |
8 MY_PV=${PV%.*}_${PV##*.} | |
9 MY_PN=j2sdk | |
10 MY_P=${MY_PN}${MY_PV} | |
11 MY_PVB=${PV%.*} | |
12 | |
13 At="j2sdk-${PV//./_}-linux-i586.bin" | |
14 jce_policy="jce_policy-${MY_PVB//./_}.zip" | |
15 | |
16 S="${WORKDIR}/${MY_P}" | |
17 DESCRIPTION="Sun's Java SE Development Kit" | |
18 HOMEPAGE="http://java.sun.com/j2se/1.4.2/" | |
19 SRC_URI="x86? ( ${At} ) | |
20 jce? ( ${jce_policy} )" | |
21 SLOT="1.4" | |
22 LICENSE="sun-bcla-java-vm" | |
23 KEYWORDS="x86" | |
24 # files are prestripped | |
25 RESTRICT="fetch strip" | |
26 IUSE="X alsa doc examples jce nsplugin odbc" | |
27 | |
28 DEPEND="sys-apps/sed | |
29 app-arch/unzip" | |
30 | |
31 RDEPEND=" | |
32 alsa? ( media-libs/alsa-lib ) | |
33 doc? ( =dev-java/java-sdk-docs-1.4.2* ) | |
34 X? ( | |
35 x11-libs/libXext | |
36 x11-libs/libXi | |
37 x11-libs/libXp | |
38 x11-libs/libXtst | |
39 x11-libs/libXt | |
40 x11-libs/libX11 | |
41 ) | |
42 odbc? ( dev-db/unixODBC )" | |
43 | |
44 JAVA_PROVIDE="jdbc-stdext" | |
45 | |
46 DL_PREFIX="https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_Developer-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=" | |
47 DOWNLOAD_URL="${DL_PREFIX}${MY_PN}-${MY_PV}-oth-JPR@CDS-CDS_Developer" | |
48 DOWNLOAD_URL_JCE="${DL_PREFIX}7503-jce-1.4.2-oth-JPR@CDS-CDS_Developer" | |
49 | |
50 QA_TEXTRELS_x86="opt/${P}/jre/lib/i386/libawt.so | |
51 opt/${P}/jre/plugin/i386/ns4/libjavaplugin.so | |
52 opt/${P}/jre/plugin/i386/ns610/libjavaplugin_oji.so | |
53 opt/${P}/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so" | |
54 QA_DT_HASH="opt/${P}/.*" | |
55 | |
56 pkg_nofetch() { | |
57 einfo "Please download ${At} from:" | |
58 einfo ${DOWNLOAD_URL} | |
59 einfo "and move it to ${DISTDIR}" | |
60 if use jce; then | |
61 echo | |
62 einfo "Also download ${jce_policy} from:" | |
63 einfo ${DOWNLOAD_URL_JCE} | |
64 einfo "Java(TM) Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files" | |
65 einfo "and move it to ${DISTDIR}" | |
66 fi | |
67 } | |
68 | |
69 src_unpack() { | |
70 if [ ! -r "${DISTDIR}/${At}" ]; then | |
71 die "cannot read ${At}. Please check the permission and try again." | |
72 fi | |
73 if use jce; then | |
74 if [ ! -r "${DISTDIR}/${jce_policy}" ]; then | |
75 die "cannot read ${jce_policy}. Please check the permission and try again." | |
76 fi | |
77 fi | |
78 #Search for the ELF Header | |
79 testExp=$(echo -e '\0177\0105\0114\0106\0001\0001\0001') | |
80 startAt=`grep -aonm 1 ${testExp} ${DISTDIR}/${At} | cut -d: -f1` | |
81 tail -n +${startAt} "${DISTDIR}/${At}" > install.sfx | |
82 chmod +x install.sfx | |
83 ./install.sfx || die | |
84 rm install.sfx | |
85 | |
86 if [[ -f ${S}/lib/unpack ]]; then | |
87 UNPACK_CMD=${S}/lib/unpack | |
88 chmod +x $UNPACK_CMD | |
89 sed -i 's#/tmp/unpack.log#/dev/null\x00\x00\x00\x00\x00\x00#g' $UNPACK_CMD | |
90 local PACKED_JARS="lib/tools.jar jre/lib/rt.jar jre/lib/jsse.jar \ | |
91 jre/lib/charsets.jar jre/lib/ext/localedata.jar jre/lib/plugin.jar \ | |
92 jre/javaws/javaws.jar" | |
93 for i in $PACKED_JARS; do | |
94 PACK_FILE=${S}/`dirname $i`/`basename $i .jar`.pack | |
95 if [ -f ${PACK_FILE} ]; then | |
96 echo " unpacking: $i" | |
97 $UNPACK_CMD ${PACK_FILE} "${S}"/$i | |
98 rm -f ${PACK_FILE} | |
99 fi | |
100 done | |
101 fi | |
102 } | |
103 | |
104 src_install() { | |
105 local dirs="bin include jre lib man" | |
106 dodir /opt/${P} | |
107 | |
108 cp -dPR ${dirs} "${D}/opt/${P}/" | |
109 | |
110 # Set PaX markings on all JDK/JRE executables to allow code-generation on | |
111 # the heap by the JIT compiler. | |
112 pax-mark srpm $(list-paxables "${D}"/opt/${P}/{,/jre}/bin/*) | |
113 | |
114 dodoc COPYRIGHT README THIRDPARTYLICENSEREADME.txt || die | |
115 dohtml README.html || die | |
116 if use examples; then | |
117 cp -pPR demo "${D}/opt/${P}/" || die | |
118 fi | |
119 | |
120 cp -pPR src.zip "${D}/opt/${P}/" || die | |
121 | |
122 if use jce ; then | |
123 # Using unlimited jce while still retaining the strong jce | |
124 # May have repercussions when you find you cannot symlink libraries | |
125 # in classpaths. | |
126 cd "${D}/opt/${P}/jre/lib/security" | |
127 unzip "${DISTDIR}/${jce_policy}" | |
128 mv jce unlimited-jce | |
129 dodir /opt/${P}/jre/lib/security/strong-jce | |
130 mv "${D}/opt/${P}/jre/lib/security/US_export_policy.jar" \ | |
131 "${D}/opt/${P}/jre/lib/security/strong-jce" || die | |
132 mv "${D}/opt/${P}/jre/lib/security/local_policy.jar" \ | |
133 "${D}/opt/${P}/jre/lib/security/strong-jce" || die | |
134 dosym /opt/${P}/jre/lib/security/unlimited-jce/US_export_policy.jar /opt/${P}/jre/lib/security/ | |
135 dosym /opt/${P}/jre/lib/security/unlimited-jce/local_policy.jar /opt/${P}/jre/lib/security/ | |
136 fi | |
137 | |
138 if use nsplugin; then | |
139 local plugin_dir="ns610" | |
140 if has_version '>=sys-devel/gcc-3.2' ; then | |
141 plugin_dir="ns610-gcc32" | |
142 fi | |
143 | |
144 install_mozilla_plugin /opt/${P}/jre/plugin/i386/${plugin_dir}/libjavaplugin_oji.so | |
145 fi | |
146 | |
147 # bug #147259 | |
148 dosym ../jre/javaws/javaws /opt/${P}/bin/javaws | |
149 dosym ../javaws/javaws /opt/${P}/jre/bin/javaws | |
150 | |
151 # create dir for system preferences | |
152 dodir /opt/${P}/.systemPrefs | |
153 # Create files used as storage for system preferences. | |
154 touch "${D}/opt/${P}/.systemPrefs/.system.lock" | |
155 chmod 644 "${D}/opt/${P}/.systemPrefs/.system.lock" | |
156 touch "${D}/opt/${P}/.systemPrefs/.systemRootModFile" | |
157 chmod 644 "${D}/opt/${P}/.systemPrefs/.systemRootModFile" | |
158 | |
159 # install control panel for Gnome/KDE | |
160 sed -e "s/INSTALL_DIR\/JRE_NAME_VERSION/\/opt\/${P}\/jre/" \ | |
161 -e "s/\(Name=Java\)/\1 Control Panel ${SLOT}/" \ | |
162 "${D}/opt/${P}/jre/plugin/desktop/sun_java.desktop" > \ | |
163 "${T}/sun_java-${SLOT}.desktop" | |
164 | |
165 domenu "${T}/sun_java-${SLOT}.desktop" | |
166 | |
167 set_java_env | |
168 java-vm_revdep-mask | |
169 } |