wok-stable view get-java6-jre/stuff/get-java6-jre @ rev 6768
Added hd2u. Dos2Unix text file converter. May come handy when getting patches from pastebin.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Mon Oct 18 02:04:40 2010 +0000 (2010-10-18) |
parents | 056125d04927 |
children | b22662429801 |
line source
1 #!/bin/sh
2 # Get and install the SUN Java Runtime Environnement
3 #
4 # (C) 2007-2008 SliTaz - GNU General Public License v3.
5 #
6 # Author : Eric Joseph-Alexandre <erjo@slitaz.org>
8 PACKAGE="java6-jre"
9 VERSION="1.6.0_17"
10 URL="http://javadl.sun.com/webapps/download/AutoDL?BundleId=35675"
11 TARBALL="jre-6u17-linux-i586.bin"
12 TEMP_DIR="/tmp/$PACKAGE.$$"
13 ROOT="$1"
15 # Check if we are root starting anything
16 if test $(id -u) != 0 ; then
17 echo -e "\nYou must be root to run `basename $0`."
18 echo -e "Please type 'su' and root password to become super-user.\n"
19 exit 1
20 fi
22 # Avoid reinstall
23 if [ -d $ROOT/var/lib/tazpkg/installed/$PACKAGE ]; then
24 echo -e "\n$PACKAGE package is already installed.\n"
25 exit 1
26 fi
30 # Create TEMP_DIR
31 CUR_DIR=$(pwd)
32 test -d $TEMP_DIR || mkdir $TEMP_DIR
33 cd $TEMP_DIR
35 # Doanload the file
36 test -f $TARBALL || wget $URL -O $TARBALL
37 if [ ! -f $TARBALL ]; then
38 cd $CUR_DIR
39 rm -rf $TEMP_DIR
40 echo "Could not download $TARBALL. Exiting."
41 exit 1
42 fi
44 # Do not trust 'df' free space
45 sed -i 's/exit 3$//' $TARBALL
47 # Run the install file user may agree to SUN EULA
48 chmod +x $TARBALL
49 ./${TARBALL}
52 # Make the package
53 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
54 # use mv instead of 'cp -a' to save RAM
55 mv jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
57 # extracted pkg can be removed: Save RAM
58 rm -rf $TARBALL
60 #delete unecessary files
61 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jre${VERSION}/man
63 # Create receipt
65 cat > $PACKAGE-$VERSION/receipt <<EOT
66 # SliTaz package receipt.
68 PACKAGE="$PACKAGE"
69 VERSION="$VERSION"
70 CATEGORY="non-free"
71 SHORT_DESC="SUN Java Runtime."
72 DEPENDS="xorg-libXtst"
73 WEB_SITE="http://www.java.com/"
75 post_install()
76 {
77 echo -n "Processing post install commands..."
78 cd /usr/lib/firefox*/plugins
79 ln -s /usr/lib/java/jre\$VERSION/plugin/i386/ns7/libjavaplugin_oji.so
81 cd /usr/bin
82 ln -s /usr/lib/java/jre\$VERSION/bin/java
83 status
84 }
86 post_remove()
87 {
88 rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
89 rm -f /usr/bin/java
90 }
91 EOT
93 # Pack
94 tazpkg pack $PACKAGE-$VERSION
96 # Clean to save RAM memory
97 rm -rf $PACKAGE-$VERSION
99 # Install pseudo package
100 tazpkg install $PACKAGE-$VERSION.tazpkg --root=$ROOT
102 # Clean
103 cd $CUR_DIR
104 rm -rf $TEMP_DIR