Name: get-sun-java Version: 1.6.0_29 Release: %mkrel 1 Url: http://www.java.com/en/download/ # Java test http://java.com/en/download/testjava.jsp License: Proprietary Summary: Download and Install Sun-Java Group: System/Libraries # Allow 64bit users to install the 32bit version which # has features not included in the 64bit version %if %{_arch} == x86_64 %define downloadurl http://javadl.sun.com/webapps/download/AutoDL?BundleId=56692 %define md5 4ef7f348e6190fd780e028a08a84b39c %define binfile AutoDL?BundleId=56692 %define libarch amd64 %else %define downloadurl http://javadl.sun.com/webapps/download/AutoDL?BundleId=56690 %define md5 fcdf57daf2585b279df627b69fc96049 %define binfile AutoDL?BundleId=56690 %define libarch i386 %endif %define tmp_download_dir %{_localstatedir}/lib/%{name} Requires: wget Obsoletes: java-1.6.0-sun <= 1.6.0 Obsoletes: java-1.6.0-openjdk <= 1.6.0 %description This is an installer for Sun-Java-%{version}. This package does not contain any program files as the Sun license no longer allows distribution. By installing this package you will download and install Sun-Java from sun.com. Use the 32-bit version for Java applet and Java Web Start support. You must accept the Java EULA before using it. Please be patient, this is a 20 MB download and may take some time. Removing this package will remove Sun-Java from your system. %pre mkdir -p %{tmp_download_dir} [[ -d %{tmp_download_dir} ]] || exit 1 cd %{tmp_download_dir} || exit 1 if [[ -f %{binfile} ]]; then : else wget --force-clobber --timeout=30 --tries=3 "%{downloadurl}" [[ -f %{binfile} ]] || { echo "Download failed"; rm -r %{tmp_download_dir}; exit 1; } fi md5chk=$(md5sum %{binfile} | cut -d' ' -f1) [[ %{md5} = $md5chk ]] || { echo "Download checksum failed"; rm %{binfile};\ cd ..; rm -r %{tmp_download_dir}; exit 1; } %post mkdir -p %{_datadir}/java cd %{_datadir}/java chmod +x %{tmp_download_dir}/%{binfile} %{tmp_download_dir}/%{binfile} || exit 1 #rm -r %%{tmp_download_dir} # Remove standard Firefox link if [ -d %{_libdir}/mozilla/plugins ]; then [ -f %{_libdir}/mozilla/plugins/libjavaplugin_oji.so ] && \ rm %{_libdir}/mozilla/plugins/libjavaplugin_oji.so # Add Firefox plugin link cd %{_libdir}/mozilla/plugins && ln -s %{_datadir}/java/jre%{version}/lib/%{libarch}/libnpjp2.so fi # ? cd /etc/alternatives ln -sf %{_datadir}/java/jre%{version}/bin/java %preun rm -rf %{_datadir}/java/jre%{version} rm %{_libdir}/mozilla/plugins/libnpjp2.so %files