wok-stable view get-java6-jre/stuff/get-java6-jre.sh @ rev 1640

Add vpnc
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Oct 25 10:50:48 2008 +0000 (2008-10-25)
parents c1b4ae2bdeca
children
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_07"
10 URL="http://javadl.sun.com/webapps/download/AutoDL?BundleId=23103"
11 TARBALL="jre-6u7-linux-i586.bin"
12 TEMP_DIR="/tmp/$PACKAGE.$$"
14 # Check if we are root starting anything
15 if test $(id -u) != 0 ; then
16 echo -e "\nYou must be root to run `basename $0`."
17 echo -e "Please type 'su' and root password to become super-user.\n"
18 exit 1
19 fi
21 # Avoid reinstall
22 if [ -d /var/lib/tazpkg/installed/$PACKAGE ]; then
23 echo -e "\n$PACKAGE package is already installed.\n"
24 exit 1
25 fi
29 # Create TEMP_DIR
30 test -d $TEMP_DIR || mkdir $TEMP_DIR
31 cd $TEMP_DIR
33 # Doanload the file
34 test -f $TARBALL || wget $URL -O $TARBALL
36 # Do not trust 'df' free space
37 sed -i 's/exit 3$//' $TARBALL
39 # Run the install file user may agree to SUN EULA
40 chmod +x $TARBALL
41 ./${TARBALL}
44 # Make the package
45 mkdir -p $PACKAGE-$VERSION/fs/usr/lib/java
46 cp -a jre${VERSION} $PACKAGE-$VERSION/fs/usr/lib/java
49 #delete unecessary files
50 rm -rf $PACKAGE-$VERSION/fs/usr/lib/java/jre${VERSION}/man
52 # Create receipt
54 cat > $PACKAGE-$VERSION/receipt <<EOT
55 # SliTaz package receipt.
57 PACKAGE="$PACKAGE"
58 VERSION="$VERSION"
59 CATEGORY="non-free"
60 SHORT_DESC="SUN Java Runtime."
61 DEPENDS=""
62 WEB_SITE="http://www.java.com/"
64 post_install()
65 {
66 echo "Processing post install commands..."
67 for i in /usr/lib/firefox*; do
68 [ -d \$i ] || continue
69 cd \$i/plugins
70 ln -s /usr/lib/java/jre\$VERSION/plugin/i386/ns7/libjavaplugin_oji.so
71 done
73 cd /usr/bin
74 ln -s /usr/lib/java/jre\$VERSION/bin/java
75 }
77 post_remove()
78 {
79 rm -f /usr/lib/firefox*/plugins/libjavaplugin_oji.so
80 rm -f /usr/bin/java
81 }
82 EOT
84 # Pack
85 tazpkg pack $PACKAGE-$VERSION
87 # Install pseudo package
88 tazpkg install $PACKAGE-$VERSION.tazpkg
90 # Clean
91 cd /tmp
92 rm -rf $TEMP_DIR